-
Notifications
You must be signed in to change notification settings - Fork 95
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
openmp on Travis fails for CLang and/or OSX #117
Comments
There is a difference between gcc and llvm. There are some details here: https://stackoverflow.com/questions/33357029/using-openmp-with-clang but the main message is: |
Latest results with Travis (after merge with master):
|
I don't have much time at this moment,
but if the problem still exists in April, then I promise to fix it.
But in the meantime:
There are two challenges with openmp using clang:
-it requires different command line options both for the linker and the compiler (and it needs a different library to be linked)
- old clangs did not have proper openmp support, and travis might just use a too old.
Possible fixes:
- cmake:
- disable/warn openmp for (old) clang
- add clang specific options
- travis:
- skip openmp for clang
- update clang/install proper openmp lib
See: https://stackoverflow.com/questions/33357029/using-openmp-with-clang
Best,
David
…On February 2, 2018 7:45:31 PM GMT+01:00, Kris Thielemans ***@***.***> wrote:
Latest results with Travis (after merge with master):
- Linux with gcc is ok
- Linux with clang: List of linking errors with e.g.
`__kmpc_global_thread_num`
- OSX with clang and gcc:
```
CMake Error at
/usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137
(message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
```
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#117 (comment)
|
After eaa298, the situation has improved somewhat.
On OSX, possibly this might help when using LLVM. Note that the XCode 9 image on Travis has
and for "gcc"
CMake doesn't support OpenMP with Apple's version of clang yet. There seem to be some work-arounds for the adventurous. |
Possibly some of this might be resolved by following the recommendation to link with OpenMP::OpenMP_CXX`. This should be done in any case, but needs checking from which CMake version it is supported |
I gave this a go by doing I then set Then, I set Lastly, I needed to add Compilation then succeeds, but I have yet to test it (since my end goal was to use STIR with SIRF). |
thanks. Please note that you should never modify Are you saying that CMake didn't find
|
here's the link to the CMake FAQ on using a non-default compiler |
I tried the first two methods suggested in your link, both of them correctly set the compiler, but Sorry, what do you mean by:
|
ok. seems that we need the fix suggested here, (until CMake gets its act together) although it'd be better to combine it with adding a PRIVATE dependency to Related to
I meant that I thought you changed |
Running CMake with the following means that it finds the correct I'll do some more experimenting and let you know how it goes... |
I am trying to install OpenMP on my Mac, and I’m having problems. I have been using a fully declared path as /usr/local/opt/llvm/bin/clang (or clang++ for cxx_compiler) It configures ok but when it generates it says: CMake Error in src/recon_buildblock/CMakeLists.txt: I tried with different versions of clang and I have the same problem. |
It can only be this line STIR/src/recon_buildblock/CMakeLists.txt Line 111 in c52e641
presumably the value of Or better (as mentioned above), we should say target_link_libraries(recon_buildblock OpenMP::OpenMP_CXX) |
presumably fixed by #413 |
Hi, going to give a rundown of what I did that resulted in an OpenMP STIR on OSX.
I believe this is now fixed, I can configure with the llvm clang on mac (installed with
When setting STIR_OpenMP to True, configuing gave the following error:
Setting up the cmake, the setting mentioned by Richard:
did not work, but the exports did:
and the OMP specific libraries and flags were set automatically by cmake. STIR installed with ROOT, ITK, HDF5, and python 3.8 support and the recon_test_pack tests ran without fault, including |
it's great that it works! To avoid confusion though, #413 was reverted, so we actually didn't change anything in STIR 😉 want to do a PR for Travis? modify Line 48 in 4087d85
export statements around here.
|
seems http://stir.sourceforge.net/wiki/index.php/Installing_STIR_with_CMake#Mac_OS_X is rather out-of-date... Would you mind updating it? See instructions The wiki is terribly slow though. We might need to transition this to github, but I have no idea how. |
I've enabled OPENMP testing on Travis. We get the following type of run-time error
on the CLang Linux and OSX builds, see https://travis-ci.org/UCL/STIR/builds/289769526 for all builds, and the log of one of the failed ones. Linking is fine. gcc builds are fine as well.
The text was updated successfully, but these errors were encountered: