-
Notifications
You must be signed in to change notification settings - Fork 1.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
[question] Handling OpenMP in recipes #1012
Comments
if the OpenMP support is done with an already supported compiler in CCI, I'd say that adding a recipe option and the required flags will be enough to enable openmp support in the recipes |
Most recipes I've seen add the following flags unconditionally to
However it fails with some configurations and I learnt recently that |
Should OpenMP be a "system requirement recipe" like the ones discussed in #641 or is it just a compiler optimization? |
I think that |
Stumbling on this when porting to conan v2. What is the conanical (see what I did there?) way in conan 2? |
Basically this: def requirements(self):
if self.options.with_openmp and self.settings.compiler in ["clang", "apple-clang"]:
self.requires("llvm-openmp/17.0.6", transitive_headers=True, transitive_libs=True)
@property
def _openmp_flags(self):
if self.settings.compiler == "clang":
return ["-fopenmp=libomp"]
elif self.settings.compiler == "apple-clang":
return ["-Xclang", "-fopenmp"]
elif self.settings.compiler == "gcc":
return ["-fopenmp"]
elif self.settings.compiler == "intel-cc":
return ["-Qopenmp"]
elif self.settings.compiler == "sun-cc":
return ["-xopenmp"]
elif is_msvc(self):
return ["-openmp"]
return None
def package_info(self):
...
if self.options.with_openmp:
if self.settings.compiler in ["clang", "apple-clang"]:
self.cpp_info.requires.append("llvm-openmp::llvm-openmp")
openmp_flags = self._openmp_flags
self.cpp_info.cflags = openmp_flags
self.cpp_info.cxxflags = openmp_flags
self.cpp_info.sharedlinkflags = openmp_flags
self.cpp_info.exelinkflags = openmp_flags Only set the For more details about OpenMP and Conan/CCI see: |
Several libraries optionally handles OpenMP and generally require specific compiler and linker options in order to do so, including when one needs to link against them. What would be the best way to handle such packages in CII?
The text was updated successfully, but these errors were encountered: