[petsc-users] multiple definition of `main' with intel compilers

Alfredo Jaramillo ajaramillopalma at gmail.com
Thu May 21 16:29:13 CDT 2020


dear PETSc team,

I have compiled PETSc with a 2016 version of the intel compilers. The
installation went well, but when I tried to compile my code the following
error appears in the final step of compilation (linking with ld)

../build/linux_icc/obj_linux_icc_opt/main.o: In function `main':
main.c:(.text+0x0): multiple definition of `main'
/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/libifcore_pic.a(for_main.o):for_main.c:(.text+0x0):
first defined here
/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/libifcore_pic.a(for_main.o):
In function `main':
for_main.c:(.text+0x3e): undefined reference to `MAIN__'

I searched for this and I found that the option "-nofor_main" should be
added when compiling with ifort, but our code is written only in C an C++.
The FORTRAN compiler is used when PETSc compiles MUMPS. So I dont know if
this would work for this case.

The configure.log file and the log of the compilation giving the error are
attached to this message. These logs were obtained in a cluster, I'm
getting the same error on my personal computer with a 2020 version of the
Intel Parallel Studio.

thank you for any help on this
Alfredo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200521/7458feb4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log_make
Type: application/octet-stream
Size: 53528 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200521/7458feb4/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.log.7z
Type: application/x-7z-compressed
Size: 149825 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200521/7458feb4/attachment-0001.bin>


More information about the petsc-users mailing list