1
votes

I am runnng Mac OS 10.12 with Xcode 8.0.

I tried to install the FEM-package elmer from ElmerCSC/homebrew-elmerfem.

$ brew install elmer --with-elmergui --HEAD --with-elmerice --verbose

But building failed with: ... CMake Error at /usr/local/Cellar/cmake/3.6.2/share/cmake/Modules/CMakeDetermineCCompiler.cmake:57 (message): Could not find compiler set in environment variable CC: /usr/local/opt/gcc/bin/gcc-7. Call Stack (most recent call first): CMakeLists.txt:17 (PROJECT) ... CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! ... CPU: quad-core 64-bit arrandale Homebrew Ruby: 2.0.0-p648 Clang: 8.0 build 800 Git: 2.8.4 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Perl: /usr/bin/perl Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/pytho$ Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby Java: 1.8.0_101 macOS: 10.12-x86_64 Xcode: 8.0 CLT: N/A X11: 2.7.9 => /opt/X11 ==> ENV CC: /usr/local/opt/gcc/bin/gcc-7 CXX: /usr/local/opt/gcc/bin/g++-7 OBJC: clang OBJCXX: clang++ HOMEBREW_CC: clang HOMEBREW_CXX: clang++ SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk MAKEFLAGS: -j4 ...

Here is the link to the full log file

One strange thing to me is that the script looks for gcc-7 and g++-7 which don't exist. But I have version gcc-6 and g++-6 installed in the very same place. I checked .bashrc and .bash_profile but couldn't find an entry setting CC or GCC to version 7.

$ gcc --version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.38) Target: x86_64-apple-darwin16.0.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ gcc-6 --version

gcc-6 (Homebrew gcc 6.2.0) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I set CC and CXX in my .bash_profile:

$ echo $CC

/usr/local/bin/gcc-6

$ echo $CXX

/usr/local/bin/g++-6

This seems not to have any effect.

gcc is pointing to the Xcode version 4.2.1

$ which gcc

/usr/bin/gcc

Here is my PATH variable. $ echo $PATH

/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin

Is this a formula or a cmake problem? How can I find out?

What could I do to get formula elmer installed?

I appreciate your help! Best regards.

2

2 Answers

0
votes

To solve the wrong gcc version problem I created two symlinks.

$ ln -s /usr/local/opt/gcc/bin/gcc-6 /usr/local/opt/gcc/bin/gcc-7

$ ln-s /usr/local/opt/gcc/bin/g++-6 /usr/local/opt/gcc/bin/g++-7

I did

$ brew install elmer --HEAD --verbose

Now I get another error. stdlib.h is not found and compilation terminated. Link to log file

0
votes

As discussed here and here there are at the moment two methods for installing Elmer on macOS using HomeBrew:

method 1:

  1. brew tap dpo/openblas
  2. brew install mumps
  3. brew tap elmercsc/homebrew-elmerfem
  4. brew edit elmer
  5. comment the depends_on "scalapack" line out
  6. brew install elmer --HEAD --with-elmergui

method 2:

  1. brew tap brewsci/science
  2. brew install mumps
  3. if that didn't work, download mumps.rb from here
  4. brew install ./mumps.rb
  5. brew tap elmercsc/homebrew-elmerfem
  6. brew install elmer --HEAD --with-elmergui

I hope it helps.