failure to compile ET_Mayer using gcc-mp-9 on OSX macports

Create issue
Issue #2290 open
Former user created an issue

Following the instructions on the tutorial https://nbviewer.jupyter.org/github/nds-org/jupyter-et/blob/master/CactusTutorial.ipynb:

  • install MacPorts for your version of the Mac operating system, if you did not already install it (https://www.macports.org/install.php).
  • Next, please install the following packages, using the commands:
sudo port -N install pkgconfig gcc9 openmpi-gcc9 fftw-3 gsl jpeg zlib hdf5 +fortran +gfortran openssl ld64
sudo port select mpi openmpi-gcc9-fortran
sudo port select gcc mp-gcc9

I get failures during sim-build like so:

End of options from '/Users/jenkins/Cactus/configs/sim/OptionList'.
creating cache ./config.cache
checking host system type... i386-apple-darwin18.7.0
checking whether make sets ${MAKE}... yes
checking whether the C compiler (gcc-mp-9 -g -std=gnu99 -rdynamic) works... no
configure: error: installation or configuration problem: C compiler cannot create executables (see configs/sim/config-data/config.log for details).

Error reconfiguring sim-config
make: *** [sim-config] Error 2

and config log reads

configure:1021: checking whether the C compiler (gcc-mp-9 -g -std=gnu99 -rdynamic) works
configure:1038: gcc-mp-9 -o conftest -g -std=gnu99  -rdynamic conftest.c  1>&5
configure:1035:1: warning: return type defaults to 'int' [-Wimplicit-int]
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
configure: failed program was:

#line 1033 "configure"
#include "confdefs.h"

main(){return(0);} int PilotMain(){return(0);}

This may be related to https://trac.macports.org/ticket/58895

Comments (9)

  1. Roland Haas

    The macports ticket suggests adding +ld64_xcode to the options for the ld64 package (however it did not seem to have helped there, installed gcc9 from source did). We used to have ld64_xcode as well (b/c one of Helvi’s students found it helped them) but removed it again in git hash 69ff3a5 "CactusTutorial: update installation instructions for packages" of jupyter-et where it is claimed that it was not required after all given a fully installed Xcode package.

    The system where the error listed above (I am the reporter) happens may have a messy XCode installation (though XCode is present and the command line tools are present as well).

    If +ld64_xcode helps I will add it back to the tutorial instructions since it would seem harmless if present.

  2. Roland Haas

    Running

    bash-3.2$ port diagnose
    Error: currently installed version of Xcode, 11.0, is not supported by MacPorts.  For your currently installed system, only the following versions of Xcode are supported:  10.3 10.2.1 10.2 10.1 10.0
    

    indicates that the issue is that my XCode is too new. Unfortunately if I believe the macports ticket, then downgrading XCode will not solve the issue (though maybe one just has to clean it more thoroughly than was tried in the ticket).

  3. Roland Haas

    This time around compiling gcc9 from source helps. Next will be to find out the order of port install commands to compile only gcc9 (and not everything else) from source. At least until macports fixes the issue in https://trac.macports.org/ticket/58895 .

    Specifically I did:

    sudo port -N install pkgconfig gcc9 openmpi-gcc9 fftw-3 gsl jpeg zlib hdf5 +fortran +gfortran openssl ld64
    sudo port -N uninstall gcc9
    sudo port -sN install gcc9
    

  4. Log in to comment