1

{MacOS 10.14.1 Mojave, Xcode 10.1}

I'm working on building the POPF planner under MacOS and I'm stuck on a system library include problem that I'm not sure how to overcome.

I have exported export CC=/usr/local/bin/gcc-8 and export CXX=/usr/local/bin/g++8 in my terminal, yet when I invoke make VERBOSE=1, the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ compiler is still used rather than /usr/local/bin/gcc-8.
I have symlinked /usr/local/opt/gcc@8/???-8 /usr/local/bin/??? (where the question marks represent gcc, g++, c++, and cpp). I have also set aliases alias gcc='gcc-8', alias cc='gcc-8', alias g++='g++-8', and alias c++='c++-8'.

This is causing the wrong system includes to be used:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/

instead of

/usr/local/Cellar/gcc/8.3.0/include/c++/8.3.0/

The Makefile does not override the setting, and when I execute gcc --version from the commandline, it returns gcc-8 (Homebrew GCC 8.3.0) 8.3.0 and c++ --version returns c++-8 (Homebrew GCC 8.3.0) 8.3.0

Here is the build log:

user@host:[ 0:18]$ make VERBOSE=1
/Applications/CMake.app/Contents/bin/cmake -H/Users/user/Programming/Planning/POPF/popf -B/Users/user/Programming/Planning/POPF/popf/build --check-build-system CMakeFiles/Makefile.cmake 0
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/user/Programming/Planning/POPF/popf/build/CMakeFiles /Users/user/Programming/Planning/POPF/popf/build/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/build.make src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/depend
cd /Users/user/Programming/Planning/POPF/popf/build && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/user/Programming/Planning/POPF/popf /Users/user/Programming/Planning/POPF/popf/src/VALfiles/parsing /Users/user/Programming/Planning/POPF/popf/build /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles/parsing /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/build.make src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/build
make[2]: Nothing to be done for `src/VALfiles/parsing/CMakeFiles/ParsePDDL.dir/build'.
[ 10%] Built target ParsePDDL
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/CMakeFiles/parser.dir/build.make src/VALfiles/CMakeFiles/parser.dir/depend
cd /Users/user/Programming/Planning/POPF/popf/build && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/user/Programming/Planning/POPF/popf /Users/user/Programming/Planning/POPF/popf/src/VALfiles /Users/user/Programming/Planning/POPF/popf/build /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles/CMakeFiles/parser.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/CMakeFiles/parser.dir/build.make src/VALfiles/CMakeFiles/parser.dir/build
make[2]: Nothing to be done for `src/VALfiles/CMakeFiles/parser.dir/build'.
[ 14%] Built target parser
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/CMakeFiles/Inst.dir/build.make src/VALfiles/CMakeFiles/Inst.dir/depend
cd /Users/user/Programming/Planning/POPF/popf/build && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/user/Programming/Planning/POPF/popf /Users/user/Programming/Planning/POPF/popf/src/VALfiles /Users/user/Programming/Planning/POPF/popf/build /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles/CMakeFiles/Inst.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/VALfiles/CMakeFiles/Inst.dir/build.make src/VALfiles/CMakeFiles/Inst.dir/build
[ 16%] Building CXX object src/VALfiles/CMakeFiles/Inst.dir/instantiation.o
cd /Users/user/Programming/Planning/POPF/popf/build/src/VALfiles && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -I/Users/user/Programming/Planning/POPF/popf/src/VALfiles -I/Users/user/Programming/Planning/POPF/popf/build/src/VALfiles -I/Users/user/Programming/Planning/POPF/popf/src/VALfiles/parsing   -o CMakeFiles/Inst.dir/instantiation.o -c /Users/user/Programming/Planning/POPF/popf/src/VALfiles/instantiation.cpp
In file included from /Users/user/Programming/Planning/POPF/popf/src/VALfiles/instantiation.cpp:31:
In file included from /Users/user/Programming/Planning/POPF/popf/src/VALfiles/parsing/ptree.h:55:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:479:17: error: no matching function for call to object of type 'const Inst::ConstSymbolLT'
        {return static_cast<const _Compare&>(*this)(__x, __y.__cc.first);}
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What have I missed? Thanks in advance.

  • CC=absolute path CXX=absolute path – fd0 Feb 25 at 14:03
  • Tried that, but still get the same problem. :( – gone Feb 25 at 14:10
  • Ok, I worked it out. I didn't realise that I needed to run cmake .. again. I figured I would be able to simply change the compiler during the make phase. – gone Feb 25 at 14:39

You must log in to answer this question.

Browse other questions tagged .