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

Workaround for CMake 3.12 bug passing -thread to nvcc #649

Merged
merged 4 commits into from Nov 27, 2018

Conversation

@halfflat
Copy link
Collaborator

halfflat commented Nov 20, 2018

CMake wants to run a device link pass with nvcc despite
there being no CUDA seperable compilation enabled anywhere,
and then passes on -pthread to that unnecessary nvcc
invocation when we use the Threads dependency. The latter,
at least, is fixed in CMake 3.13.

We used the prefer -pthread option for compatibility with
our earlier build configuration; turning it off will
hopefully have no consequence.

We also enable device linking on the arbor library. Which
is not needed, but if they are going to insist on doing it,
it should be on the library rather than the executable.

CMake then goes and does it on the executable anyway. Great.

Fixes #645.

CMake wants to run a device link pass with nvcc despite
there being no CUDA seperable compilation enabled anywhere,
and _then_ passes on -pthread to that unnecessary nvcc
invocation when we use the Threads dependency. The latter,
at least, is fixed in CMake 3.13.

We used the prefer -pthread option for compatibility with
our earlier build configuration; turning it off will
hopefully have no consequence.

We also enable device linking on the arbor library. Which
is not needed, but if they are going to insist on doing it,
it should be on the library rather than the executable.

CMake then goes and does it on the executable anyway. Great.

Fixes #645.
@halfflat halfflat requested a review from bcumming Nov 20, 2018
CMake improperly exports a CUDA dependency to users of
arbor if it is configured with ARB_WITH_GPU. See
https://gitlab.kitware.com/cmake/cmake/issues/18614

* Patch imported library specification to remove improper dependency and add CUDA runtime library dependency.
@@ -67,7 +67,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif()

# When we find threads, prefer -pthread option.

This comment has been minimized.

Copy link
@apeyser

apeyser Nov 22, 2018

Contributor

Comment seems out of date

This comment has been minimized.

Copy link
@halfflat

halfflat Nov 22, 2018

Author Collaborator

Good catch, thanks!

halfflat and others added 2 commits Nov 22, 2018
Copy link
Member

bcumming left a comment

lgtm

@bcumming bcumming merged commit af15856 into arbor-sim:master Nov 27, 2018
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@halfflat halfflat deleted the halfflat:bugfix/cmake-3.12-cuda-fix branch Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.