Setting the preferred C++ compiler on OS X
How do I convince DOLFIN's build system to not use clang (/usr/bin/cc) on OS X?
I've tried:
- Making symlinks from gcc, g++, gfortran to my preferred compilers and having them appear first in my path.
- Setting CC, CXX, FC environment variables to my preferred compilers. (Also OMPI_CC etc. for good measure.)
before invoking cmake.
Comments (9)
-
-
reporter Do I need to do more than deleting dorsal_build_dir when clearing cmake cache? Because I've tried to delete this folder, set CC, CXX, and FC and attempt to build DOLFIN without success so far, but will retry.
-
reporter Thanks.
It works when I retried it after deleting dorsal_build_dir. Furthermore, CC, CXX etc. needed to be set to the full-path of the compilers. (Simply referring to my alias did not seem to work.)
-
reporter - changed status to resolved
(See last comment.)
-
Fix issue
#1on multimesh branch [skip ci]→ <<cset 893869ec51c4>>
-
@benjamik Change is not related to this issue.
-
Hmm, very strange. Bitbucket is messing this up. This is not my commit (click on the link, it belongs to @magneano ). I suspect he was supposed to reference an issue in the logg/dolfin repo where much of the multimesh development takes place.
-
Fix issue
#1on multimesh branch [skip ci]→ <<cset 893869ec51c4>>
-
I found out why this happened. It was changeset
893869ec51c4217c7fa086483cab61919bbeecba
by Magne from Feb 2 2017 with the following commit message:Fix issue #1 on multimesh branch [skip ci]
. This referred to issue#1in another repository. We have long since changed to referring to issues in the main repository. - Log in to comment
Setting CC, CXX and FC environment variables should work, but only if it's the first time you run cmake. That is, you should make sure to delete the cmake cache for these environment variables to have any effect.
You can also force a specific compiler by running cmake with the option -DCMAKE_{CC,CXX,Fortran}_COMPILER:FILEPATH=/path/to/compiler.