You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered problems compiling the p3dfft++ package on a workstation with GCC 8.4.1 and OpenMPI. The command lines:
./configure --prefix=$HOME/software/build/p3dfft3 --enable-gnu --enable-fftw --with-fftw=$HOME/software/build/fftw-3.3.9 --enable-fftwmeasure
make
The Fortran sample code failed to build with the following and many similar errors
../../build/libp3dfft.3.a(init.o): In function `MPI::Intracomm::Clone() const':
/usr/include/openmpi-x86_64/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()'
The problem seems to be that the MPI compiler wrappers do not reference all the necessary library files (might this have something to do with C++ binding get deprecated in MPI?). To compile Fortran code against the c++ library, ether mpif90 or mpicxx can be used, but neither handles the linking correctly.
The temporary fixes are:
If using mpif90 to link the Fortran sample code, pass the additional -lmpi_cxx flag which is not in the wrapper. I pass this extra flag using the LDFLAGS env variable to the configure script to fix everything
If using mpicxx to link the Fortran sample code, pass -lgfortran flag to pick up the Fortran symbols. In addition, passing -lmpi_mpifh is also required as the sample code still use the old include 'mpif.h' way to include the MPI symbols.
Not sure how these can be incorporated in the software distribution and automated.
The text was updated successfully, but these errors were encountered:
I encountered problems compiling the p3dfft++ package on a workstation with GCC 8.4.1 and OpenMPI. The command lines:
The Fortran sample code failed to build with the following and many similar errors
The problem seems to be that the MPI compiler wrappers do not reference all the necessary library files (might this have something to do with C++ binding get deprecated in MPI?). To compile Fortran code against the c++ library, ether mpif90 or mpicxx can be used, but neither handles the linking correctly.
The temporary fixes are:
-lmpi_cxx
flag which is not in the wrapper. I pass this extra flag using the LDFLAGS env variable to the configure script to fix everything-lgfortran
flag to pick up the Fortran symbols. In addition, passing-lmpi_mpifh
is also required as the sample code still use the oldinclude 'mpif.h'
way to include the MPI symbols.Not sure how these can be incorporated in the software distribution and automated.
The text was updated successfully, but these errors were encountered: