Hello everyone,
When I compile vasp-5.4.4 with aocc4.0 on amd-zen2 platform,I get an error:
ld.lld: error: undefined symbol: MAIN_
>>> referenced by flangmain.c:59 (/home/amd/JENKINS/workspace/AOCC_4_0_0_INTERIM/flang/runtime/flangmain/flangmain.c:59)
>>> flangmain.c.o:(main) in archive /home/xxx/amd/aocc-compiler-4.0.0/bin/../lib/libflangmain.a
>>> did you mean: MAIN__
>>> defined in: /home/xxx/amd/aocc-compiler-4.0.0/bin/../lib/libflangrti.so
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
Is this a bug in the compiler itself?
Solved! Go to Solution.
Hello Yaoming,
Can experiment with below changes in your configuration file?
CPP = flang -E -P -C -w -Mfree $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
FC = mpif90 -fopenmp
FCL = mpif90 -fopenmp
FREE = -ffree-form -ffree-line-length-none
FFLAGS = -w -march=znver3 -fno-fortran-main $(CPP_OPTIONS) -Mbackslash -ffunc-args-alias
Thank you for reaching out.
For AOCC related support, the AMD Server Gurus community is the right place to post any query/issue. I'm moving this post there.
Thanks.
Hello,I met the same problem and use this method,but I still can't solve the problem. Can you give me other advice? Thank you.
Hello, Are you using the same application?
Yes, but I can't solve the problem by changing the configuration file.
Yes, but I can't solve the problem by the answer.
Hi @ppxxyy123, are you still facing issue with above solution provided?
if yes please share the exact error message and build log.
Hello Yaoming,
Can experiment with below changes in your configuration file?
CPP = flang -E -P -C -w -Mfree $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
FC = mpif90 -fopenmp
FCL = mpif90 -fopenmp
FREE = -ffree-form -ffree-line-length-none
FFLAGS = -w -march=znver3 -fno-fortran-main $(CPP_OPTIONS) -Mbackslash -ffunc-args-alias
Thanks for your reply.
This configuration file is indeed valid. The reason for this error is that clang cannot convert the .F file into a .f90 file. What I want to ask you is which compilation option makes its compilation pass.
This is my first time in the community, so I don't know if the message to ask you for advice has been sent out, but this question is very urgent for me, so I have to ask again.
If you change clang to flang then it work as preprocessor (I don't know why this behavior change). But my compilation end at incar_reader where it indicate parathensis not match
Same problem, seems the fortran preprocessor give empty output in AOCC 4.0
Any flag for the preprocessor changed?
Hello David,
Does the post marked as solution in this thread help you?
yes this does solve the problem, thanks!