-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Strict requirement of GCC-7 on OSX #710
Comments
I seem to have it working with clang as the version that we use on conda-forge is newer than the system clang on most osx systems and supports openmp. I have not done any formal performance testing of the resulting build though. |
@synapticarbors I don't have a mac to check it. can you verify this ? If it can work, you can create a PR here to fix it. |
The native toolchain on macOS doesn't have OpenMP except through the ancient (and likely to be removed) This all being said, users can typically get a compiler from their package manager of choice (e.g. Homebrew, MacPorts, Fink, conda, etc.) that will fix these issues. However that compiler will not likely be In short, it would be nice to relax the version and possibly also the compiler type. Maybe using the |
@jakirkham Well explained, I think we can
|
Any reason not to allow |
Sorry, I've been busy today, so I'll check later 😨 |
@jakirkham 4.8.2 is enough for lightGBM. I'll lower the gcc version |
@synapticarbors as for the |
@henry0312 @wxchan @synapticarbors |
I'm sorry for late response. If you want to use clang, you can just run I don't think a patch such lile the below is needed. diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fcc960..5fd16f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,5 @@
cmake_minimum_required(VERSION 2.8)
-if(APPLE)
- SET(CMAKE_CXX_COMPILER "g++-7")
- SET(CMAKE_C_COMPILER "gcc-7")
-endif()
-
PROJECT(lightgbm)
OPTION(USE_MPI "MPI based parallel learning" OFF) Can conda-forge set |
you can also run |
@henry0312
, |
I'm sorry, I was wrong. we need a patch like the below: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fcc960..5fd16f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,5 @@
cmake_minimum_required(VERSION 2.8)
-if(APPLE)
- SET(CMAKE_CXX_COMPILER "g++-7")
- SET(CMAKE_C_COMPILER "gcc-7")
-endif()
-
PROJECT(lightgbm)
OPTION(USE_MPI "MPI based parallel learning" OFF) After applied the patch, we can run Actually, the CMakeLists.txt hadn't have either I think it's good to remove them from CMakeLists.txt. |
@henry0312 |
@guolinke |
On MacOS High Sierra with MacPorts installed, I did the following:
|
I've recently been working on packaging LightGBM-python for conda via conda-forge and ran into some issues since the CMake file strictly requires gcc-7 on OSX. Since gcc-7 was not available on the conda-forge build infrastructure, I patched the
CMakeLists.txt
to remove the restriction and then used Clang 4.0.0. I was able to build LightGBM without any issues and I could run a simple set of tests.I'm wondering if there any issues in approaching the compilation in this way? If not and clang is a valid compiler choice, then it would seem desirable to have a more flexible way of choosing the compiler rather than forcing gcc-7.
Any feedback would be appreciated. The pull request for the conda recipe can be found here if anyone is interested in looking at it.
conda-forge/staged-recipes#3257
Also if any member of the LightGBM team is interested in being a co-maintainer of the recipe (i.e. having Github permission to modify the
feedstock
in order to update versions. See https://conda-forge.org/docs/recipe.html#maintainer-role), please let me know. I'm happy to maintain the recipe on my own and keep it up-to-date.The text was updated successfully, but these errors were encountered: