TorontoDeepLearning / convnet

A GPU implementation of Convolutional Neural Nets in C++
BSD 2-Clause "Simplified" License
504 stars 229 forks source link

Unable to compile: undefined references #29

Closed thisiskofi closed 9 years ago

thisiskofi commented 9 years ago

I'm using g++ 4.6 and CUDA 5.5. I successfully build the libcudamat* files, but the main build fails to find several of the references within them:

g++46 -L/usr/gapps/brain/installs/opencv3beta/lib -L/usr/gapps/brain/installs/generic/lib -L/opt/cudatoolkit-5.5/lib64 -L/g/g13/boakye1/workspace/convnet/cudamat -I/usr/gapps/brain/installs/opencv3beta/include -I/usr/gapps/brain/installs/generic/include -I/opt/cudatoolkit-5.5/include -Isrc -Ideps -I/g/g13/uname/workspace/convnet/cudamat -DUSE_GEMM obj/convnet_config.pb.o obj/util.o obj/matrix.o obj/loss_functions.o obj/layer.o obj/image_iterators.o obj/video_iterators.o obj/datahandler.o obj/datawriter.o obj/optimizer.o obj/edge.o obj/edge_with_weight.o obj/avgpool_edge.o obj/conv_edge.o obj/conv_onetoone_edge.o obj/downsample_edge.o obj/fc_edge.o obj/local_edge.o obj/maxpool_edge.o obj/response_norm_edge.o obj/rgb_to_yuv_edge.o obj/upsample_edge.o obj/convnet.o obj/train_convnet.o obj/multigpu_convnet.o -o bin/train_convnet -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio -lhdf5 -ljpeg -lX11 -lpthread -lprotobuf -lcublas -ldl -lgomp -lcudamat -lcudart -Wl,-rpath=/g/g13/uname/workspace/convnet/cudamat -Wl,-rpath=/usr/gapps/brain/installs/opencv3beta/lib -Wl,-rpath=/usr/gapps/brain/installs/generic/lib -Wl,-rpath=/opt/cudatoolkit-5.5/lib64 -lcudamat_conv_gemm obj/matrix.o: In function Matrix::~Matrix()': matrix.cc:(.text+0x9): undefined reference todestroy_tex' obj/matrix.o: In function Matrix::WriteValue(int, int, float)': matrix.cc:(.text+0x5f5): undefined reference towrite_at' obj/matrix.o: In function Matrix::ReadValue(int, int)': matrix.cc:(.text+0x69a): undefined reference toread_from' obj/matrix.o: In function Matrix::CopyP2PAsync(Matrix&)': matrix.cc:(.text+0x744): undefined reference tocopy_on_device_p2p_async'

....and so on. I've tried with and without the GEMM kernels but am still unsuccessful. Also, I had to change "-Wno-unused-result" to "-Wno-unused-value" in the Makefile. Any idea what the issue might be?

thisiskofi commented 9 years ago

Well it turns out I had an older version of libcudamat.so in the library path :-/ Please disregard.