#59330 closed defect (duplicate)
openmpi-default @4.0.1 +gfortran configure: error: C and C++ compilers are not link compatible. Can not continue.
Reported by: | willic3 (Charles Williams) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.1 |
Keywords: | mojave | Cc: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) |
Port: | openmpi-default |
Description
I am unable to install openmpi-default with the +gfortran variant. It configures and installs fine without this variant. I believe the reason is the following from the openmpi config.log:
configure:26308: WARNING: -finline-functions has been added to CXXFLAGS configure:26319: checking if C and C++ are link compatible configure:26344: /usr/bin/clang -c -O3 -DNDEBUG -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch x86_64 -finline-functions -fno-strict-aliasing -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk conftest_c.c configure:26351: $? = 0 configure:26382: /usr/bin/clang++ -o conftest -DNDEBUG -pipe -stdlib=libstdc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch x86_64 -finline-functions -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk conftest.cpp conftest_c.o -lz >&5 clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated] warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] 1 warning generated. ld: library not found for -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe that the correct flag would be '-stdlib=libc++', but this doesn't happen when using the +gfortran variant. Is there a simple workaround for this problem? I initially discovered this issue because an update triggered a rebuild of openmpi-default. I need the +gfortran variant for other packages (e.g., hdf5 @1.10.5_0+cxx+fortran+gfortran+hl+openmpi+szip). My system info: MacOS 10.14.6
xcodebuild -version Xcode 11.1 Build version 11A1027
port version Version: 2.6.1
Thanks, Charles
Attachments (4)
Change History (8)
Changed 5 years ago by willic3 (Charles Williams)
Attachment: | main.log.gz added |
---|
Changed 5 years ago by willic3 (Charles Williams)
Attachment: | config.log.gz added |
---|
openmpi configure log
comment:2 Changed 5 years ago by jmroot (Joshua Root)
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:3 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Cc: | MarcusCalhoun-Lopez added |
---|
comment:4 Changed 5 years ago by dubiousjim
I think I have a similar issue, but I can open a new ticket if appropriate. I'm trying to install openmpi-clang90
, but I get the same error reported above. Error persisted when I built using configure.cxx_stdlib='libc++'
, and/or built using the +g95
variant (the +gfortran
variant doesn't seem to be available anymore on either openmpi-clang90
nor on openmpi-default
), and/or attempted to install openmpi-clang80
or openmpi-default
instead.
If I cd into the work directory and enter the configure command manually (sudo /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_openmpi/openmpi-clang90/work/openmpi-4.0.1/configure --prefix=/opt/local --enable-mpi-fortran --enable-mpi-cxx FFLAGS='' F77='' --bindir=/opt/local/libexec/openmpi-clang90 --libdir=/opt/local/lib/openmpi-clang90 --sysconfdir=/opt/local/etc/openmpi-clang90 --includedir=/opt/local/include/openmpi-clang90 --datadir=/opt/local/share/openmpi-clang90 --docdir=/opt/local/share/docdelete --mandir=/opt/local/share/mandelete --with-hwloc=/opt/local
) it completes successfully. But then it's using gcc
for gcc
instead of /opt/local/bin/clang-mp-9.0
).
Changed 5 years ago by dubiousjim
log of failed configure for openmpi-clang90
Changed 5 years ago by dubiousjim
log of successful manual configure for openmpi-clang90
Macports log.