Kahip: Running on Mac OSX

Created on 26 Feb 2017  ·  7Comments  ·  Source: KaHIP/KaHIP

Hi, I am trying to get KaHIP running on Mac OSX, but am getting build errors. Does anyone have any suggestions?

I have done the following:

brew install scons
brew install argtable
brew install open-mpi
[check out KaHIP using GitHub desktop]
./compile.sh

I get the error:
clang: error: unknown argument: '-fno-stack-limit'
and
error: unsupported option '-fopenmp'

I have tried using alias g++='gcc-6' but this doesn't make any difference.

If I call g++ -v I get:

Using built-in specs.
COLLECT_GCC=gcc-6
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/6.3.0_1/libexec/gcc/x86_64-apple-darwin15.6.0/6.3.0/lto-wrapper
Target: x86_64-apple-darwin15.6.0
Configured with: ../configure --build=x86_64-apple-darwin15.6.0 --prefix=/usr/local/Cellar/gcc/6.3.0_1 --libdir=/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-6 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew GCC 6.3.0_1' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 6.3.0 (Homebrew GCC 6.3.0_1) 

Any suggestions much appreciated!
Thanks

Most helpful comment

Thanks Christian.

For anyone else with this issue, I made some progress by doing the following:

brew reinstall gcc --without-multilib (NB: this took almost 2 hours)

(This installed latest version of gcc, which in my case is gcc-6)

add the following to Sconstruct file in the if SYSTEM == 'Darwin': block (around line 93):

        env['CC'] = 'gcc-6'
        env['CXX'] = 'g++-6'

All 7 comments

Your output tells you that you use clang. I actually never tried to compile the code with clang. So the easiest for you would be to make sure that gcc is used. If you still want to try clang, you can remove the -fno-stack-limit option and find out how clang supports openmp.

Best,
Christian

Thanks Christian.

For anyone else with this issue, I made some progress by doing the following:

brew reinstall gcc --without-multilib (NB: this took almost 2 hours)

(This installed latest version of gcc, which in my case is gcc-6)

add the following to Sconstruct file in the if SYSTEM == 'Darwin': block (around line 93):

        env['CC'] = 'gcc-6'
        env['CXX'] = 'g++-6'

Thanks Peter!

Hi,

First of all, thank you for the detailed explanations. Some progress has been made with the installation thanks to them.

However, the installation continues to fail in the end. I have little experience with C++, so I apologise in advance for any obvious errors on my par.

It looks as if the installation is still trying to use clang at some point (having seemingly used g++ up until then) even though the environment variables have been altered in the Sconstruct file in the main directory.

@peterwake I cloned the mac installation branch of your repository on my MacBook but it also runs into the same error.

