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

[docs] added installation guide with Homebrew #2414

Merged
merged 3 commits into from Sep 28, 2019
Merged

Conversation

StrikerRUS
Copy link
Collaborator

Closed #2408.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks again for adding this support @ankane

@ankane
Copy link
Contributor

ankane commented Sep 17, 2019

Thank you both.

@StrikerRUS I feel like it probably shouldn't be nested under Clang, since it's already pre-compiled. I'd probably do something like:


On macOS, LightGBM can be installed with Homebrew or built using Apple Clang or gcc.

Homebrew

...

Apple Clang

...

gcc

...

@StrikerRUS
Copy link
Collaborator Author

@ankane

I feel like it probably shouldn't be nested under Clang

Oh, it was my headache for about an hour when I prepared this PR! Yes, with Homebrew users mostly install pre-compiled bottles. But can these bottles be used with gcc?

@ankane
Copy link
Contributor

ankane commented Sep 17, 2019

@StrikerRUS As far as I know, the bottles don't require any compiler. Overall, I'm thinking it'd be good to separate out the install and build from source instructions. Currently, it looks like the Homebrew instructions are part of the build from source docs (imho).

@StrikerRUS
Copy link
Collaborator Author

StrikerRUS commented Sep 17, 2019

@ankane

As far as I know, the bottles don't require any compiler.

According to the docs, bottle can be treated as compiled binary file. According to this part of formula, bottles are built against AppleClang with libomp. I'm not sure that library linked to libomp can run successfully on system with gomp installed. As a side note it's worth to say that there is a lot of headache with supporting projects with OpenMP, e.g.,

LightGBM/.ci/test.sh

Lines 71 to 74 in 0237492

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then
# fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL)
for LIBOMP_ALIAS in libgomp.dylib libiomp5.dylib libomp.dylib; do sudo ln -sf "$(brew --cellar libomp)"/*/lib/libomp.dylib $CONDA_PREFIX/lib/$LIBOMP_ALIAS || exit -1; done
fi

UPD: Now I'm sure:
https://github.com/Homebrew/homebrew-core/blob/823eecea753a7bd7932b0a3ec81ed27c392c5cc9/Formula/libomp.rb#L18-L19

So, I think we should inform users about that downloaded bottles will run under AppleClang. For someone it may be important.

Overall, I'm thinking it'd be good to separate out the install and build from source instructions. Currently, it looks like the Homebrew instructions are part of the build from source docs (imho).

Agree! Seems that using your descriptive sentence with the current structure will help. I'll push changes in a little while.

@StrikerRUS
Copy link
Collaborator Author

@ankane It should be more clear now that Homebrew allows installation in contrast to building from sources.

@ankane
Copy link
Contributor

ankane commented Sep 19, 2019

Thanks @StrikerRUS. I still think it'll be easier for users to understand if it's not under the Apple Clang section (most Homebrew users shouldn't need to know anything about how it was compiled), but understand if you don't agree.

@StrikerRUS StrikerRUS merged commit f2632a6 into master Sep 28, 2019
@StrikerRUS StrikerRUS deleted the macos_install branch September 28, 2019 12:40
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 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

Successfully merging this pull request may close these issues.

Homebrew Formula for LightGBM
3 participants