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

nvcc fatal : Unknown option 'fopenmp' using CMAKE #3314

Closed
adujardin opened this issue Jun 4, 2019 · 4 comments
Closed

nvcc fatal : Unknown option 'fopenmp' using CMAKE #3314

adujardin opened this issue Jun 4, 2019 · 4 comments
Labels
Likely bug Maybe a bug, maybe not

Comments

@adujardin
Copy link

Hi,
Using the vanilla CMakeLists to compile I have the following issue on Ubuntu 18 (default cmake 3.10.2, g++ 7.4), CUDA 10 :

nvcc fatal : Unknown option 'fopenmp'

I tried several fixes, including replacing --compiler-options by -Xcompiler as a common fix for this issue with no luck, here:

set(CMAKE_CUDA_FLAGS "-gencode arch=compute_${CUDA_COMPUTE_MODEL},code=[sm_${CUDA_COMPUTE_MODEL},compute_${CUDA_COMPUTE_MODEL}] --compiler-options \"-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -Wno-deprecated-declarations -fPIC -fopenmp -Ofast -DOPENCV -DGPU -DCUDNN \" ${CMAKE_CUDA_FLAGS}")

One solution found was to comment these lines:

darknet/CMakeLists.txt

Lines 306 to 307 in 5b8929b

target_link_libraries(darknet PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(darklib PRIVATE OpenMP::OpenMP_CXX)

@cenit Do you have an idea why nvcc complains about that?
Are these 2 lines necessary?

@AlexeyAB AlexeyAB added the Likely bug Maybe a bug, maybe not label Jun 4, 2019
@cenit
Copy link
Collaborator

cenit commented Jun 4, 2019

Hi @adujardin
let's fix this problem. First of all do you have the same symptoms using #2952? I fixed CMakeLists.txt a little bit there, I am waiting on @AlexeyAB for some feedback for merge but otherwise it should be production ready

@adujardin
Copy link
Author

adujardin commented Jun 4, 2019

Hi @cenit
I tried your branch, however, I have the same issue.

Do you know if there's a way to check if a library have been compiled with OpenMP? I would like to check if removing these makes a difference on the final lib/exe.

darknet/CMakeLists.txt

Lines 306 to 307 in 5b8929b

target_link_libraries(darknet PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(darklib PRIVATE OpenMP::OpenMP_CXX)

Edit: removed other unrelated issues for clarity, see below

@adujardin
Copy link
Author

Just in case I also tried with the docker image provided by nvidia matching my configuration to have a clean setup.

I don't have the issues mentioned above, except the nvcc fatal : Unknown option 'fopenmp'.
You can ignore those, I'll try to investigate why since I installed it using the standard way.

@cenit
Copy link
Collaborator

cenit commented Jun 12, 2019

A proper fix is contained in #3371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Likely bug Maybe a bug, maybe not
Projects
None yet
Development

No branches or pull requests

3 participants