Skip to content

Make error during MacOS Install Due to Forced gcc-15 Compile #28

Description

@HughLohan

TL;DR find_gcc.sh forces gcc-15 in some cases, and results in failed one-touch install.

Ran into the below error when trying local one-touch install on MacOS (M4, Sequoia 15.7.3) when both gcc-14 and gcc-15 are available via brew;

make: `grfont.dat' is up to date.
gcc -DPG_PPU -O2 -I. -I/usr/X11R6/include -o pgxwin_server ../src/pgplot/drivers/pgxwin_server.c -L/usr/X11R6/lib -lX11 -L -lgcc -lm -lc
ld: warning: search path '-lgcc' not found
cp -r pgplot /Users/username
-- The C compiler identification is GNU 15.2.0
-- The CXX compiler identification is GNU 15.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/homebrew/Cellar/gcc/15.2.0_1/bin/gcc-15
-- Check for working C compiler: /opt/homebrew/Cellar/gcc/15.2.0_1/bin/gcc-15 - broken
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/opt/homebrew/Cellar/gcc/15.2.0_1/bin/gcc-15"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/username/DIFFUSE_INSTALL/develop/DiffuseBuild/CMakeFiles/CMakeScratch/TryCompile-pBRNmk'
    
    Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_9d243/fast
    /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_9d243.dir/build.make CMakeFiles/cmTC_9d243.dir/build
    CMakeFiles/cmTC_9d243.dir/build.make:82: *** missing separator.  Stop.
    make: *** [cmTC_9d243/fast] Error 2
    
    



  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!
CMake Warning:
  Value of CMAKE_CXX_COMPILER_ARG1 contained a newline; truncating


CMake Warning:
  Value of CMAKE_C_COMPILER_ARG1 contained a newline; truncating

I tried steps outlined in this issue, but they did not help. Issue seems to be that compilation fails with gcc-15, but user exports (e.g. export CC="gcc-14") are ignored due to overwrite by ./DIFFUSE_INSTALL/find_gcc.sh. Manually providing gcc-14 path instead of relying on find statement (which defaults to gcc-15) allows compilation to proceed without error;

find_gcc.sh

#!/bin/bash
#
set +e 
DISCUS_GCC="/opt/homebrew/Cellar/gcc@14/14.3.0/bin/gcc-14"
#$(find /usr/local -name 'gcc-??' | fgrep Cellar | fgrep bin)
# echo $DISCUS_GCC
if [[ -z ${DISCUS_GCC} ]]; then
  DISCUS_GCC="/opt/homebrew/Cellar/gcc@14/14.3.0/bin/gcc-14"
#$(find /opt -name 'gcc-??' | fgrep Cellar | fgrep bin)
fi
DISCUS_GXX=${DISCUS_GCC/gcc-/g++-}
# echo $DISCUS_GCC
# echo $DISCUS_GXX
set -e 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions