-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
CUDA cuDNN CMake try_compile tests fail w/ Xcode clang=8.0.0 #674
Comments
Sure, submit a PR if you can. However, definitely look deeper into the -std=c++11 thing since that sounds very wrong. Maybe the switch is appearing twice and removing it makes it appear once or something like that. But not giving -std=c++11 at all is crazy. |
I'll investigate further. I did confirm that |
I just wanted to confirm that the second commit mentioned here (which omits OpenMP libraries) just saved me from a hassle of building dlib with Cuda enabled. Was struggling with llvm, clang and OpenMP installations for 3 days when I found this post and tried the second commit. dlib built fine and dnn example worked without any problems. It seems at least on my OS and Cuda, the Xcode/clang toolchain has omitted the need for OpenMP check. OS: macOS 10.12.6 |
Cool. Want to submit a PR for this? :)
|
Yeah sure, maybe @headupinclouds should do it because he did all the work, if he can't I'll do it gladly. Also I have not tested on other versions of macOS, Is it possible that this PR would ruin it for others with other OS versions? |
It's definitely possible that it might mess something up, which is why I'm
not doing it, since I can't test it for your systems. I'm also not totally
sure what the exact change is without seeing a diff or patch so I can't
really say. But in any case, any testing you can do beyond your own system
is super.
|
The change I made was the exact copy of @headupinclouds 's commit here. it changes the OpenMP check for Xcode by changing |
Nevertheless I can make the PR but you can merge it when we'll be sure. Is that OK? or should we first make sure and then make the PR? |
It's probably fine. I added that openmp stuff because it was required by the linux version of cuda. Maybe it's not required at all by the macos version of cuda. What happens when you build these things outside xcode with just cmake and make? |
Cool. Seems good. Do remove that xcode specific message statement though. |
@kino-dome : Please feel free to send any of those changes in your own PR. It would be nice to resolve this.
☝️ I recall there was still some weirdness related to the
Thanks for providing the configuration details. It looks like that may be addressed by upgrading. I'm looking forward to trying it. |
Thanks @headupinclouds. I'll take care of it then.
I actually didn't use your first commit with the -std=c++11 flag. It was just the second commit that omits OpenMP. |
look at issue: davisking#674
In case anyone else encounters this part of the issue... I believe the core issue is due to a typo in If I run the following patch on my
This
This was tested w/ CUDA 9.0 on OSX and CMake 3.10.1. The actual error from the test (
see: https://gitlab.kitware.com/cmake/cmake/merge_requests/1628 If this PR is merged, then it should be resolved in a future CMake release. A workaround would be to omit the
This seems to be a combination of |
Is the error still happening as far as anyone knows though? I was under the impression it was worked around in a previous PR. |
I'm not able to build with Since Apple hasn't built HW using NVIDIA since 2013 or so, I'm guessing the intersection of dlib dnn + OS X users who are likely to hit this issue is fairly small (Hackintosh, early eGPU, old MacBooks). Still, it does seem curious. @kino-dome : You mentioned you are now able to build. You provided the following spec.
This is the setup I'm using, except I'm on macOS 10.12.2, which I think is unrelated to the issue. The one thing you didn't share was your I also realized the other part of the issue |
Sounds good. Please send a PR for this stuff then :) |
Hey @headupinclouds, sorry for the delay. I checked my cmake version and it's 3.3.1 . Also what you said about replacing
The PR I made was in relation to the OpenMP issue not the |
I'm walking through dlib DNN CUDA and cuDNN setup for a Mac OS X 10.12 with a preferred Xcode 8.1 (or newer) toolchain.
clang --version
:Apparently, Xcode/clang doesn't like the CUDA and cuDNN CMake
try_compile
tests. In particular, the-std=c++11
CUDA_NVCC_FLAGS
flag triggers an error. Removing the flag makes it happy.An earlier post ( #356 ) suggests a
clang-omp
compiler can be used as a workaround on OS X, but the latest Xcode toolchain seems to work fine with a few mods. I'd prefer to work this into the current CMake if possible.Here is a pointer to the relevant code in the WIP fork:
headupinclouds@1b8bb49
I think we can probably exclude the flag for detected
XCODE
builds:After that, I ran into an issue related to a previously documented CUDA + OpenMP requirement, which doesn't seem to be the case for Xcode/clang. An initial workaround in my test fork is here:
headupinclouds@72b5464
Essentially adding
NOT XCODE
to omitopenmp_libraries
linking seems to be sufficient:If such changes would be merged upstream, I can dig a little deeper and put a revise
pr.xcode.cuda.fix
PR together for review and further discussion. Let me know if that makes sense. Thanks!The text was updated successfully, but these errors were encountered: