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

Add support for clang 3.7 w/ openmp backend #393

Closed
dsunder opened this issue Aug 11, 2016 · 13 comments
Closed

Add support for clang 3.7 w/ openmp backend #393

dsunder opened this issue Aug 11, 2016 · 13 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting
Milestone

Comments

@dsunder
Copy link
Contributor

dsunder commented Aug 11, 2016

Clang 3.7 and above support openmp. Please add support for building and testing with clang 3.7 or newer.

@crtrott
Copy link
Member

crtrott commented Aug 11, 2016

Are you sure its full OpenMP 3.1 support?

@crtrott
Copy link
Member

crtrott commented Aug 11, 2016

The website says OpenMP 3.1 is only in Clang 3.8

@gmackey
Copy link
Contributor

gmackey commented Aug 11, 2016

I've compiled and used Kokkos with OpenMP and Clang 3.7 without any issues. On the OpenMP website, they claim OpenMP 3.1 will be added with Clang 3.7 (http://openmp.org/wp/2015/08/clang-37-will-have-full-openmp-31-support/). The release notes for Clang 3.7 says it has full OpenMP 3.1 support as well (http://llvm.org/releases/3.7.0/tools/clang/docs/ReleaseNotes.html#openmp-support).

@dsunder
Copy link
Contributor Author

dsunder commented Aug 11, 2016

I've been using the macports clang-3.7 with OpenMP for over 6 months without any problems.

@hcedwar hcedwar added this to the Backlog milestone Aug 17, 2016
@crtrott crtrott added the Enhancement Improve existing capability; will potentially require voting label Sep 28, 2016
@crtrott crtrott modified the milestones: END 2016, Backlog Sep 28, 2016
@crtrott
Copy link
Member

crtrott commented Sep 28, 2016

Might be 3.8 actually.

@crtrott crtrott self-assigned this Sep 28, 2016
crtrott added a commit that referenced this issue Dec 2, 2016
Tested with 3.9.0 and head, addresses #393
@crtrott
Copy link
Member

crtrott commented Dec 2, 2016

This works now (at least with 3.9.0). Note: the SEMS module was not build with the openmp runtime library. So it will fail to link executables.

@bathmatt
Copy link

@crtrott How does one enable the clang/openmp build? I looked at the code and docs and tried the following.
-fopenmp=libomp -fopenmp-version=31
without luck, if we can add this info to the ticket that would help other seraching

@crtrott
Copy link
Member

crtrott commented Feb 16, 2017

You don't have to do anything. You just need a version of Clang installed which has OpenMP enabled and the LLVM OpenMP runtime installed as well. After that our GNU build at least does all the right things. If you want to do it through Trilinos you need to add: -fopenmp=libomp as you said (you don't need the version thingy). My guess would be that your clang install doesn't actually have the llvm openmp runtime installed (it is an optional thing at least all the way to LLVM/Clang3.9).

@bathmatt
Copy link

bathmatt commented Feb 16, 2017 via email

@crtrott
Copy link
Member

crtrott commented Feb 16, 2017

Oh yeah I should have mentioned that: the SEMS modules did not install OpenMP support in LLVM ....

@gmackey
Copy link
Contributor

gmackey commented Feb 16, 2017

Clang 3.7 supports OpenMP, but it requires a special build as Christian mentioned. Clang 3.8 and above support OpenMP in the normal builds. As far as I know, Clang expects the same flag as GCC to enable OpenMP (-fopenmp). That's what's always worked for me.

@crtrott
Copy link
Member

crtrott commented Feb 16, 2017

Greg, no this is not fully correct. Clang 3.8 and above support OpenMP by default, but they don't actually build the runtime for OpenMP by default. So a default build of Clang will not work for OpenMP without some complicated explicitly added include and link stuff in order to link against the intel OpenMP runtime and find the header files for OpenMP (not sure if it works with the GNU runtime). You can verify this with the sems-clang modules.

@bathmatt
Copy link

bathmatt commented Feb 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

5 participants