Homebrew can39t install formula due to CC looking for not existing gcc version

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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 ...

https://www.dropbox.com/s/40rl7gwxnjz3zgj/elmer_log_003.txt?dl=0 https://www.dropbox.com/s/40rl7gwxnjz3zgj/elmer_log_003.txt?dl=0

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.

Answers

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. https://www.dropbox.com/s/uhjku9c7fx41x7p/elmer_log_161028.txt?dl=0 https://www.dropbox.com/s/uhjku9c7fx41x7p/elmer_log_161028.txt?dl=0

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/40203141/homebrew-cant-install-formula-due-to-cc-looking-for-not-existing-gcc-version

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils