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

Add OpenMP as CMake target #586

Merged
merged 7 commits into from
Dec 26, 2019
Merged

Add OpenMP as CMake target #586

merged 7 commits into from
Dec 26, 2019

Conversation

hcho3
Copy link
Contributor

@hcho3 hcho3 commented Dec 22, 2019

Simplify logic for importing OpenMP into the CMake build by treating OpenMP as a target. This way, we no longer have to set compiler flags to enable OpenMP. See https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html for more information.

@dmlc/dmlc-core-committer @trivialfis Please help review. This will be especially useful for Mac OSX users. The old way requires them to use Homebrew GCC, which is a heavy dependency (*). The new way allows them to use Apple Clang (default system compiler) instead.

(*) See discussion at Homebrew/homebrew-core#43246, where Homebrew maintainers asked to remove GCC dependency from XGBoost.

@hcho3 hcho3 changed the title Add OpenMP as CMake target [WIP] Add OpenMP as CMake target Dec 23, 2019
@hcho3 hcho3 changed the title [WIP] Add OpenMP as CMake target Add OpenMP as CMake target Dec 23, 2019
@hcho3
Copy link
Contributor Author

hcho3 commented Dec 23, 2019

Sorry for the noise. I'm now done ironing out all loose ends. This PR is now ready for review.

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

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

Not sure if testing against gcc on OSX is required with dmlc-core.

@hcho3
Copy link
Contributor Author

hcho3 commented Dec 23, 2019

@trivialfis Do you mean that we should remove unittest_gtest for OSX?

@trivialfis
Copy link
Member

@hcho3 No. I see package gcc@7 is removed, so we are no-longer testing dmlc-core compiled with gcc on OSX. Just curious whether the test is required for dmlc-core.

@hcho3
Copy link
Contributor Author

hcho3 commented Dec 23, 2019

@trivialfis I put back gcc. Now dmlc-core is tested against both gcc and Apple Clang.

@hcho3
Copy link
Contributor Author

hcho3 commented Dec 24, 2019

@larroy

@hcho3 hcho3 merged commit 650d9f6 into dmlc:master Dec 26, 2019
@hcho3 hcho3 deleted the modernize_openmp branch December 26, 2019 04:24
@larroy
Copy link
Contributor

larroy commented Jan 4, 2020

sorry I missed this LGTM

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

Successfully merging this pull request may close these issues.

3 participants