Opened 5 years ago

Closed 5 years ago

#59097 closed defect (fixed)

gmp: fails to build with MacPorts 2.6.0 on < 10.9

Reported by: mojca (Mojca Miklavec) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: High Milestone:
Component: ports Version:
Keywords: Cc:
Port: gmp

Description

gmp is trying to use clang++-8.0 as the C++ compiler and system gcc as the C compiler, but it doesn't seem to depend on clang-8.0 for building, and fails to build.

It does build with configure.compiler=cc, but then macports immediately complains that it doesn't link against libc++ and tries to rebuild it.

Change History (5)

comment:1 Changed 5 years ago by mojca (Mojca Miklavec)

Sample log from https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/25

patching file Makefile.in
DEBUG: Executing proc-post-org.macports.patch-patch-0
--->  Patching gmp-h.in: s|"@CC@"|"/opt/local/bin/clang-mp-8.0"|g
DEBUG: Executing reinplace: /usr/bin/sed s|\"@CC@\"|\"/opt/local/bin/clang-mp-8.0\"|g </opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2/gmp-h.in >@file10
DEBUG: euid/egid changed to: 0/0
DEBUG: chowned /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2/gmp-h.in to macports
DEBUG: euid/egid changed to: 502/505
DEBUG: euid/egid changed to: 0/0
DEBUG: setting attributes on /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2/gmp-h.in
DEBUG: euid/egid changed to: 502/505
DEBUG: Privilege de-escalation not attempted as not running as root.
DEBUG: configure phase started at Tue Sep 24 09:54:33 UTC 2019
--->  Configuring gmp
DEBUG: Preferred compilers: gcc-4.2 llvm-gcc-4.2 clang gcc-4.0 macports-clang-8.0 macports-clang-7.0 macports-clang-6.0 macports-clang-5.0 macports-clang-3.7 macports-clang-3.4 macports-gcc-8 macports-gcc-7 macports-gcc-6 macports-gcc-5
DEBUG: Using compiler 'Xcode GCC 4.2'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (gmp)
DEBUG: Environment: 
ABI='64'
CC='/usr/bin/gcc-4.2'
CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/.CC_PRINT_OPTIONS'
CPATH='/opt/local/include'
CPPFLAGS='-I/opt/local/include'
CXX='/opt/local/bin/clang++-mp-8.0 -stdlib=libc++'
DEVELOPER_DIR='/Developer'
F90FLAGS='-Os -m64'
FCFLAGS='-Os -m64'
FFLAGS='-Os -m64'
INSTALL='/usr/bin/install -c'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names'
LIBRARY_PATH='/opt/local/lib'
MACOSX_DEPLOYMENT_TARGET='10.6'
OBJC='/usr/bin/gcc-4.2'
OBJCFLAGS='-Os -arch x86_64'
OBJCXX='/usr/bin/g++-4.2'
OBJCXXFLAGS='-arch x86_64'
Executing:  cd "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx 
DEBUG: system:  cd "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx 
checking build system type... nehalem-apple-darwin10.8.0
checking host system type... nehalem-apple-darwin10.8.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking whether /usr/bin/gcc-4.2 is gcc... yes
checking compiler /usr/bin/gcc-4.2 -O2 -pedantic -fomit-frame-pointer -m64 -I/opt/local/include... yes
checking compiler /usr/bin/gcc-4.2 -O2 -pedantic -fomit-frame-pointer -m64 -I/opt/local/include -mtune=corei7... no
checking compiler /usr/bin/gcc-4.2 -O2 -pedantic -fomit-frame-pointer -m64 -I/opt/local/include -mtune=core2... yes
checking compiler /usr/bin/gcc-4.2 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=core2 -I/opt/local/include -march=corei7... no
checking compiler /usr/bin/gcc-4.2 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=core2 -I/opt/local/include -march=core2... yes
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc-4.2 accepts -g... yes
checking for /usr/bin/gcc-4.2 option to accept ISO C89... none needed
checking whether /usr/bin/gcc-4.2 understands -c and -o together... yes
checking for /usr/bin/gcc-4.2 option to accept ISO C99... -std=gnu99
checking for /usr/bin/gcc-4.2 -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking how to run the C preprocessor... /usr/bin/gcc-4.2 -std=gnu99 -E
checking build system compiler /usr/bin/gcc-4.2 -std=gnu99... yes
checking for build system preprocessor... /usr/bin/gcc-4.2 -std=gnu99 -E
checking for build system executable suffix... 
checking whether build system compiler is ANSI... yes
checking for build system compiler math library... -lm
checking whether we are using the GNU C++ compiler... no
checking whether /opt/local/bin/clang++-mp-8.0 -stdlib=libc++ accepts -g... no
checking C++ compiler /opt/local/bin/clang++-mp-8.0 -stdlib=libc++ -I/opt/local/include -O2 -pedantic -fomit-frame-pointer -m64 -mtune=core2 -march=core2... no
checking C++ compiler /opt/local/bin/clang++-mp-8.0 -stdlib=libc++ -I/opt/local/include ... no
configure: error: C++ compiler not available, see config.log for details
Command failed:  cd "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx 
Exit code: 1
Error: Failed to configure gmp, consult /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/work/gmp-6.1.2/config.log
Error: Failed to configure gmp: configure failure: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_bblocal_var_buildworker_ports_build_ports_devel_gmp/gmp/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gmp failed

comment:2 Changed 5 years ago by kencu (Ken)

I build it myself with configure.compiler=macports-clang-5.0, and have no trouble.

For some reason Marcus went to some trouble to capture "CC" prior to portconfigure.tcl running, and bakes that into the build. So this appears to be done on purpose -- but at this moment I don't know why.

Presumably, we just need to stop doing that, I guess, if the reason is no longer too important, whatever it was.

comment:3 Changed 5 years ago by mojca (Mojca Miklavec)

For me a perfectly fine workaround was to have clang 8.0 installed before installing gmp (but clang 8.0 came from the buildbot).

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

comment:5 Changed 5 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.