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

Fix building XGBoost with libomp 15 #8384

Merged
merged 6 commits into from Oct 25, 2022
Merged

Conversation

hcho3
Copy link
Collaborator

@hcho3 hcho3 commented Oct 25, 2022

The Homebrew package for libomp 15 is now keg-only, meaning that we now need to specify extra build flags.

==> Caveats
libomp is keg-only, which means it was not symlinked into /opt/homebrew,
because it can override GCC headers and result in broken builds.

For compilers to find libomp you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"

This PR attempts to fix building XGBoost with libomp 15.

This should be also back-ported to the R package.

@hcho3 hcho3 added the Blocking label Oct 25, 2022
R-package/configure.ac Outdated Show resolved Hide resolved
@hcho3
Copy link
Collaborator Author

hcho3 commented Oct 25, 2022

@trivialfis Can I get another round of review?

# Homebrew not found
HOMEBREW_LIBOMP_PREFIX=''
fi
OPENMP_CXXFLAGS="-Xpreprocessor -fopenmp -I${HOMEBREW_LIBOMP_PREFIX}/include"
Copy link
Member

Choose a reason for hiding this comment

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

what's the difference between -Xclang and -Xpreprocessor ?

Copy link
Collaborator Author

@hcho3 hcho3 Oct 25, 2022

Choose a reason for hiding this comment

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

No idea. I only know that Xpreprocessor works on my Macbook but Xclang doesn't.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it has to do with the fact that we have to specify extra flags to the preprocessor specifically, due to non-standard location of OpenMP.

@hcho3 hcho3 merged commit 8bb5594 into dmlc:master Oct 25, 2022
@hcho3 hcho3 deleted the fix_macos_openmp branch October 25, 2022 19:01
@hcho3
Copy link
Collaborator Author

hcho3 commented Oct 25, 2022

This should now unblock the CI.

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

Successfully merging this pull request may close these issues.

None yet

2 participants