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

How to link with OpenMP? #266

Closed
kornelski opened this issue Nov 4, 2017 · 1 comment
Closed

How to link with OpenMP? #266

kornelski opened this issue Nov 4, 2017 · 1 comment

Comments

@kornelski
Copy link
Contributor

OpenMP is special in that it requires -fopenmp to be passed to the linker (-lopenmp won't work).

cc.flag('-fopenmp') is passed only to the compiler, but not the linker. AFAIK cargo doesn't allow arbitrary linker flags.

Is is possible to use OpenMP with build scripts/cargo?

@kornelski
Copy link
Contributor Author

kornelski commented Nov 4, 2017

OK, got it:

            println!("cargo:rustc-link-lib=gomp"); // static needs gcc_eh too

~/.cargo/config

[target.x86_64-apple-darwin]
linker = "gcc-7"

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

No branches or pull requests

1 participant