Setting the preferred C++ compiler on OS X

Issue #1 resolved
Harish Narayanan created an issue

How do I convince DOLFIN's build system to not use clang (/usr/bin/cc) on OS X?

I've tried:

  1. Making symlinks from gcc, g++, gfortran to my preferred compilers and having them appear first in my path.
  2. Setting CC, CXX, FC environment variables to my preferred compilers. (Also OMPI_CC etc. for good measure.)

before invoking cmake.

Comments (9)

  1. Johannes Ring

    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.

  2. Harish Narayanan 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.

  3. Harish Narayanan 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.)

  4. Benjamin Dam Kehlet

    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.

  5. Anders Logg (Chalmers)

    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 #1 in another repository. We have long since changed to referring to issues in the main repository.

  6. Log in to comment