[MacPorts] #62070: mpif90-openmpi-gcc10 fails to link FORTRAN program

MacPorts noreply at macports.org
Sun Jan 17 11:04:07 UTC 2021


#62070: mpif90-openmpi-gcc10 fails to link FORTRAN program
--------------------+---------------------------
 Reporter:  Guymer  |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:  2.6.4
 Keywords:          |       Port:  openmpi-gcc10
--------------------+---------------------------
 == Introduction

 I have been unable to recompile any of my FORTRAN MPI programs since the
 upgrade to Big Sur and the reinstallation of all of my ports, I have been
 able to distil the failure down to a simple "hello world" example. C MPI
 programs appear to work fine, it is only FORTRAN MPI. I am using Big Sur
 11.1 and XCode 12.3, I have manually reinstalled the Command Line Tools
 from the Apple Developer web site too.

 As an aside, the following compile lines are longer than what they would
 normally be because there have been some changes in Big Sur, see
 https://apple.stackexchange.com/questions/408999/gfortran-compiler-error-
 on-mac-os-big-sur on Stack Exchange.

 Right, the actual bug: I have attached two files (bar.c and bar.F90).

 == C "Hello World" without MPI

 Run `/opt/local/bin/gcc-mp-10
 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include bar.c
 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib` and run
 `./a.out` - everything works as expected.

 == C "Hello World" with MPI
 Run `/opt/local/bin/mpicc-openmpi-gcc10
 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include bar.c
 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib` and you
 will get the following output ...

 {{{
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libmpi.dylib) was built
 for newer macOS version (11.1) than being linked (11.0)
 }}}

 ...but it is only a warning, so you can still run `./a.out` - everything
 works as expected.

 == FORTRAN "Hello World" without MPI

 Run `/opt/local/bin/gfortran-mp-10 bar.F90
 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib` and run
 `./a.out` - everything works as expected.

 == FORTRAN "Hello World" with MPI

 Run `/opt/local/bin/mpif90-openmpi-gcc10 bar.F90
 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib` and you
 will get the following output ...

 {{{
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libmpi_usempif08.dylib)
 was built for newer macOS version (11.1) than being linked (11.0)
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libmpi_mpifh.dylib) was
 built for newer macOS version (11.1) than being linked (11.0)
 ld: warning: dylib (/opt/local/lib/openmpi-
 gcc10/libmpi_usempi_ignore_tkr.dylib) was built for newer macOS version
 (11.1) than being linked (11.0)
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libmpi.dylib) was built
 for newer macOS version (11.1) than being linked (11.0)
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libopen-rte.40.dylib) was
 built for newer macOS version (11.1) than being linked (11.0)
 ld: warning: dylib (/opt/local/lib/openmpi-gcc10/libopen-pal.40.dylib) was
 built for newer macOS version (11.1) than being linked (11.0)
 ld: file not found:
 /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL for
 architecture x86_64
 collect2: error: ld returned 1 exit status
 }}}

 ... which contains many warnings and one error - "a.out" was not created
 (this is the bug).

 == Summary

 I have been unable to compile a simple one line FORTRAN program using the
 `mpif90-openmpi-gcc10` wrapper. For some reason it wants to link in OpenCL
 for a simple "Hello World" program. If I run `ls -l
 /System/Library/Frameworks/OpenCL.framework/Versions/A` then I get:

 {{{
 total 0
 drwxr-xr-x  14 root  wheel   448  1 Jan 08:00:00 2020 Libraries
 drwxr-xr-x  36 root  wheel  1152  1 Jan 08:00:00 2020 Resources
 drwxr-xr-x   3 root  wheel    96  1 Jan 08:00:00 2020 _CodeSignature
 drwxr-xr-x   3 root  wheel    96  1 Jan 08:00:00 2020 lib
 }}}

 Should there be anything else there? Or is it that "mpif90-openmpi-gcc10"
 is looking in the wrong place? Why is "mpif90-openmpi-gcc10" trying to
 link to OpenCL? Am I doing anything wrong? All my software used to compile
 fine.

 Thank you for reading all of that :)

-- 
Ticket URL: <https://trac.macports.org/ticket/62070>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list