diff options
| author | ruki <[email protected]> | 2020-10-12 22:59:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-12 22:59:59 +0800 |
| commit | c79cdeab5474507647f1c29b2cb759550f98e8b6 (patch) | |
| tree | e414374cef6a4f5c460e1f5dba23eb8f3d8aa268 /tests | |
| parent | 55209d22fedd5a0ea5323e81356cfe0c88603f30 (diff) | |
add libomp for openmp examples
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/openmp/hello/src/main.c | 2 | ||||
| -rw-r--r-- | tests/projects/openmp/hello/xmake.lua | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/projects/openmp/hello/src/main.c b/tests/projects/openmp/hello/src/main.c index cea215566..54ba9db96 100644 --- a/tests/projects/openmp/hello/src/main.c +++ b/tests/projects/openmp/hello/src/main.c @@ -5,7 +5,7 @@ int main(int argc, char** argv) { #pragma omp parallel { - printf("hello %d\n", omp_get_thread_num()); + printf("hello %d\n", omp_get_thread_num()); } return 0; } diff --git a/tests/projects/openmp/hello/xmake.lua b/tests/projects/openmp/hello/xmake.lua index 685a6a34b..c1f837287 100644 --- a/tests/projects/openmp/hello/xmake.lua +++ b/tests/projects/openmp/hello/xmake.lua @@ -1,3 +1,6 @@ +add_requires("libomp", {optional = true}) target("hello") set_kind("binary") add_files("src/*.c") + add_rules("c.openmp") + add_packages("libomp") |
