cancel
Showing results for 
Search instead for 
Did you mean: 

Server Processors

yaoming_019
Journeyman III

AOCC4.0-flang error :"ld.lld: error: undefined symbol: MAIN_"

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?

0 Likes
1 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

 

View solution in original post

12 Replies
dipak
Big Boss

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.

 

 

0 Likes

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.

0 Likes

Hello, Are you using the same application?

0 Likes

Yes, but I can't solve the problem by changing the configuration file.

0 Likes

Yes, but I can't solve the problem by the answer.

0 Likes

Hi @ppxxyy123, are you still facing issue with above solution provided? 

if yes please share the exact error message and build log. 

0 Likes

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.

0 Likes

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

0 Likes
davidnormal
Journeyman III

Same problem, seems the fortran preprocessor give empty output in AOCC 4.0 

Any flag for the preprocessor changed?

0 Likes

Hello David,

Does the post marked as solution in this thread help you?

0 Likes

yes this does solve the problem, thanks!

0 Likes