dmlc/cxxnet

Compile error: undefined reference to `google::LogMessageFatal::~LogMessageFatal()'

Opened this issue · 2 comments

OS: Ubuntu 15.04 64bit
Compiler gcc and g++ 4.8.4
Cuda 6.5
CuDNN 6.5 v2

build.sh can build normally.

build_ps.sh fails the following way:

First, there are lots of warnings like this:

ar: creating libgtest_main.a
...

In file included from ./google/protobuf/stubs/stringprintf.h:47:0,
                 from google/protobuf/stubs/stringprintf.cc:33:
google/protobuf/stubs/stringprintf.cc: In function 'std::string google::protobuf::StringPrintfVector(const char*, const std::vector<std::basic_string<char> >&)':
google/protobuf/stubs/stringprintf.cc:164:59: warning: typedef 'arg_count_mismatch' locally defined but not used [-Wunused-local-typedefs]
   GOOGLE_COMPILE_ASSERT(kStringPrintfVectorMaxArgs == 32, arg_count_mismatch);
                                                           ^
./google/protobuf/stubs/common.h:382:11: note: in definition of macro 'GOOGLE_COMPILE_ASSERT'
           msg[bool(expr) ? 1 : -1]
           ^

In the linking phase it cannot find lots of glog functions, then fails to link binary:

updater_gpu.o: In function `cxxnet::updater::NAGUpdater<mshadow::gpu, 1>::Update(long, mshadow::Tensor<mshadow::gpu, 2, float>)':
/home/fviktor/dev/cxxnet/src/updater/./nag_updater-inl.hpp:44: undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int)'
/home/fviktor/dev/cxxnet/src/updater/./nag_updater-inl.hpp:44: undefined reference to `google::LogMessage::stream()'
/home/fviktor/dev/cxxnet/src/updater/./nag_updater-inl.hpp:44: undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
collect2: error: ld returned 1 exit status
Makefile:143: recipe for target 'bin/cxxnet' failed
make: *** [bin/cxxnet] Error 1
make: *** Waiting for unfinished jobs....

Full log output:

Configuration:

$ diff make/config.mk config.mk 
13,14c13,14
< export CC = gcc
< export CXX = g++

---
> export CC = gcc-4.8
> export CXX = g++-4.8
22c22
< USE_CUDA_PATH = NONE

---
> USE_CUDA_PATH = /usr/lib/nvidia-cuda-toolkit
30c30
< USE_CUDNN = 0

---
> USE_CUDNN = 1
33c33
< USE_CUDNN_PATH = NONE

---
> USE_CUDNN_PATH = /home/fviktor/dev/cudnn-6.5-linux-x64-v2
43c43
< USE_BLAS = blas

---
> USE_BLAS = openblas
51,52c51,52
< USE_DIST_PS = 0
< PS_PATH = NONE

---
> USE_DIST_PS = 1
> PS_PATH = ./ps-lite
mli commented

This bug has been fixed, please have a pull

I pull the latest, bu also encounter this problem .

In file included from ./google/protobuf/descriptor.h:59:0,
                 from ./google/protobuf/compiler/java/java_doc_comment.h:38,
                 from google/protobuf/compiler/java/java_doc_comment.cc:35:
./google/protobuf/stubs/strutil.h: In function 'google::protobuf::int64 google::protobuf::strto64(const char*, char**, int)':
./google/protobuf/stubs/strutil.h:319:25: warning: typedef 'sizeof_int64_is_not_sizeof_long_long' locally defined but not used [-Wunused-local-typedefs]
                         sizeof_int64_is_not_sizeof_long_long);
                         ^
./google/protobuf/stubs/common.h:382:11: note: in definition of macro 'GOOGLE_COMPILE_ASSERT'
           msg[bool(expr) ? 1 : -1]
           ^
./google/protobuf/stubs/strutil.h: In function 'google::protobuf::uint64 google::protobuf::strtou64(const char*, char**, int)':
./google/protobuf/stubs/strutil.h:325:25: warning: typedef 'sizeof_uint64_is_not_sizeof_long_long' locally defined but not used [-Wunused-local-typedefs]
                         sizeof_uint64_is_not_sizeof_long_long);
                         ^
./google/protobuf/stubs/common.h:382:11: note: in definition of macro 'GOOGLE_COMPILE_ASSERT'
           msg[bool(expr) ? 1 : -1]
           ^
In file included from ./google/protobuf/compiler/java/java_field.h:39:0,
                 from ./google/protobuf/compiler/java/java_string_field.h:41,
                 from google/protobuf/compiler/java/java_string_field.cc:39:
./google/protobuf/stubs/strutil.h: In function 'google::protobuf::int64 google::protobuf::strto64(const char*, char**, int)':
./google/protobuf/stubs/strutil.h:319:25: warning: typedef 'sizeof_int64_is_not_sizeof_long_long' locally defined but not used [-Wunused-local-typedefs]
                         sizeof_int64_is_not_sizeof_long_long);
                         ^
./google/protobuf/stubs/common.h:382:11: note: in definition of macro 'GOOGLE_COMPILE_ASSERT'
           msg[bool(expr) ? 1 : -1]
           ^
./google/protobuf/stubs/strutil.h: In function 'google::protobuf::uint64 google::protobuf::strtou64(const char*, char**, int)':
./google/protobuf/stubs/strutil.h:325:25: warning: typedef 'sizeof_uint64_is_not_sizeof_long_long' locally defined but not used [-Wunused-local-typedefs]
                         sizeof_uint64_is_not_sizeof_long_long);
                         ^
./google/protobuf/stubs/common.h:382:11: note: in definition of macro 'GOOGLE_COMPILE_ASSERT'
           msg[bool(expr) ? 1 : -1]

many this kind error, i only copy a part