Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Build Issue on Ubuntu 12.04 #14

Closed
Jiansen opened this Issue · 2 comments

2 participants

Jiansen nagadomi
Jiansen

Hi,

I have a trouble to install cxxnet on my PC with Intel i5 on Ubuntu 12.04
-- libevent-pthreads: 2.0.21-stable-1ubuntu1
-- gcc: (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2

The following is the error message

$ sudo make blas=1
g++ -Wall -g -O3 -msse3 -Wno-unknown-pragmas -funroll-loops -I./mshadow/ -DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CBLAS=1  -o bin/cxxnet cxxnet/cxxnet_main.cpp cxxnet_data.o cxxnet_nnet_cpu.o cxxnet_nnet_gpu.o -lm -lcudart -lcublas -lcurand -lz `pkg-config --libs opencv` -lblas
/usr/bin/ld: cxxnet_data.o: undefined reference to symbol 'sem_post@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [bin/cxxnet] Error 1

In the Kaggle Forum Bing suggests it might related to pthread, but as I use blas=1, and

ifeq ($(blas),1)
 LDFLAGS= -lm -lcudart -lcublas -lcurand -lz `pkg-config --libs opencv` -lblas
 CFLAGS+= -DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CBLAS=1
else
 LDFLAGS= -lm -lcudart -lcublas -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5 -lpthread -lcurand -lz `pkg-config --libs opencv`
endif

It seems that pthread is not used in my build.

Do you have further sugggestions?

Cheers

nagadomi

seems to be missing -pthread

ifeq ($(blas),1)
 LDFLAGS= -lm -lcudart -lcublas -lcurand -lz `pkg-config --libs opencv` -lblas
 CFLAGS+= -DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CBLAS=1 -pthread
Jiansen

Thanks, it works.

Similarly, we need to replace the followings in tools/Makefile

export CFLAGS = -Wall -O3 -msse3 -Wno-unknown-pragmas -funroll-loops -I../mshadow/ -I..
export LDFLAGS=
export NVCCFLAGS = -g -O3 -ccbin $(CXX)

with

export CFLAGS = -Wall -g -O3 -msse3 -Wno-unknown-pragmas -funroll-loops -I./mshadow/

ifeq ($(blas),1)
 LDFLAGS= -lm -lcudart -lcublas -lcurand -lz `pkg-config --libs opencv` -lblas
 CFLAGS+= -DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CBLAS=1 -pthread
else
 LDFLAGS= -lm -lcudart -lcublas -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5 -lpthread -lcurand -lz `pkg-config --libs opencv`
endif

export NVCCFLAGS = --use_fast_math -g -O3 -ccbin $(CXX)

Cheers

Jiansen Jiansen closed this
Jiansen Jiansen referenced this issue
Closed

Fix Issue 14 #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.