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

AppleClang not supported -- Setup on Mac. #12

Open
nalin-mathur opened this issue Sep 4, 2019 · 3 comments
Open

AppleClang not supported -- Setup on Mac. #12

nalin-mathur opened this issue Sep 4, 2019 · 3 comments

Comments

@nalin-mathur
Copy link

nalin-mathur commented Sep 4, 2019

I am trying to setup up this repo on Mac Mojave 10.14.4. When I make the build directory and run 'cmake ..' from it, it shows me the following error:

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

-- Configuring incomplete, errors occurred!

Went to the above link and installed cmake and libomp through brew. I copied the cmake command that is given in the above link and it still showed me the same error as before.

When I try to install LightGBM through the same process, it works seamlessly.

How do I solve this issue and setup this repo?

@acbull
Copy link
Owner

acbull commented Sep 5, 2019

Sorry I haven't tried to compile this repo on MAC environment. But since the major part is based on original LightGBM, it seems that you can follow the same instruction by them to finish compilation. Could you please provide the log that you install original LightGBM and our version?

@nalin-mathur
Copy link
Author

nalin-mathur commented Sep 6, 2019

I did follow the same instructions as given by the original LightGBM repo and it lead to the same error when setting up this repo. However when I tried to setup LightGBM using the same instructions, it worked perfectly.

Thinking that its an issue with the Mac environment, I also tried to setup this repo on a linux aws ec2 instance. This led to a different error.

I am not entirely sure what you meant by 'provide the log that you install original LightGBM and our version'. I am hence sharing the build files for all the three different times (unbiasedLM on ec2 linux server & mac, and LGBM on Mac) I tried to set up these repos.

Please do let me know if there are some specific files that you want me to provide you.

unbiasedlgbm_build_ec2.zip
unbiasedlgbm_build_mac.zip
lightgbm_build_mac.zip

@nalin-mathur
Copy link
Author

nalin-mathur commented Sep 12, 2019

Hey! I have figured out the issue that was there and have successfully installed it on the AWS EC2 environment.

The Cmake version was 2.8 whereas the repo required a higher version. I installed a higher version of the Cmake : 3.15.

There was also no OpenMP support and hence I changed the following lines in Unbias_LightGBM/CMakeLists.txt file:

if(USE_OPENMP)
    find_package(OpenMP REQUIRED)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
    # Ignore unknown #pragma warning
    if( (CMAKE_CXX_COMPILER_ID MATCHES "[cC][lL][aA][nN][gG]")
      OR (CMAKE_CXX_COMPILER_ID MATCHES "[gG][nN][uU]"))
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
    endif()
endif(USE_OPENMP)

Deleted the lines above and replaced it with the following:

IF(USE_OpenMP)
 FIND_PACKAGE(OpenMP)
 IF(OPENMP_FOUND)
   SET(CMAKE_C_FLAGS “${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}“)
   SET(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}“)
 ENDIF()
else()
   # Ignore unknown #pragma warning
   if( (CMAKE_CXX_COMPILER_ID MATCHES “[cC][lL][aA][nN][gG]“)
     OR (CMAKE_CXX_COMPILER_ID MATCHES “[gG][nN][uU]“))
       set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas”)
   endif()
endif(USE_OPenMP)

Will give an update when I try to set this up on Mac environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants