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

link pthread failed when using cmake 3.12.0 #86

Closed
yhmtsai opened this issue Jul 20, 2018 · 4 comments

Comments

@yhmtsai
Copy link
Collaborator

commented Jul 20, 2018

When use cmake 3.12.0, it will produce a error nvcc fatal : Unknown option 'pthread'

There are two cmake version 3.10.1 and 3.12.0 difference.

// cmake-3.10.1
/usr/local/cuda-8.0/bin/nvcc   -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_35,code=compute_35 --expt-relaxed-constexpr  -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/cuda_test_base_cuda_executor.dir/cuda_executor.cu.o -o CMakeFiles/cuda_test_base_cuda_executor.dir/cmake_device_link.o 
// cmake-3.12.0
/usr/local/cuda-8.0/bin/nvcc   -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_35,code=compute_35 --expt-relaxed-constexpr -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/cuda_test_base_cuda_executor.dir/cuda_executor.cu.o -o CMakeFiles/cuda_test_base_cuda_executor.dir/cmake_device_link.o -Xnvlink ../../../core/libginkgo.so -Xnvlink ../../../third_party/gtest/build/googlemock/gtest/libgtest_main.so -Xnvlink ../../../omp/libginkgo_omp.so -Xnvlink ../../libginkgo_cuda.so -Xnvlink ../../../reference/libginkgo_reference.so -Xnvlink ../../../third_party/gtest/build/googlemock/gtest/libgtest.so -pthread

pthread comes from gtest

It is maybe from
https://gitlab.kitware.com/cmake/cmake/commit/41eab150a8ef42bbebff18ff84652e9da1ef4e75

@tcojean tcojean added Bug Build labels Jul 20, 2018

@venovako

This comment has been minimized.

Copy link

commented Jul 23, 2018

I have the same problem.

A way to avoid it might be to disable pthreads in gtest, i.e., to set gtest_disable_pthreads boolean to ON with (c)cmake.

At least, that was enough for me to get everything linked.

@gflegar

This comment has been minimized.

Copy link
Member

commented Jul 24, 2018

This is the new version released 7 days ago? Or one of the release candidates?

https://github.com/Kitware/CMake/releases

@venovako

This comment has been minimized.

Copy link

commented Jul 24, 2018

This is 3.12.0 release, installed on Monday from the shell-script Linux installer.

@gflegar gflegar added the Confirmed label Aug 28, 2018

@gflegar

This comment has been minimized.

Copy link
Member

commented Aug 28, 2018

Can confirm this, CMake from the arch linux package managers (which I use locally, and is used on the CI system) got updated to 3.12, and the same thing happens.

Will try the suggested workaround for now, until we find a proper solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.