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

Linker not working? #6754

Open
nehasrikn opened this issue Apr 25, 2019 · 2 comments
Open

Linker not working? #6754

nehasrikn opened this issue Apr 25, 2019 · 2 comments

Comments

@nehasrikn
Copy link

nehasrikn commented Apr 25, 2019

Hi! We're in the process of running make pycaffe, and when we run it, we run into the following error:

LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lglog
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lgflags
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lprotobuf
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lboost_system
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lboost_filesystem
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lleveldb
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lsnappy
/opt/apps/gcc/5.4.0/bin/ld: cannot find -llmdb
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lopencv_core
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lopencv_highgui
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lopencv_imgproc
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lboost_thread
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lcudnn
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lnccl
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lboost_python
/opt/apps/gcc/5.4.0/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1

We're using an anaconda environment to run everything, so we're are not sure why we're running into this error! Here's our Makefile.config:


# Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
#       You should not set this flag if you will be reading LMDBs with any
#       possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /opt/apps/cuda/9.2/
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
search hit TOP, continuing at BOTTOM
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
USE_NCCL := 1

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @ 

Any insight is appreciated!

@400lbhacker
Copy link

Hello, I have never used cuda or cuddn, so bear with me here. You have the bin directory right but no lib directory. you need to add more to this comment section I beleive

CUDA directory contains bin/ and lib/ directories that we need.

CUDA_DIR := /opt/apps/cuda/9.2/

On Ubuntu 14.04, if cuda tools are installed via

"sudo apt-get install nvidia-cuda-toolkit" then use this instead:

CUDA_DIR := /usr

i may be wrong. are you installing this on ubuntu?

@400lbhacker
Copy link

sorry the qoute came out sloppy im new to github

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

2 participants