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

Not being able to use OpenMP #2634

Closed
Daniel-Boll opened this issue Aug 1, 2022 · 2 comments
Closed

Not being able to use OpenMP #2634

Daniel-Boll opened this issue Aug 1, 2022 · 2 comments

Comments

@Daniel-Boll
Copy link

Daniel-Boll commented Aug 1, 2022

Xmake Version

2.6.9

Operating System Version and Architecture

Linux artix 5.18.14-artix1-1 x86_64 GNU/Linux

Describe Bug

Testing with the simple example loop using gcc seems to work fine.

openmp_test via πŸŒ™ v5.4.4
❯ g++ src/main.cpp -fopenmp; ./a.out
hello(4): i = 6
hello(1): i = 2
hello(1): i = 3
hello(0): i = 0
hello(0): i = 1
hello(7): i = 9
hello(2): i = 4
hello(6): i = 8
hello(3): i = 5
hello(5): i = 7

Yet still with xmake the result is not the same.

openmp via πŸŒ™ v5.4.4
❯ xmake && xmake run
[100%]: build ok!
hello(0): i = 0
hello(0): i = 1
hello(0): i = 2
hello(0): i = 3
hello(0): i = 4
hello(0): i = 5
hello(0): i = 6
hello(0): i = 7
hello(0): i = 8
hello(0): i = 9

Expected Behavior

To work similarly as the gcc.

Project Configuration

add_requires("openmp")
target("loop")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("openmp")

Additional Information and Error Logs

openmp via πŸŒ™ v5.4.4
❯ xmake -vD

build cache stats:
cache directory: build/.build_cache
cache hit rate: 0%
cache hit: 0
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0

[100%]: build ok!
@Daniel-Boll Daniel-Boll added the bug label Aug 1, 2022
@waruqi
Copy link
Member

waruqi commented Aug 1, 2022

try dev. #2603

xmake update dev

@Daniel-Boll
Copy link
Author

Thank you, this alongside with

set_policy("preprocessor.gcc.directives_only", false)

did the job. Once again thank you for the fast replies, and sorry for the duplicate.

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

No branches or pull requests

2 participants