Closed JT17 closed 10 years ago
regarding the cuv_python
error, I cannot reproduce it. can you add system
to the boost library list in cuv_python/CMakeLists.txt
and try again?
regarding the second error, can you paste the program you're writing and how you tried to compile/link?
g++ -I /usr/local/cuda-6.0/ program.cpp -lboost_system
using namespace cuv;
int main(void){
tensor<float,host_memory_space> h(extents[8][5]);
tensor<float,dev_memory_space> d(extents[8][5]);
h=0;
d=h;
sequence(d);
h=d;
for(int i=0; i<h.size(); i++){
assert(d[i]==h[i]);
}
return 0;
}
Sorry this might be a stupid question but for the python fix would it be changing these lines? SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev, libblas-dev, libpng-dev, libjpeg-dev" ) SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "cimg-dev, python-dev, libboost-python-dev" ) in CMakeLists.txt?
if you want to compile a c++ program using cuv, you have to link to cuv as well. Try:
g++ -I /usr/local/cuda-6.0/ program.cpp -lcuv
The debian package dependencies are irrelevant for your problem I believe. Did you try adding system
to the line I described?
Okay thanks the C++ code compiles now. As for adding system the Boost_LIBRARIES line is commented out in the TARGET_LINK_LIBRARIES line of the makefile. Could that be the issue?
good point. The reason it is commented is that cuv is already linked to all of the boost libraries. Since cuv_python is linked to cuv, no further linking with boost should be necessary. It still weird. You can check which libraries it actually tries to link by running make VERBOSE=1 cuv_python
(you may have to touch some .cpp file in cuv_python
directory to force a rebuild). Could you post the line which does the linking here?
ah okay. as far as I can tell these are the linked libraries (boost_system is not one from what I can see) -lboost_date_time -lboost_python -lboost_date_time -lboost_python -lpython2.7 /usr/local/cuda-6.0/lib64/libcublas.so -lf77blas -latlas -lX11 -lpthread -lpng -lz ../3rd_party/cudaconv2/libtp_cudaconv2.so.0.9 -lcblas ../3rd_party/cuda_ndarray/libtp_theano.so.0.9 /usr/local/cuda-6.0/lib64/libcudart.so -lcuda -lpng -lpython2.7 -lf77blas -latlas -Wl,-rpath,/home/mobile/Downloads/CUV/build/debug/src/cuv:/usr/local/cuda-6.0/lib64:/home/mobile/Downloads/CUV/build/debug/src/3rd_party/cudaconv2:/home/mobile/Downloads/CUV/build/debug/src/3rd
Are you sure boost.system is installed on your system?
yeah I've used it in the past and the C++ version of CUV compiles now
What happens if you copy the linker line, add boost system, and run it? I understand this would only be a temporary fix, but just to ensure that this works...
I might have done it wrong but when I tried to just run that linker line it doesn't compile correctly because all of the .o files are missing
you're probably not in the correct directory, when you run make it tells you a line like "Entering directory ...." before the command you copied. Please switch to that directory before running the modified command.
Oh good point. It still doesn't work though. I ran this: /usr/bin/c++ -fPIC -fPIC -g -shared -Wl,-soname,_cuv_python.so -o _cuv_python.so CMakeFiles/cuv_python.dir/python_bindings.cpp.o CMakeFiles/cuv_python.dir/export_tensor.cpp.o CMakeFiles/cuv_python.dir/export_cuda_array.cpp.o CMakeFiles/cuv_python.dir/export_matrix_ops.cpp.o CMakeFiles/cuv_python.dir/export_tensor_ops.cpp.o CMakeFiles/cuv_python.dir/export_random.cpp.o CMakeFiles/cuv_python.dir/export_convolution_ops.cpp.o CMakeFiles/cuv_python.dir/export_image_ops.cpp.o CMakeFiles/cuv_python.dir/export_tools.cpp.o CMakeFiles/cuv_python.dir/export_libs_rbm.cpp.o CMakeFiles/cuv_python.dir/export_libs_kmeans.cpp.o CMakeFiles/cuv_python.dir/export_libs_kernels.cpp.o CMakeFiles/cuv_python.dir/export_libs_cimg.cpp.o ../cuv/libcuv.so.0.9 -lboost_date_time -lboost_python -lboost_date_time -lboost_python -lboost_system -lpython2.7 /usr/local/cuda-6.0/lib64/libcublas.so -lf77blas -latlas -lX11 -lpthread -lpng -lz ../3rd_party/cudaconv2/libtp_cudaconv2.so.0.9 -lcblas ../3rd_party/cuda_ndarray/libtp_theano.so.0.9 /usr/local/cuda-6.0/lib64/libcudart.so -lcuda -lpng -lpython2.7 -lf77blas -latlas -Wl,-rpath,/home/mobile/Downloads/CUV/build/debug/src/cuv:/usr/local/cuda-6.0/lib64:/home/mobile/Downloads/CUV/build/debug/src/3rd_party/cudaconv2:/home/mobile/Downloads/CUV/build/debug/src/3rd_party/cuda_ndarray:
but when I try import cuv_python I get /usr/local/lib/libtp_theano.so.0: undefined symbol: _ZN5boost6system15system_categoryEv
Could it be that my theano is broken not CUV?
ok, that sounds like a promising idea. Can you please try the following:
in src/3rd_party/cuda_ndarray
, edit CMakeLists.txt
and add ${Boost_LIBRARIES}
to the TARGET_LINK_LIBRARIES
directive?
unfortunately that did not work either
is boost_system
part of the link command for tp_theano,so
?
I'm not sure. Where is that defined? In CUV or in theano?
cuv includes a copy of theano's cuda_ndarray source code in src/3rd_party. The link command is also there. By the way, when you try whether a change works, do you also install/copy to /usr/local
? It seems you load your libraries from there...
I think I'm reinstalling the /usr/local copy every time. I have run make clean and rebuilt everything for most of the fixes. That should rebuild the /usr/local copy right?
a make clean should not be necessary, cmake detects when linker commands have changes and should redo only those. a build does not imply an install, so I suspect you're using outdated versions. Can you make sure by looking at the modification time of the libs you use, i.e. by ls -al /usr/local/lib/libcuv.so.0.9
?
Oh yeah you're right it is not an updated version that was really dumb of me. Do I need to run make install every time or is there a faster way?
no, you just have to tell your programs where to look for the libraries.
-L path-to-libcuv.so
(most likely cuv/build/src/cuv
), libcuv.so
(same as above). _cuv_python.so
(most likely cuv/build/src
)Okay that worked thank you so much sorry for not realizing that earlier
No problem. I'll push the fix later today.
Hi so I have installed everything according to the installation guide and there aren't any issues as far as I know. However, I cannot compile anything in C++ or import the library in python. When I try to import cuv_python I get an Import error:ImportError: /usr/local/lib/libtp_theano.so.0: undefined symbol: _ZN5boost6system
When I try to compile a simple program in C++ I get a whole list of errors which seem to indicate something inside cuv can't find some file in cuv: /tmp/ccxiUJdU.o: In function(int const , unsigned long, cuv::host_memory_space)'
/tmp/ccxiUJdU.o: In function (unsigned int const , unsigned long, cuv::host_memory_space)'
/tmp/ccxiUJdU.o: In function (float const , unsigned long, cuv::host_memory_space)'
/tmp/ccxiUJdU.o: In function (unsigned int , unsigned long, unsigned int, cuv::host_memory_space)'
/tmp/ccxiUJdU.o: In function (float const , unsigned long, cuv::dev_memory_space)'
/tmp/ccxiUJdU.o: In function (float, float const, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstream_st)'
program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x2a1): undefined reference to`void cuv::detail::copy2d<float, float>(float, float const_, unsigned long, unsigned long, unsigned long, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstreamst)'
program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x3b1): undefined reference to `void cuv::detail::copy2d<float, float>(float, float const_, unsigned long, unsigned long, unsigned long, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstreamst)'
program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x4b9): undefined reference to `cuv::cuvAssertFailed(char const)'
program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x4dc): undefined reference to`cuv::cuvAssertFailed(char const)'
program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x54b): undefined reference to `void cuv::detail::copy2d<float, float>(float, float const_, unsigned long, unsigned long, unsigned long, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstreamst)'
/tmp/ccxiUJdU.o: In function (float, float const, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstreamst)'
program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x2a1): undefined reference to `void cuv::detail::copy2d<float, float>(float, float const_, unsigned long, unsigned long, unsigned long, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstreamst)'
program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x3b1): undefined reference to (unsigned long const&)':
program.cpp:(.text._ZN3cuv9referenceIiNS_17host_memory_spaceEEaSImEEN5boost11enable_if_cIXsrNS4_14is_convertibleITiEE5valueEvE4typeERKS7[_ZN3cuv9referenceIiNS_17host_memory_spaceEEaSImEEN5boost11enable_if_cIXsrNS4_14is_convertibleITiEE5valueEvE4typeERKS7]+0x2c): undefined reference to (unsigned int , unsigned int const_, unsigned long, cuv::host_memory_space, cuv::host_memory_space, CUstreamst)'
/tmp/ccxiUJdU.o: In function (float, float const, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstreamst)'
/tmp/ccxiUJdU.o: In function (float, float const, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstreamst)'
collect2: error: ld returned 1 exit status
cuv::reference<int, cuv::host_memory_space>::operator int() const': program.cpp:(.text._ZNK3cuv9referenceIiNS_17host_memory_spaceEEcviEv[_ZNK3cuv9referenceIiNS_17host_memory_spaceEEcviEv]+0x1f): undefined reference to
int cuv::detail::entrygetcuv::reference<unsigned int, cuv::host_memory_space>::operator unsigned int() const': program.cpp:(.text._ZNK3cuv9referenceIjNS_17host_memory_spaceEEcvjEv[_ZNK3cuv9referenceIjNS_17host_memory_spaceEEcvjEv]+0x1f): undefined reference to
unsigned int cuv::detail::entrygetcuv::default_allocator::default_allocator()': program.cpp:(.text._ZN3cuv17default_allocatorC2Ev[_ZN3cuv17default_allocatorC5Ev]+0x1f): undefined reference to
vtable for cuv::default_allocator' /tmp/ccxiUJdU.o: In functionvoid cuv::sequence<float, cuv::dev_memory_space, cuv::row_major>(cuv::tensor<float, cuv::dev_memory_space, cuv::row_major>&)': program.cpp:(.text._ZN3cuv8sequenceIfNS_16dev_memory_spaceENS_9row_majorEEEvRNS_6tensorIT_T0_T1_EE[_ZN3cuv8sequenceIfNS_16dev_memory_spaceENS_9row_majorEEEvRNS_6tensorIT_T0_T1_EE]+0x22): undefined reference to
void cuv::apply_0ary_functor<float, cuv::dev_memory_space>(cuv::tensor<float, cuv::dev_memory_space, cuv::row_major>&, cuv::NullaryFunctor const&)' /tmp/ccxiUJdU.o: In functioncuv::reference<float, cuv::host_memory_space>::operator float() const': program.cpp:(.text._ZNK3cuv9referenceIfNS_17host_memory_spaceEEcvfEv[_ZNK3cuv9referenceIfNS_17host_memory_spaceEEcvfEv]+0x1f): undefined reference to
float cuv::detail::entrygetboost::enable_if_c<boost::is_convertible<long, unsigned int>::value, void>::type cuv::reference<unsigned int, cuv::host_memory_space>::operator=<long>(long const&)': program.cpp:(.text._ZN3cuv9referenceIjNS_17host_memory_spaceEEaSIlEEN5boost11enable_if_cIXsrNS4_14is_convertibleIT_jEE5valueEvE4typeERKS7_[_ZN3cuv9referenceIjNS_17host_memory_spaceEEaSIlEEN5boost11enable_if_cIXsrNS4_14is_convertibleIT_jEE5valueEvE4typeERKS7_]+0x2c): undefined reference to
void cuv::detail::entrysetvoid cuv::fill<float, cuv::host_memory_space, cuv::row_major, int>(cuv::tensor<float, cuv::host_memory_space, cuv::row_major>&, int const&)': program.cpp:(.text._ZN3cuv4fillIfNS_17host_memory_spaceENS_9row_majorEiEEvRNS_6tensorIT_T0_T1_EERKT2_[_ZN3cuv4fillIfNS_17host_memory_spaceENS_9row_majorEiEEvRNS_6tensorIT_T0_T1_EERKT2_]+0x39): undefined reference to
void cuv::apply_0ary_functor<float, cuv::host_memory_space>(cuv::tensor<float, cuv::host_memory_space, cuv::row_major>&, cuv::NullaryFunctor const&, float const&)' /tmp/ccxiUJdU.o: In functioncuv::reference<float, cuv::dev_memory_space>::operator float() const': program.cpp:(.text._ZNK3cuv9referenceIfNS_16dev_memory_spaceEEcvfEv[_ZNK3cuv9referenceIfNS_16dev_memory_spaceEEcvfEv]+0x1f): undefined reference to
float cuv::detail::entrygetbool cuv::tensor<float, cuv::dev_memory_space, cuv::row_major>::copy_memory<cuv::host_memory_space, cuv::row_major>(cuv::tensor<float, cuv::host_memory_space, cuv::row_major> const&, bool, CUstream_st_)': program.cpp:(.text._ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_16dev_memory_spaceENS_9row_majorEE11copy_memoryINS_17host_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x19f): undefined reference to
void cuv::detail::copybool cuv::tensor<float, cuv::host_memory_space, cuv::row_major>::copy_memory<cuv::dev_memory_space, cuv::row_major>(cuv::tensor<float, cuv::dev_memory_space, cuv::row_major> const&, bool, CUstream_st*)': program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x19f): undefined reference to
void cuv::detail::copyvoid cuv::detail::copy2d<float, float>(float*, float const*, unsigned long, unsigned long, unsigned long, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstream_st*)' program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x4b9): undefined reference to
cuv::cuvAssertFailed(char const_)' program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstreamst]+0x4dc): undefined reference to `cuv::cuvAssertFailed(char const)' program.cpp:(.text._ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st[_ZN3cuv6tensorIfNS_17host_memory_spaceENS_9row_majorEE11copy_memoryINS_16dev_memory_spaceES2_EEbRKNS0_IfT_T0_EEbP11CUstream_st]+0x54b): undefined reference tovoid cuv::detail::copy2d<float, float>(float*, float const*, unsigned long, unsigned long, unsigned long, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstream_st*)' /tmp/ccxiUJdU.o: In function
boost::enable_if_c<boost::is_convertible<unsigned long, int>::value, void>::type cuv::reference<int, cuv::host_memory_space>::operator=void cuv::detail::entry_set<int>(int*, unsigned long, int, cuv::host_memory_space)' /tmp/ccxiUJdU.o: In function
void cuv::memory<float, cuv::dev_memory_space>::copy2d_from<float, cuv::host_memoryspace>(float const, unsigned long, unsigned long, unsigned long, unsigned long, cuv::host_memory_space, CUstreamst)': program.cpp:(.text._ZN3cuv6memoryIfNS_16dev_memory_spaceEE11copy2d_fromIfNS_17host_memory_spaceEEEvPKT_mmmmT0_P11CUstream_st[_ZN3cuv6memoryIfNS_16dev_memory_spaceEE11copy2d_fromIfNS_17host_memory_spaceEEEvPKT_mmmmT0_P11CUstream_st]+0x51): undefined reference tovoid cuv::detail::copy2d<float, float>(float*, float const*, unsigned long, unsigned long, unsigned long, unsigned long, cuv::dev_memory_space, cuv::host_memory_space, CUstream_st*)' /tmp/ccxiUJdU.o: In function
void cuv::memory<float, cuv::host_memory_space>::copy2d_from<float, cuv::dev_memoryspace>(float const, unsigned long, unsigned long, unsigned long, unsigned long, cuv::dev_memory_space, CUstreamst)': program.cpp:(.text._ZN3cuv6memoryIfNS_17host_memory_spaceEE11copy2d_fromIfNS_16dev_memory_spaceEEEvPKT_mmmmT0_P11CUstream_st[_ZN3cuv6memoryIfNS_17host_memory_spaceEE11copy2d_fromIfNS_16dev_memory_spaceEEEvPKT_mmmmT0_P11CUstream_st]+0x51): undefined reference tovoid cuv::detail::copy2d<float, float>(float*, float const*, unsigned long, unsigned long, unsigned long, unsigned long, cuv::host_memory_space, cuv::dev_memory_space, CUstream_st*)' /tmp/ccxiUJdU.o: In function
void cuv::linear_memory<unsigned int, cuv::host_memory_space>::copy_from<unsigned int, cuv::host_memory_space>(cuv::linear_memory<unsigned int, cuv::host_memory_space> const&, CUstreamst) const': program.cpp:(.text._ZNK3cuv13linear_memoryIjNS_17host_memory_spaceEE9copy_fromIjS1_EEvRKNS0_IT_T0_EEP11CUstream_st[_ZNK3cuv13linear_memoryIjNS_17host_memory_spaceEE9copy_fromIjS1_EEvRKNS0_IT_T0_EEP11CUstreamst]+0x54): undefined reference to `void cuv::detail::copyvoid cuv::memory<float, cuv::dev_memory_space>::copy_from<float, cuv::host_memory_space>(float const*, unsigned long, cuv::host_memory_space, CUstream_st*)': program.cpp:(.text._ZN3cuv6memoryIfNS_16dev_memory_spaceEE9copy_fromIfNS_17host_memory_spaceEEEvPKT_mT0_P11CUstream_st[_ZN3cuv6memoryIfNS_16dev_memory_spaceEE9copy_fromIfNS_17host_memory_spaceEEEvPKT_mT0_P11CUstream_st]+0x38): undefined reference to
void cuv::detail::copyvoid cuv::memory<float, cuv::host_memory_space>::copy_from<float, cuv::dev_memory_space>(float const_, unsigned long, cuv::dev_memory_space, CUstream_st_)': program.cpp:(.text._ZN3cuv6memoryIfNS_17host_memory_spaceEE9copy_fromIfNS_16dev_memory_spaceEEEvPKT_mT0_P11CUstream_st[_ZN3cuv6memoryIfNS_17host_memory_spaceEE9copy_fromIfNS_16dev_memory_spaceEEEvPKT_mT0_P11CUstream_st]+0x38): undefined reference to
void cuv::detail::copyAny idea how to fix this? I'm thinking the python issue is missing a linking library to boost in the Makefile but I don't know how to fix that. I have no idea about the second error