My best guess based on my console output is that mpicxx (see #6 ) seems to be invoking clang for some reason, even though mpicxx --showme returns g++ -I/usr/local/include -L/usr/local/lib -lmpi.

Here is my console output:

[…]
scons: done building targets.
scons: Reading SConscript files ...
Checking for C++ header file mpi.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: optimized
mpicxx -o optimized/app/kaffpaE.o -c -fopenmp -DNDEBUG -Wall -funroll-loops -fno-stack-limit -O3 -std=c++0x -DMODE_KAFFPAE -O3 -DNDEBUG -funroll-loops -std=c++0x -DMODE_KAFFPAE -DPOINTER64=1 -Iextern/argtable-2.10/include -Ioptimized/extern/argtable-2.10/include -Iextern/argtable-2.10/include -Ioptimized/lib -Ilib -Ioptimized/lib/tools -Ilib/tools -Ioptimized/lib/partition -Ilib/partition -Ioptimized/lib/io -Ilib/io -Ioptimized/lib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib -Ilib/tools -Ilib/partition -Ilib/io -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -I/usr/include/openmpi -I/opt/local/include -Iinclude app/kaffpaE.cpp
mpicxx -o optimized/lib/data_structure/graph_hierarchy.o -c -fopenmp -DNDEBUG -Wall -funroll-loops -fno-stack-limit -O3 -std=c++0x -DMODE_KAFFPAE -O3 -DNDEBUG -funroll-loops -std=c++0x -DMODE_KAFFPAE -DPOINTER64=1 -Iextern/argtable-2.10/include -Ioptimized/extern/argtable-2.10/include -Iextern/argtable-2.10/include -Ioptimized/lib -Ilib -Ioptimized/lib/tools -Ilib/tools -Ioptimized/lib/partition -Ilib/partition -Ioptimized/lib/io -Ilib/io -Ioptimized/lib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib -Ilib/tools -Ilib/partition -Ilib/io -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -I/usr/include/openmpi -I/opt/local/include -Iinclude lib/data_structure/graph_hierarchy.cpp
mpicxx -o optimized/lib/algorithms/strongly_connected_components.o -c -fopenmp -DNDEBUG -Wall -funroll-loops -fno-stack-limit -O3 -std=c++0x -DMODE_KAFFPAE -O3 -DNDEBUG -funroll-loops -std=c++0x -DMODE_KAFFPAE -DPOINTER64=1 -Iextern/argtable-2.10/include -Ioptimized/extern/argtable-2.10/include -Iextern/argtable-2.10/include -Ioptimized/lib -Ilib -Ioptimized/lib/tools -Ilib/tools -Ioptimized/lib/partition -Ilib/partition -Ioptimized/lib/io -Ilib/io -Ioptimized/lib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib -Ilib/tools -Ilib/partition -Ilib/io -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -I/usr/include/openmpi -I/opt/local/include -Iinclude lib/algorithms/strongly_connected_components.cpp
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
mpicxx -o optimized/lib/algorithms/topological_sort.o -c -fopenmp -DNDEBUG -Wall -funroll-loops -fno-stack-limit -O3 -std=c++0x -DMODE_KAFFPAE -O3 -DNDEBUG -funroll-loops -std=c++0x -DMODE_KAFFPAE -DPOINTER64=1 -Iextern/argtable-2.10/include -Ioptimized/extern/argtable-2.10/include -Iextern/argtable-2.10/include -Ioptimized/lib -Ilib -Ioptimized/lib/tools -Ilib/tools -Ioptimized/lib/partition -Ilib/partition -Ioptimized/lib/io -Ilib/io -Ioptimized/lib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -Ilib -Ilib/tools -Ilib/partition -Ilib/io -Ilib/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement -I/usr/include/openmpi -I/opt/local/include -Iinclude lib/algorithms/topological_sort.cpp
scons: *** [optimized/lib/data_structure/graph_hierarchy.o] Error 1
scons: *** [optimized/app/kaffpaE.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unsupported option '-fopenmp'
scons: *** [optimized/lib/algorithms/strongly_connected_components.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unsupported option '-fopenmp'
scons: *** [optimized/lib/algorithms/topological_sort.o] Error 1
scons: building terminated because of errors.
compile error in kaffpaE. exiting.

Any suggestions as to what the problem is and/or how it might be fixed would be greatly appreciated.

Regards,
Yani

I added clang support now. The only thing left for you todo is to make sure that your clang installation supports openmp.

@YaniKolev I did get it to work in the end, the problem is looking at my bash history I tried so many things it's difficult to pinpoint what worked. To keep your spirits up, the best news is.. I actually managed to _use_ kaffpae a few days ago to do something! Looking at bash, if you're persuing the gcc option you might try:

mpicxx -v

(does it say clang anywhere)

export OMPI_CC=gcc-6
export OMPI_CXX=g++-6
mpicxx -v

(does it now NOT say clang anywhere, and mention g++ stuff - in which case try recompiling)

@peterwake @schulzchristian

many thanks for the advice. An OS update coupled with a Peter's advice has seemingly got it to install properly.

However, I wasn't able to make it work with clang (even though my clang 4.0.0 does support openmp).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wkirkpa1 picture wkirkpa1  ·  3Comments

Nothin99 picture Nothin99  ·  3Comments

cniaulin picture cniaulin  ·  3Comments

Xaroth picture Xaroth  ·  3Comments

lightonflux picture lightonflux  ·  3Comments