-
-
Notifications
You must be signed in to change notification settings - Fork 823
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 Abstraction for OpenMP #979
Comments
I think it would be more suitable to support openmp by means of ʻadd_requires/add_packages/find_packages`. for example: Install openmp libraries and enable openmp flags. add_requires("openmp", {configs = {...}})
target("test")
set_kind("binary")
add_files("src/*.c")
add_packages("openmp") Only find openmp libraries and enable openmp flags target("test")
set_kind("binary")
add_files("src/*.c")
on_load(function (target)
target:add(find_packages("openmp"))
end) Some references: |
As long as it has its own well documented section I think it is OK. Thanks. |
Ok, I will arrange time to add it later, please wait some time. |
I have supported it. see #990 for C add_requires("libomp", {optional = true})
target("hello")
set_kind("binary")
add_files("src/*.c")
add_rules("c.openmp")
add_packages("libomp") for C++ add_requires("libomp", {optional = true})
target("hello")
set_kind("binary")
add_files("src/*.cpp")
add_rules("c++.openmp")
add_packages("libomp") |
some project examples: https://github.com/xmake-io/xmake/tree/dev/tests/projects/openmp |
Add dedicated option to enable or disable
OpenMP
.For instance something like:
open_mp("on")
oropen_mp("off")
with"off"
being the default.It will automatically set the correct compilation flags (
-fopenmp
,/openmp
,-qopenmp
) and the linking.Also it will be nice to be able to add advanced mode where the user points to the
OpenMP
library file (For instance,CLang
can use Intel'sOpenMP
file which helps with compatibility in many cases [Example: MATLAB which uses Intel'sOpenMP
]).The text was updated successfully, but these errors were encountered: