Dear Users and Developers,
My setup is Lubuntu linux 16.04 + Cantera 2.2.2b1 + Intel compilers 2016 + sundials 2.6 + python 3.5.2 + boost 1.61 + OpenMPI 2.0.1. It works like a charm and even I can use OpenMP.
I have tested MPI linking C++ to FORTRAN with
this code. It worked with these compiling instructions:
#Compile
mpicc -c quad_sub.c
mpif90 quad_sub.o quad_main.f90 -o programa
#run
mpirun -np 8 ./programa
I tried is to compile everything with OpenMPI. So I just made a code that calls some MPI functions in both FOTRAN and C++ in the files attached.
Using the makefile, I get the following error:
make -f MakeFile.MPI all -B
mpicc -c cppwrapper.cpp -pthread -L/home/carlos/.local/lib -lcantera -L/home/carlos/opt/sundials-intel/lib -lsundials_cvodes -lsundials_ida -lsundials_nvecserial -L/opt/intel/mkl/lib/intel64 -lmkl_rt -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -L/usr/local/lib -lboost_system -I/home/carlos/.local/include -I/home/carlos/opt/sundials-intel/include -I/usr/local/include
mpif90 -g -O0 -o test cppwrapper.o fwrapper.f -lc -lstdc++ -pthread -L/home/carlos/.local/lib -lcantera -L/home/carlos/opt/sundials-intel/lib -lsundials_cvodes -lsundials_ida -lsundials_nvecserial -L/opt/intel/mkl/lib/intel64 -lmkl_rt -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -L/usr/local/lib -lboost_system
/usr/bin/ld: /home/carlos/.local/lib/libcantera.a(Methane.os): referencia sin definir al símbolo '__powr8i4'
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64/libimf.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
MakeFile.MPI:22: error in the instructions for the object 'test'
make: *** [test] Error 1
The non-MPI version of these files compiles without problems (It uses OpenMP, see the pragma in the C++ code). That indicates me that I've correctly loaded all the environment variables.
I suspect that the error is due to the fact that there are
2 versions of the same library. The one used to compile fwrapper.f has MPI and the other non-MPI is the one used for Cantera.
I compiled both files separately using the "-c" option to generate only ".o" files. The compilation was successful. There was a warning that told me that the files were not linked.
¿Why is the linker failing?
Thank you very much for your help
Regards,
Carlos