Closed perazz closed 1 year ago
The same happens with pgf90, the option should be -Mnomain in that case.
Confirmed, I found that here. I will now add the same option for pgif90/nvfortran, but unfortunately we have no way to test it in the CI.
Closed by #896.
Description
fpm packages that have a C or a C++ main program do not build when using
ifort
/icc
as the project compiler.The error returned is:
multiple definition of main
This discussion on Stackoverflow suggests using an ifort-specific linker flag to tell the linker that the main program is not a Fortran one.
Expected Behaviour
fpm should work in these cases, like it does with gcc/gfortran
Version of fpm
0.8.1
Platform and Architecture
ubuntu-22.04 x86_64
Additional Information
If I build one of the C/C++ example packages I get:
If I add the
-nofor-main
flag, it works: