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

编译GPU版本出错:CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x20af): first defined here #26

Closed
zccyman opened this issue Nov 29, 2017 · 4 comments

Comments

@zccyman
Copy link

zccyman commented Nov 29, 2017

Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/syncmem.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 23%] /usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/svm_matlab_interface.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 24%] /usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building CXX object src/thundersvm/CMakeFiles/thundersvm.dir/svm_python_interface.cpp.o
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Linking CXX shared library ../../lib/libthundersvm.so
/usr/bin/cmake: /root/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function void std::_Destroy<std::string>(std::string*)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:92: multiple definition of svm_kernel::sum_kernel_values(SyncData const&, int, SyncData const&, SyncData const&, SyncData const&, SyncData const&, SyncData&, int, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x275): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::get_working_set_ins(SyncData<float> const&, SyncData<int> const&, SyncData<int> const&, SyncData<int> const&, SyncData<float>&, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:101: multiple definition of svm_kernel::get_working_set_ins(SyncData const&, SyncData const&, SyncData const&, SyncData const&, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x0): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::RBF_kernel(SyncData<float> const&, SyncData<float> const&, SyncData<float>&, int, int, float)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:111: multiple definition of svm_kernel::RBF_kernel(SyncData const&, SyncData const&, SyncData&, int, int, float)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x74): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::RBF_kernel(SyncData<int> const&, SyncData<float> const&, SyncData<float>&, int, int, float)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:119: multiple definition of svm_kernel::RBF_kernel(SyncData const&, SyncData const&, SyncData&, int, int, float)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0xf8): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::poly_kernel(SyncData<float>&, float, float, int, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:124: multiple definition of svm_kernel::poly_kernel(SyncData&, float, float, int, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x17c): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::sigmoid_kernel(SyncData<float>&, float, float, int)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:128: multiple definition of svm_kernel::sigmoid_kernel(SyncData&, float, float, int)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x200): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o: In function svm_kernel::dns_csr_mul(int, int, int, SyncData<float> const&, SyncData<float> const&, SyncData<int> const&, SyncData<int> const&, int, SyncData<float>&)': /workspace/thundersvm/src/thundersvm/kernel/kernelmatrix_kernel.cu:138: multiple definition of svm_kernel::dns_csr_mul(int, int, int, SyncData const&, SyncData const&, SyncData const&, SyncData const&, int, SyncData&)'
CMakeFiles/thundersvm.dir/kernel/kernelmatrix_kernel.cpp.o:kernelmatrix_kernel.cpp:(.text+0x308): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function _ZN6thrust6system4cuda6detail4cub_12DoubleBufferIiEC4Ev': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:260: multiple definition of svm_kernel::c_smo_solve(SyncData const&, SyncData&, SyncData&, SyncData&, SyncData const&, float, float, SyncData const&, SyncData const&, int, float, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x7e): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function svm_kernel::nu_smo_solve(SyncData<int> const&, SyncData<float>&, SyncData<float>&, SyncData<float>&, SyncData<int> const&, float, SyncData<float> const&, SyncData<float> const&, int, float, SyncData<float>&, int)': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:273: multiple definition of svm_kernel::nu_smo_solve(SyncData const&, SyncData&, SyncData&, SyncData&, SyncData const&, float, SyncData const&, SyncData const&, int, float, SyncData&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0xdaa): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function _ZN6thrust6system4cuda6detail4cub_23DeviceRadixSortDispatchILb0EfiiE12KernelConfigC4Ev': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:300: multiple definition of svm_kernel::update_f(SyncData&, SyncData const&, SyncData const&, int)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x2054): first defined here
CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o: In function svm_kernel::sort_f(SyncData<float>&, SyncData<int>&)': /workspace/thundersvm/src/thundersvm/kernel/smo_kernel.cu:305: multiple definition of svm_kernel::sort_f(SyncData&, SyncData&)'
CMakeFiles/thundersvm.dir/kernel/smo_kernel.cpp.o:smo_kernel.cpp:(.text+0x20af): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libthundersvm.so] Error 1
make[1]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/all] Error 2
make: *** [all] Error 2

@shijiashuai
Copy link
Collaborator

seems that it failed to disable CPU code when compiling with GPU. I've just committed a new version. You may have a try.

@zccyman
Copy link
Author

zccyman commented Nov 29, 2017

@shijiashuai I already solve this error. in thundersvm/kernel/*.cu, Make the following changes:

#ifdef USE_CUDA

#include <thrust/sort.h>
#include <thrust/system/cuda/detail/par.h>
#include "thundersvm/kernel/smo_kernel.h"

........
#endif

@zeyiwen
Copy link
Collaborator

zeyiwen commented Nov 29, 2017

Sounds good.

@zeyiwen zeyiwen closed this as completed Nov 29, 2017
@shijiashuai
Copy link
Collaborator

@zccyman your solution will disable GPU codes, and CPU codes (in kernel/*.cpp) will be used. Although this may compile successfully, other issues will appear when you run the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants