baidu-research / persistent-rnn

Fast Recurrent Networks Library
Apache License 2.0
574 stars 87 forks source link

fatal error while building #16

Open ybkdemon opened 7 years ago

ybkdemon commented 7 years ago

When I tried to build project with scons mode=release install=true it gives the following error: scons: Reading SConscript files ... Building NVCC tool scons: warning: Two different environments were specified for target src/detail/matrix/copy_operations.os, but they appear to have the same action: $SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES File "/home/ybk/workspace/persistent-rnn/SConscript", line 45, in <module> scons: *** Multiple ways to build the same target were specified for: src/detail/matrix/copy_operations.os (from ['/home/ybk/workspace/persistent-rnn/src/detail/matrix/copy_operations.cu'] and from ['src/detail/matrix/copy_operations.cpp']) File "/home/ybk/workspace/persistent-rnn/SConscript", line 45, in <module>

So I tried another way to build it with source ubuntu-64-environment.sh sudo scons install=true it gives another error like: scons:Reading SConscript files ... Building NVCC tool Installing Persistent RNN Kernels scons: done reading SConscript files. scons: Building targets ... nvcc -o .debug_build/benchmark/benchmark-atomic-throughput.o -c -Xcompiler -g -Xcompiler -DPRNN_DEBUG -Xcompiler -Wall -Xcompiler -Werror -I /usr/local/cuda/include -I .debug_build/include -I include -gencode=arch=compute_30,code=sm_30 -G -std=c++11 "-D CUDA_ARCH_MAJOR=3" -Xcompiler=-Wno-unused-function -Xcompiler=-Wno-unused-private-field benchmark/benchmark-atomic-throughput.cu `In file included from /usr/local/cuda/include/cuda_runtime.h:112:0, from :0: /usr/local/cuda/include/common_functions.h:87:15: fatal error: new: No such file or directory

include `

compilation terminated. scons: *** [.debug_build/benchmark/benchmark-atomic-throughput.o] Error 1 scons: building terminated because of errors.

At first I thought it was the problem of clang++ to find c++ include files, so i write an example named new_feature to test whether clang++ can do #include <new> #include <iostream> #include <string> #include <new> class MyClass { public: std::string s ="Hello, world\n"; // Non-static data member initializer }; int main() { std::cout << MyClass().s; } Then I run it with: clang++ -std=c++11 -stdlib=libc++ -Werror -Weverything -Wno-disabled-macro-expansion -Wno-float-equal -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-global-constructors -Wno-exit-time-destructors -Wno-missing-prototypes -Wno-padded -Wno-old-style-cast -lc++ -lc++abi new_feature.cpp and it runs well and gives the output file. So I don't know why the project gives me an error like that when I try to build it...