Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LightGBM doesn't get installed in OSX #118

Closed
n1tk opened this issue Dec 9, 2016 · 29 comments
Closed

LightGBM doesn't get installed in OSX #118

n1tk opened this issue Dec 9, 2016 · 29 comments

Comments

@n1tk
Copy link

n1tk commented Dec 9, 2016

Tried to install according to instructions but fails, can anybody help me find what is wrong ?

➜ build git:(master) make -j
[ 4%] Building CXX object src/CMakeFiles/lightgbm.dir/objective/objective_function.cpp.o
In file included from /Users/sbuciuma/LightGBM/src/objective/objective_function.cpp:3:0:
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:50:37: error: stray '\357' in program
if(cnt_positive > cnt_negative???{
^
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:50:38: error: stray '\274' in program
if(cnt_positive > cnt_negative???{
^
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:50:39: error: stray '\211' in program
if(cnt_positive > cnt_negative??{
^
In file included from /Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp:5:0,
from /Users/sbuciuma/LightGBM/src/objective/objective_function.cpp:4:
/Users/sbuciuma/LightGBM/include/LightGBM/metric.h:10:1: error: expected unqualified-id before 'namespace'
namespace LightGBM {
^~~~~~~~~
In file included from /Users/sbuciuma/LightGBM/src/objective/objective_function.cpp:4:0:
/Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp:70:46: error: expected '}' before end of line
#pragma omp parallel for schedule(guided)
^
In file included from /Users/sbuciuma/LightGBM/src/objective/objective_function.cpp:3:0:
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp: In constructor 'LightGBM::BinaryLogloss::BinaryLogloss(const LightGBM::ObjectiveConfig&)':
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:16:5: error: 'is_unbalance_' was not declared in this scope
is_unbalance_ = config.is_unbalance;
^~~~~~~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:17:5: error: 'sigmoid_' was not declared in this scope
sigmoid_ = static_cast<score_t>(config.sigmoid);
^~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp: In member function 'virtual void LightGBM::BinaryLogloss::Init(const LightGBM::Metadata&, LightGBM::data_size_t)':
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:24:5: error: 'num_data_' was not declared in this scope
num_data_ = num_data;
^~~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:25:5: error: 'label' was not declared in this scope
label_ = metadata.label();
^~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:26:5: error: 'weights_' was not declared in this scope
weights_ = metadata.weights();
^~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:43:5: error: 'label_val_' was not declared in this scope
label_val_[0] = -1;
^~~~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:46:5: error: 'label_weights_' was not declared in this scope
label_weights_[0] = 1.0f;
^~~~~~~~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:49:9: error: 'is_unbalance_' was not declared in this scope
if (is_unbalance_) {
^~~~~~~~~~~~~
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:50:40: error: expected ')' before '{' token
if(cnt_positive > cnt_negative){
^
/Users/sbuciuma/LightGBM/src/objective/binary_objective.hpp:57:5: error: expected primary-expression before '}' token
}
^
In file included from /Users/sbuciuma/LightGBM/src/objective/objective_function.cpp:4:0:
/Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp: At global scope:
/Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp:70:46: error: expected unqualified-id before end of line
#pragma omp parallel for schedule(guided)
^
/Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp:70:46: error: expected '}' before end of line
/Users/sbuciuma/LightGBM/src/objective/rank_objective.hpp:70:46: error: expected declaration before end of line
make[2]: *** [src/CMakeFiles/lightgbm.dir/objective/objective_function.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/lightgbm.dir/all] Error 2
make: *** [all] Error 2
➜ build git:(master)

@guolinke
Copy link
Collaborator

guolinke commented Dec 9, 2016

it seems your source file contains some strange character. I am not sure why this happen.
Can you delete the folder completely, and clone again, then build?
BTW, is there any error message when using cmake?

@n1tk
Copy link
Author

n1tk commented Dec 9, 2016

removed completely folder and here is the output from cmake

`➜ build git:(master) cmake -DCMAKE_CXX_COMPILER=g++-6 ..
/usr/local/Cellar/open-mpi/2.0.1/lib/libmpi.dylib
/usr/local/Cellar/open-mpi/2.0.1/lib/libmpi.dylib
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
CMake Error at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find OpenMP (missing: OpenMP_C_FLAGS)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindOpenMP.cmake:316 (find_package_handle_standard_args)
CMakeLists.txt:16 (find_package)

-- Configuring incomplete, errors occurred!
See also "/Users/sbuciuma/LightGBM/build/CMakeFiles/CMakeOutput.log".
See also "/Users/sbuciuma/LightGBM/build/CMakeFiles/CMakeError.log".
➜ build git:(master) `

@guolinke
Copy link
Collaborator

guolinke commented Dec 9, 2016

I see, it is openmp problem in OXS. @wxchan , Did you find the solution?

@henry0312
Copy link
Contributor

Are you sure you installed GCC with OpenMP via Homebrew?

@n1tk
Copy link
Author

n1tk commented Dec 9, 2016

yes, reinstalling now for the 4th time ....

@henry0312
Copy link
Contributor

Please paste g++-6 -v

» g++-6 -v
Using built-in specs.
COLLECT_GCC=g++-6
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/6.2.0/libexec/gcc/x86_64-apple-darwin15.6.0/6.2.0/lto-wrapper
Target: x86_64-apple-darwin15.6.0
Configured with: ../configure --build=x86_64-apple-darwin15.6.0 --prefix=/usr/local/Cellar/gcc/6.2.0 --libdir=/usr/local/Cellar/gcc/6.2.0/lib/gcc/6 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-6 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew gcc 6.2.0 --without-multilib' --with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin --disable-nls --disable-multilib
Thread model: posix
gcc version 6.2.0 (Homebrew gcc 6.2.0 --without-multilib)

@henry0312
Copy link
Contributor

Oh, wait.
the current CMakeLists.txt is broken for OSX.
I'll fix.

@n1tk
Copy link
Author

n1tk commented Dec 9, 2016

Thank you.

@henry0312
Copy link
Contributor

Probably, cmake -DCMAKE_CXX_COMPILER=g++-6 -DOpenMP_C_FLAGS=-fopemmp .. allows you to install lightgm.
However, I can't know why find_package(OpenMP REQUIRED) doesn't work in OSX.
https://github.com/Microsoft/LightGBM/blob/master/CMakeLists.txt#L16

@wxchan
Copy link
Contributor

wxchan commented Dec 9, 2016

@guolinke no, still not works.

@sergiubuciumas can you try to change find_package(OpenMP REQUIRED) to find_package(OpenMP) (remove REQUIRED) in CMakeLists.txt and see if it works?

@henry0312
Copy link
Contributor

henry0312 commented Dec 9, 2016

cmake -DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_C_COMPILER=gcc-6 .. works fine.
We need to set CMAKE_C_COMPILER because CMake uses AppleClang as C compiler if we don't specify it.

Please update wiki, https://github.com/Microsoft/LightGBM/wiki/Installation-Guide

@n1tk
Copy link
Author

n1tk commented Dec 9, 2016

@wxchan

find_package(OpenMP) method fixed

[ 97%] Linking CXX executable ../lightgbm
[100%] Linking CXX shared library ../lib_lightgbm.so
[100%] Built target lightgbm
[100%] Built target _lightgbm

@n1tk n1tk closed this as completed Dec 9, 2016
@henry0312
Copy link
Contributor

It's strange.

Set only CMAKE_CXX_COMPILER:

» cmake -DCMAKE_CXX_COMPILER=g++-6 ..
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-6
-- Check for working CXX compiler: /usr/local/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Could NOT find OpenMP (missing:  OpenMP_C_FLAGS)
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   _lightgbm

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/tsukasa_omoto/.ghq/github.com/henry0312/LightGBM/build

Set both CMAKE_CXX_COMPILER and CMAKE_C_COMPILER:

» cmake -DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_C_COMPILER=gcc-6 ..
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/local/bin/gcc-6
-- Check for working C compiler: /usr/local/bin/gcc-6 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-6
-- Check for working CXX compiler: /usr/local/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   _lightgbm

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/tsukasa_omoto/.ghq/github.com/henry0312/LightGBM/build

@guolinke
Copy link
Collaborator

guolinke commented Dec 9, 2016

@sergiubuciumas This fix will give you a slow version of LightGBM..
It will not run multi-threading..

@guolinke guolinke reopened this Dec 9, 2016
@wxchan
Copy link
Contributor

wxchan commented Dec 9, 2016

The solution provided by @henry0312 works for me. I think it's a better solution.

@guolinke
Copy link
Collaborator

guolinke commented Dec 9, 2016

@henry0312 , Thanks!

Update the install guide : https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#osx

@henry0312
Copy link
Contributor

not at all :)

@sshleifer
Copy link

sshleifer commented May 7, 2017

Having similar problems:

> cmake ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (PROJECT):
  The CMAKE_C_COMPILER:

    gcc-7

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:8 (PROJECT):
  The CMAKE_CXX_COMPILER:

    g++-7
 is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/Users/shleifer/LightGBM/build/CMakeFiles/CMakeOutput.log".
See also "/Users/shleifer/LightGBM/build/CMakeFiles/CMakeError.log".

Same error message when run cmake -DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_C_COMPILER=gcc-6 ..

(kml) ➜  build git:(master) gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

(kml) ➜  build git:(master) cmake --version
cmake version 3.5.1

@guolinke
Copy link
Collaborator

guolinke commented May 8, 2017

@sshleifer
it seems you didn't have gcc compiler.
did you follow https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#osx ?

@sshleifer
Copy link

yes,

➜  LightGBM git:(master) brew install cmake
Warning: cmake-3.5.1 already installed
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
 ➜  LightGBM git:(master) brew install gcc --without-multilib

Warning: gcc-5.3.0 already installed
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

@henry0312
Copy link
Contributor

henry0312 commented May 11, 2017

No, you need gcc 7.1.

Run the below:

$ brew update && brew upgrade gcc --without-multilib
(take a long time...)
$ g++-7 -v

@Miracleday23Kevin
Copy link

Hi I met a strange problem when I tried to do the 'cmake ..' step in mac os installation, please see below.
Ma-MacBook-Pro:~ miracleday23$ brew update && brew upgrade gcc --without-multilib
Already up-to-date.
Error: gcc 7.2.0 already installed

Ma-MacBook-Pro:LightGBM miracleday23$ export CXX=g++-7 CC=gcc-7
Ma-MacBook-Pro:LightGBM miracleday23$ cd build
Ma-MacBook-Pro:build miracleday23$ cmake ..
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:24 (message):
AppleClang wasn't supported. Please see
https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos

-- Configuring incomplete, errors occurred!
See also "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/LightGBM/build/CMakeFiles/CMakeOutput.log".
Ma-MacBook-Pro:build miracleday23$ ls
CMakeCache.txt CMakeFiles
Ma-MacBook-Pro:build miracleday23$ vi CMakeFiles/

Please help with this, thanks so much!

@aroraakshit
Copy link

@Miracleday23Kevin Try:
cmake -DCMAKE_CXX_COMPILER=g++-iiii -DCMAKE_C_COMPILER=gcc-iiii ..

Change iiii to 6 or 7 depending on the version of gcc installed on your mac.

@Pharce
Copy link

Pharce commented Jun 12, 2018

I am currently recieving this message.
CMake Error at CMakeLists.txt:27 (message):
AppleClang isn't supported. Please see
https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos

@guolinke
Copy link
Collaborator

@Pharce Did try @aroraakshit `s solution ?

@gct001
Copy link

gct001 commented Jun 14, 2018

@Pharce You can check the version of your gcc, it's 8.1.0 now. Then export CXX=g++-8 CC=gcc-8.

@Pharce
Copy link

Pharce commented Jun 14, 2018

Thanks! I got it.

@whizzalan
Copy link

update gcc to 8 and
cmake 3.9.4_1 -> 3.12.0
it works.

@AdityaJuvali
Copy link

update gcc to 8 and
cmake 3.9.4_1 -> 3.12.0
it works.

I have the same versions of gcc 8.2 and cmake 3.13 on my Mac OSX. But I am still getting an error while installing lightgbm.

gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Issue:
I followed the installation guide and on 'cmake ..' step got following error:
############

-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /anaconda3/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /anaconda3/bin/x86_64-apple-darwin13.4.0-clang -- broken
CMake Error at /anaconda3/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"
is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/adityajuvali/LightGBM/build/CMakeFiles/CMakeTmp

Run Build Command:"/anaconda3/bin/make" "cmTC_4d700/fast"
/anaconda3/bin/make -f CMakeFiles/cmTC_4d700.dir/build.make CMakeFiles/cmTC_4d700.dir/build
make[1]: Entering directory '/Users/adityajuvali/LightGBM/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_4d700.dir/testCCompiler.c.o
/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -o CMakeFiles/cmTC_4d700.dir/testCCompiler.c.o -c /Users/adityajuvali/LightGBM/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_4d700
/anaconda3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4d700.dir/link.txt --verbose=1
/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs CMakeFiles/cmTC_4d700.dir/testCCompiler.c.o -o cmTC_4d700
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [CMakeFiles/cmTC_4d700.dir/build.make:87: cmTC_4d700] Error 1
make[1]: Leaving directory '/Users/adityajuvali/LightGBM/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_4d700/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (PROJECT)

-- Configuring incomplete, errors occurred!

#######

Please help. I am not able install even other models due to this same error.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests