ElmerCSC / homebrew-elmerfem

Homebrew formula for installing Elmer on Macs
6 stars 15 forks source link

[SOLVED] CMake Error: CMAKE_C_COMPILER not set #7

Closed pmlefeuvre closed 7 years ago

pmlefeuvre commented 7 years ago

Hi,

I got a compiler error during a re-installation of elmer using homebrew on my OSX 10.12.4. This error is the same than in issue#5 (see below). It could not find my current gcc version (gcc-7) and by default assigned gcc-8 which caused a version conflict with my gfortran-7.

The editing of the compilers in elmer.rb (l. 47-48) did the job as advised in issue#5 . Is it possible to edit the way it finds gcc compilers in future versions?

Edited lines in /usr/local/Homebrew/Library/Taps/elmercsc/homebrew-elmerfem/elmer.rb ENV["CC"] = "/usr/local/Cellar/gcc/7.1.0/bin/gcc-7" #edited ENV["CXX"] = "/usr/local/Cellar/gcc/7.1.0/bin/g++-7" #edited # ENV["CC"] = "#{Formula["gcc"].opt_bin}/gcc-#{Formula["gcc"].version_suffix}" # ENV["CXX"] = "#{Formula["gcc"].opt_bin}/g++-#{Formula["gcc"].version_suffix}"

Error Message after: brew reinstall -verbose elmer --HEAD --with-elmerice

==> cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/elmer/HEAD-97ccc34 -DWITH_Hypre:BOOL=TRUE -DWITH_ElmerIce:BOOL=TRUE -DWITH_Mumps:BOOL=TRUE -DWITH_MPI:BOOL=TRUE -DBLAS_LIBRARIES:STRING=/usr/local/opt/openblas/lib/libopenblas.dylib;-lpthread -DLAPACK_LIBRARIES:STRING=/usr/local/opt/openblas/lib/libopenblas.dylib;-lpthread -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/elmer/HEAD-97ccc34 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev
-- The Fortran compiler identification is GNU 7.1.0
CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/CMakeDetermineCCompiler.cmake:48 (message):
  Could not find compiler set in environment variable CC:

  /usr/local/opt/gcc/bin/gcc-8.
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!

==> Formula
Tap: elmercsc/elmerfem
Path: /usr/local/Homebrew/Library/Taps/elmercsc/homebrew-elmerfem/elmer.rb
==> Configuration
HOMEBREW_VERSION: 1.2.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8cba0352e0be94263e2ed96c98bf93d8f2fce8ef
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9c4f788f512c3fdb9f83dace59b2194a778c13bd
Core tap last commit: 14 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit skylake
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.11.0 => /Library/Developer/CommandLineTools/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_112
macOS: 10.12.4-x86_64
Xcode: N/A
CLT: 8.3.2.0.1.1492020469
X11: 2.7.11 => /opt/X11
==> ENV
CC: /usr/local/opt/gcc/bin/gcc-8
CXX: /usr/local/opt/gcc/bin/g++-8
OBJC: clang
OBJCXX: clang++
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local/opt/openblas:/usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/scalapack/lib/pkgconfig:/usr/local/opt/open-mpi/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.12
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/super:/usr/local/opt/cmake/bin:/usr/local/opt/gcc/bin:/usr/local/opt/open-mpi/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/gcc/7.1.0/bin

The rest of the compilation went smoothly. Thanks for the otherwise easy homebrew installation of elmerice.

PiM

ZipirMario commented 6 years ago

Hello, I can not find to lines in my elmer.rb elmer.rb is class Elmer < Formula desc """ Elmer finite element solver

How can i fix this CMake Error: CMAKE_C_COMPILER not set