I try to make and get:

Makefile:81: "*** WARNING g++ minor version <7 ***"
mkdir -p obj_linux/codebase/spoa/src/
g++ -static-libgcc -static-libstdc++ -D__cplusplus=201103L -I"./src/" -I"/usr/include/" -Icodebase/argparser/src -Icodebase/seqlib/src -Icodebase/samscripts/src -Icodebase/spoa/src -O3 -fdata-sections ->ffunction-ections -c -fmessage-length=0 -ffreestanding -fopenmp -m64 ->std=c++11 -error=return-type -pthread -march=native -o obj_linux/codebase/spoa/src/alignment.o codebase/spoa/src/alignment.cpp
clang: error: unsupported option '-fopenmp'
make: *** [obj_linux/codebase/spoa/src/alignment.o] Error 1
lahmersk-iml13:racon lahmersk$ whereis g++

I have a home-brew install of 7.3 at /usr/local/Cellar/gcc

I tried to export PATH in .bash_profile with:

# gcc location
export PATH=/usr/local/Cellar/gcc:$PATH

My Cellar directory has:

lahmersk-iml13:Cellar lahmersk$ ls
aragorn     gdbm        libmpc      parallel    sqlite
barrnap     gmp     llvm        prodigal    tbl2asn
blast       hmmer       lmdb        prokka      xz
cmake       infernal    minced      python3
eigen       isl     mpfr        qt
gcc     libffi      openssl     readline

and gcc is:

lahmersk-iml13:Cellar lahmersk$ cd gcc
lahmersk-iml13:gcc lahmersk$ ls

My current bash_profile is:

# Homebrew location
export PATH=/usr/local/bin:/usr/local/sbin:$PATH

# Centrifuge location
export PATH=/Users/lahmersk/centrifuge:$PATH

# Spades location
export PATH=/Users/lahmersk/SPAdes-3.11.1-Darwin/bin:$PATH

# Bowtie2 location
export PATH=/Users/lahmersk/bowtie2-$PATH

# Pilon location
export PATH=/Users/lahmersk/pilon-1.21:$PATH

# Prokka location
export PATH=/Users/lahmersk/prokka/bin:$PATH

# Barrnap location
export PATH=/Users/lahmersk/barrnap/bin:$PATH

# gcc location
export PATH=/usr/local/Cellar/gcc:$PATH

when I do sudo vi /etc/paths I get:


I could use some assistance. What other info can I provide?

  • g++ is taken from /usr/bin, so this is not the homebrew version. Some more details about installed brew packages, PATH definitions etc. might help.
    – nohillside
    Feb 22, 2018 at 15:23
  • 2 questions 1) why do you want g++ clang is as good and easier to work with on the Mac 2) You environment does not matter you will use the g++ path in you makefiles or other build scripts
    – mmmmmm
    Feb 22, 2018 at 17:21

1 Answer 1


You shouldn't need to add the Cellar to your path for this. But Homebrew adds a version suffix to the gcc commands to avoid name clashes with the standard gcc:

pse@Mithos:~$ ssh verence@localhost brew install gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-7.3.0.high_sierra.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/d0/d09669e3679bb54448f00cda4bf520e631f7487f132ebfe6e0d2f6ecdcd5f6e0?__gda__=exp=1519315844~hmac=df4f6f9b82a2ac5fb5465be3f9dc91c0c3eea0c254e894113edf5fcc2b640c57&response-content-disposition=attachment%3Bfilename%3D%22gcc-7.3.0.high_sierra.bottle.1.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX1-mCWpMqQTGrxnTfILcUZz-NvVoQyGOGSnI4iWY_Z2bJghjhAR-xgGu9cDwVXgE9DLumAnLcf1a5kZAz724Fowtbckow4p_nVq39TQR8WNf4jMP4z7Sql3NQ2dFr1pLXQ3paB2FUCf1_A&response-X-Checksum-Sha1=d492b86b3ba112920165af9df80dd793df1d8f46&response-X-Checksum-Sha2=d09669e3679bb54448f00cda4bf520e631f7487f132ebfe6e0d2f6ecdcd5f6e0
==> Pouring gcc-7.3.0.high_sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/gcc/7.3.0: 1,486 files, 284.9MB

pse@Mithos:~$ ll /usr/local/bin/g*-7
lrwxr-xr-x  1 verence  admin  29 Feb 22 16:59 /usr/local/bin/g++-7@ -> ../Cellar/gcc/7.3.0/bin/g++-7
lrwxr-xr-x  1 verence  admin  29 Feb 22 16:59 /usr/local/bin/gcc-7@ -> ../Cellar/gcc/7.3.0/bin/gcc-7
lrwxr-xr-x  1 verence  admin  32 Feb 22 16:59 /usr/local/bin/gcc-ar-7@ -> ../Cellar/gcc/7.3.0/bin/gcc-ar-7
lrwxr-xr-x  1 verence  admin  32 Feb 22 16:59 /usr/local/bin/gcc-nm-7@ -> ../Cellar/gcc/7.3.0/bin/gcc-nm-7
lrwxr-xr-x  1 verence  admin  36 Feb 22 16:59 /usr/local/bin/gcc-ranlib-7@ -> ../Cellar/gcc/7.3.0/bin/gcc-ranlib-7
lrwxr-xr-x  1 verence  admin  30 Feb 22 16:59 /usr/local/bin/gcov-7@ -> ../Cellar/gcc/7.3.0/bin/gcov-7
lrwxr-xr-x  1 verence  admin  35 Feb 22 16:59 /usr/local/bin/gcov-dump-7@ -> ../Cellar/gcc/7.3.0/bin/gcov-dump-7
lrwxr-xr-x  1 verence  admin  35 Feb 22 16:59 /usr/local/bin/gcov-tool-7@ -> ../Cellar/gcc/7.3.0/bin/gcov-tool-7
lrwxr-xr-x  1 verence  admin  34 Feb 22 16:59 /usr/local/bin/gfortran-7@ -> ../Cellar/gcc/7.3.0/bin/gfortran-7

So the compiler you are looking for can be invoked with g++-7.

  • So how do I invoke this compiler? I tried make CXX=/usr/local/Cellar/gcc/g++-7.
    – K Lahmers
    Feb 22, 2018 at 16:28
  • 1
    – nohillside
    Feb 22, 2018 at 16:45
  • I ran this and then tried make resulting in the same fail message. Whereis g++ still points to /usr/bin/g++
    – K Lahmers
    Feb 22, 2018 at 17:08
  • g++ will always be in /usr/bin, the hombrew version in /usr/local/bin is called g++-7. Does the Makefile run g++ or g++-7? Does g++7 support -fopenmp at all? Your Terminal snippet at the top of the question mentions obj_linux, does this even compile on macOS?
    – nohillside
    Feb 22, 2018 at 17:13
  • I went back and found that I had the wrong source file. Thanks for your help.
    – K Lahmers
    Feb 22, 2018 at 23:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .