With non-default GCC in /etc/make.conf, e.g. DEFAULT_VERSIONS=gcc=6 there is an anomaly between net/mpich, net/openmpi and net/openmpi2. $ /usr/local/bin/mpif90 --version GNU Fortran (FreeBSD Ports Collection) 6.3.1 20161229 $ /usr/local/bin/mpif90 z.f90 $ /usr/local/bin/mpirun -np 3 ./a.out node 1 : Hello world node 2 : Hello world node 0 : Hello world However, with openmpi (same with net/openmpi2): $ /usr/local/mpi/openmpi/bin/mpif90 --version GNU Fortran (FreeBSD Ports Collection) 6.3.1 20161229 $ /usr/local/mpi/openmpi/bin/mpif90 z.f90 $ /usr/local/mpi/openmpi/bin/mpirun -np 3 ./a.out ------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code.. Per user-direction, the job has been aborted. ------------------------------------------------------- /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc49/libgfortran.so.3 not found /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc49/libgfortran.so.3 not found so I need to pass -rpath to mpif90: $ /usr/local/mpi/openmpi/bin/mpif90 -Wl,-rpath="/usr/local/lib/gcc6" z.f90 $ /usr/local/mpi/openmpi/bin/mpirun -np 3 ./a.out node 0 : Hello world node 1 : Hello world node 2 : Hello world I'd prefer openmpi and openmpi2 to behave as mpich. This helps ports such as lang/opencoarrays, which can be built with a selection of MPI ports.
Add to /etc/libmap.conf: libgcc_s.so.1 gcc5/libgcc_s.so.1
To w.schwarzenfeld@utanet.at: Sorry I don't get you. Is this the advice for the end user? Or are you saying the port should do this?
Sorry, it seems I was in the wrong PR.
ping
Created attachment 182781 [details] openmpi2
Can you try the attached patch? I'm not sure if this "problem" should be fixed in OpenMPI though. One can simply use these flags in the application Makefile. Probably there is a better way to pass this flags to linker, change the wrapper with a hard coded value is not a good solution, IMHO. Ideas/patches are welcome.
Thanks! Before I try the patch... I see in net/mpich/Makefile: 40 MPICH_LDFLAGS= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER} \ 41 -L${LOCALBASE}/lib/gcc${_GCC_VER} -B${LOCALBASE}/bin To me this looks better than your -rpath=/usr/local/lib/gcc${GCC_DEFAULT} The point is that this problem only occurs when non-default GCC is used. Do you want to coordinate this change with tijl@ (maintainer of net/mpich)?
Cool. I'll test it asap. Thanks!
A commit references this bug: Author: danilo Date: Sun Jul 9 20:16:50 UTC 2017 New revision: 445409 URL: https://svnweb.freebsd.org/changeset/ports/445409 Log: - Update to 1.10.7 - Use external libevent - Force the wrapper to use rpath pointing to the correct GCC directory. This solves a problem (bug 217750) when a non-default GCC version is used. PR: 217750 Changes: head/net/openmpi/Makefile head/net/openmpi/distinfo head/net/openmpi/pkg-plist
A commit references this bug: Author: danilo Date: Sun Jul 9 21:03:59 UTC 2017 New revision: 445411 URL: https://svnweb.freebsd.org/changeset/ports/445411 Log: - Update to 2.1.1 - Force the wrapper to use rpath pointing to the correct GCC directory. This solves a problem (bug 217750) when a non-default GCC version is used. PR: 217750 Changes: head/net/openmpi2/Makefile head/net/openmpi2/distinfo head/net/openmpi2/pkg-plist