<div dir="ltr"><div>In fact,  removing -lifcore_pic from PETSC_DIR/PETSC_ARCH/lib/petscvariables solved the problem (this was the first I traied and it worked), it compiles and the program runs fine.</div><div><br></div><div>Also, -lpetsc was being listed some times when compiling .c to .o, I fixed that in the scripts. <br></div><div><br></div><div>Now, I'm a bit lost about when fcoremt_pic is being linked or if it is necessary at all?<br></div><div><br></div><div>thank you very much!</div><div>alfredo<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 21, 2020 at 7:21 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For one - PETSc is built without -qopenmp flag - but your makefile is using it. Intel compiler can link in with<br>
different [incompatible] compiler libraries when some flags change this way [causing conflict].<br>
<br>
However - the issue could be:<br>
<br>
your makefile is listing PETSC_LIB [or however you are accessing petsc info from petsc makefiles] redundantly.<br>
<br>
i.e<br>
<br>
 - its listing -lpetsc  etc when compiling .c to .o files [this should not happen]<br>
 - its listing -lpetsc  etc twice [-lifcore_pic is listed once though] - don't know if this is the reason for the problem.<br>
<br>
You can try [manually] removing -lifcore_pic from PETSC_DIR/PETSC_ARCH/lib/petscvariables - and see if this problem goes away<br>
<br>
Satish<br>
<br>
On Thu, 21 May 2020, Alfredo Jaramillo wrote:<br>
<br>
> here is the output:<br>
> <br>
> alfredo.jaramillo@sdumont11 tutorials]$ make ex19<br>
> mpiicc -fPIC -O3 -march=native -mtune=native  -fPIC -O3 -march=native<br>
> -mtune=native  -I/scratch/simulreserv/softwares/petsc-3.13.0/include<br>
> -I/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/include<br>
> -I/scratch/simulreserv/softwares/valgrind-3.15.0/include<br>
>  -I/scratch/app/zlib/1.2.11/include    ex19.c<br>
>  -Wl,-rpath,/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -L/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -Wl,-rpath,/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -L/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib/release_mt<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib/release_mt<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/clck/<br>
> <a href="http://3.1.2.006/lib/intel64" rel="noreferrer" target="_blank">3.1.2.006/lib/intel64</a> -L/opt/intel/parallel_studio_xe_2016_update2/clck/<br>
> <a href="http://3.1.2.006/lib/intel64" rel="noreferrer" target="_blank">3.1.2.006/lib/intel64</a><br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/ipp/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/ipp/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64/gcc4.4<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64/gcc4.4<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/daal/lib/intel64_lin<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/daal/lib/intel64_lin<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64_lin/gcc4.4<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64_lin/gcc4.4<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin<br>
> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.8.5<br>
> -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5<br>
> -Wl,-rpath,/opt/intel/mpi-rt/5.1/intel64/lib/release_mt<br>
> -Wl,-rpath,/opt/intel/mpi-rt/5.1/intel64/lib -lpetsc -lHYPRE -lcmumps<br>
> -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lopenblas<br>
> -lstdc++ -ldl -lmpifort -lmpi -lmpigi -lrt -lpthread -lifport -lifcore_pic<br>
> -limf -lsvml -lm -lipgo -lirc -lgcc_s -lirc_s -lquadmath -lstdc++ -ldl -o<br>
> ex19<br>
> [alfredo.jaramillo@sdumont11 tutorials]$ make ex5f<br>
> mpiifort -fPIC -O3 -march=native -mtune=native<br>
> -I/scratch/simulreserv/softwares/petsc-3.13.0/include<br>
> -I/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/include<br>
> -I/scratch/simulreserv/softwares/valgrind-3.15.0/include      ex5f.F90<br>
>  -Wl,-rpath,/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -L/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -Wl,-rpath,/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -L/scratch/simulreserv/softwares/petsc-3.13.0/x64-O3-3.13-intel2016-64/lib<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib/release_mt<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib/release_mt<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mpi/intel64/lib<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/clck/<br>
> <a href="http://3.1.2.006/lib/intel64" rel="noreferrer" target="_blank">3.1.2.006/lib/intel64</a> -L/opt/intel/parallel_studio_xe_2016_update2/clck/<br>
> <a href="http://3.1.2.006/lib/intel64" rel="noreferrer" target="_blank">3.1.2.006/lib/intel64</a><br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/ipp/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/ipp/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64/gcc4.4<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64/gcc4.4<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/daal/lib/intel64_lin<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/daal/lib/intel64_lin<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64_lin/gcc4.4<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64_lin/gcc4.4<br>
> -Wl,-rpath,/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin<br>
> -L/opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin<br>
> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.8.5<br>
> -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5<br>
> -Wl,-rpath,/opt/intel/mpi-rt/5.1/intel64/lib/release_mt<br>
> -Wl,-rpath,/opt/intel/mpi-rt/5.1/intel64/lib -lpetsc -lHYPRE -lcmumps<br>
> -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lopenblas<br>
> -lstdc++ -ldl -lmpifort -lmpi -lmpigi -lrt -lpthread -lifport -lifcore_pic<br>
> -limf -lsvml -lm -lipgo -lirc -lgcc_s -lirc_s -lquadmath -lstdc++ -ldl -o<br>
> ex5f<br>
> <br>
> [alfredo.jaramillo@sdumont11 tutorials]$ ./ex5f<br>
> Number of SNES iterations =     4<br>
> <br>
> [alfredo.jaramillo@sdumont11 tutorials]$ ./ex19<br>
> lid velocity = 0.0625, prandtl # = 1., grashof # = 1.<br>
> Number of SNES iterations = 2<br>
> <br>
> On Thu, May 21, 2020 at 6:53 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> <br>
> > Please copy/paste complete [compile] commands from:<br>
> ><br>
> > src/snes/tutorials/<br>
> > make clean<br>
> > make ex19<br>
> > make ex5f<br>
> ><br>
> > Likely the link command used in your code is different than what is used<br>
> > here - triggering errors.<br>
> ><br>
> > Satish<br>
> ><br>
> > On Thu, 21 May 2020, Alfredo Jaramillo wrote:<br>
> ><br>
> > > hello Satish, no the tests seem to be ok altough some error related to<br>
> > mpd.<br>
> > ><br>
> > > ==============THE TESTS===================<br>
> > ><br>
> > > Running check examples to verify correct installation<br>
> > > Using PETSC_DIR=/scratch/simulreserv/softwares/petsc-3.13.0 and<br>
> > > PETSC_ARCH=x64-O3-3.13-intel2016-64<br>
> > > Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process<br>
> > > See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
> > > mpiexec_sdumont11: cannot connect to local mpd<br>
> > > (/tmp/mpd2.console_alfredo.jaramillo); possible causes:<br>
> > >   1. no mpd is running on this host<br>
> > >   2. an mpd is running but was started without a "console" (-n option)<br>
> > > Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes<br>
> > > See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
> > > mpiexec_sdumont11: cannot connect to local mpd<br>
> > > (/tmp/mpd2.console_alfredo.jaramillo); possible causes:<br>
> > >   1. no mpd is running on this host<br>
> > >   2. an mpd is running but was started without a "console" (-n option)<br>
> > > 1,5c1,3<br>
> > > < lid velocity = 0.0016, prandtl # = 1., grashof # = 1.<br>
> > > <   0 SNES Function norm 0.0406612<br>
> > > <   1 SNES Function norm 4.12227e-06<br>
> > > <   2 SNES Function norm 6.098e-11<br>
> > > < Number of SNES iterations = 2<br>
> > > ---<br>
> > > > mpiexec_sdumont11: cannot connect to local mpd<br>
> > > (/tmp/mpd2.console_alfredo.jaramillo); possible causes:<br>
> > > >   1. no mpd is running on this host<br>
> > > >   2. an mpd is running but was started without a "console" (-n option)<br>
> > > /scratch/simulreserv/softwares/petsc-3.13.0/src/snes/tutorials<br>
> > > Possible problem with ex19 running with hypre, diffs above<br>
> > > =========================================<br>
> > > 1,9c1,3<br>
> > > < lid velocity = 0.0625, prandtl # = 1., grashof # = 1.<br>
> > > <   0 SNES Function norm 0.239155<br>
> > > <     0 KSP Residual norm 0.239155<br>
> > > <     1 KSP Residual norm < 1.e-11<br>
> > > <   1 SNES Function norm 6.81968e-05<br>
> > > <     0 KSP Residual norm 6.81968e-05<br>
> > > <     1 KSP Residual norm < 1.e-11<br>
> > > <   2 SNES Function norm < 1.e-11<br>
> > > < Number of SNES iterations = 2<br>
> > > ---<br>
> > > > mpiexec_sdumont11: cannot connect to local mpd<br>
> > > (/tmp/mpd2.console_alfredo.jaramillo); possible causes:<br>
> > > >   1. no mpd is running on this host<br>
> > > >   2. an mpd is running but was started without a "console" (-n option)<br>
> > > /scratch/simulreserv/softwares/petsc-3.13.0/src/snes/tutorials<br>
> > > Possible problem with ex19 running with mumps, diffs above<br>
> > > =========================================<br>
> > > Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI<br>
> > > process<br>
> > > See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
> > > mpiexec_sdumont11: cannot connect to local mpd<br>
> > > (/tmp/mpd2.console_alfredo.jaramillo); possible causes:<br>
> > >   1. no mpd is running on this host<br>
> > >   2. an mpd is running but was started without a "console" (-n option)<br>
> > > Completed test examples<br>
> > ><br>
> > > ===============================<br>
> > ><br>
> > > I entered in src/snes/tutorials/ and executed "make ex5f". The binary<br>
> > exf5<br>
> > > was created<br>
> > ><br>
> > ><br>
> > ><br>
> > > On Thu, May 21, 2020 at 6:37 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> > ><br>
> > > > Do you get this error when building PETSc examples [C and/or fortran] -<br>
> > > > when you build them with the corresponding petsc makefile?<br>
> > > ><br>
> > > > Can you send the log of the example compiles?<br>
> > > ><br>
> > > > Satish<br>
> > > ><br>
> > > > ---<br>
> > > ><br>
> > > > [the attachment got deleted - don't know by who..]<br>
> > > ><br>
> > > > DENIAL OF SERVICE ALERT<br>
> > > ><br>
> > > > A denial of service protection limit was exceeded. The file has been<br>
> > > > removed.<br>
> > > > Context: 'configure.log.7z'<br>
> > > > Reason: The data size limit was exceeded<br>
> > > > Limit: 10 MB<br>
> > > > Ticket Number : 0c9c-5ec6-f30f-0001<br>
> > > ><br>
> > > ><br>
> > > > For further information, contact your system administrator.<br>
> > > > Copyright 1999-2014 McAfee, Inc.<br>
> > > > All Rights Reserved.<br>
> > > > <a href="http://www.mcafee.com" rel="noreferrer" target="_blank">http://www.mcafee.com</a><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > On Thu, 21 May 2020, Alfredo Jaramillo wrote:<br>
> > > ><br>
> > > > > dear PETSc team,<br>
> > > > ><br>
> > > > > I have compiled PETSc with a 2016 version of the intel compilers. The<br>
> > > > > installation went well, but when I tried to compile my code the<br>
> > following<br>
> > > > > error appears in the final step of compilation (linking with ld)<br>
> > > > ><br>
> > > > > ../build/linux_icc/obj_linux_icc_opt/main.o: In function `main':<br>
> > > > > main.c:(.text+0x0): multiple definition of `main'<br>
> > > > ><br>
> > > ><br>
> > /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):<br>
> > > > > first defined here<br>
> > > > ><br>
> > > ><br>
> > /opt/intel/parallel_studio_xe_2016_update2/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/libifcore_pic.a(for_main.o):<br>
> > > > > In function `main':<br>
> > > > > for_main.c:(.text+0x3e): undefined reference to `MAIN__'<br>
> > > > ><br>
> > > > > I searched for this and I found that the option "-nofor_main" should<br>
> > be<br>
> > > > > added when compiling with ifort, but our code is written only in C an<br>
> > > > C++.<br>
> > > > > The FORTRAN compiler is used when PETSc compiles MUMPS. So I dont<br>
> > know if<br>
> > > > > this would work for this case.<br>
> > > > ><br>
> > > > > The configure.log file and the log of the compilation giving the<br>
> > error<br>
> > > > are<br>
> > > > > attached to this message. These logs were obtained in a cluster, I'm<br>
> > > > > getting the same error on my personal computer with a 2020 version<br>
> > of the<br>
> > > > > Intel Parallel Studio.<br>
> > > > ><br>
> > > > > thank you for any help on this<br>
> > > > > Alfredo<br>
> > > > ><br>
> > > ><br>
> > > ><br>
> > ><br>
> ><br>
> ><br>
> <br>
<br>
</blockquote></div>