tticoin / LSTM-ER

Implementation of End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures in ACL2016.
Apache License 2.0
224 stars 73 forks source link

link error with boost1.57 #3

Open SeekPoint opened 7 years ago

SeekPoint commented 7 years ago

rzai@rzai00:~/prj/LSTM-ER/build$ make -j8 [ 3%] [ 6%] [ 10%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/cnn.cc.o [ 13%] [ 16%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/conv.cc.o Building CXX object cnn/cnn/CMakeFiles/cnn.dir/deep-lstm.cc.o Building CXX object cnn/cnn/CMakeFiles/cnn.dir/dict.cc.o [ 20%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/dim.cc.o [ 23%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/exec.cc.o Building CXX object cnn/cnn/CMakeFiles/cnn.dir/expr.cc.o [ 26%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/grad-check.cc.o [ 30%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/graph.cc.o [ 33%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/gru.cc.o /home/rzai/prj/LSTM-ER/cnn/cnn/grad-check.cc:16:9: warning: unused variable 'E' [-Wunused-variable] float E = as_scalar(g.forward()); ^ 1 warning generated. [ 36%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/init.cc.o [ 40%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/lstm.cc.o [ 43%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/model.cc.o [ 46%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/nodes.cc.o [ 50%] [ 53%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/nodes-common.cc.o Building CXX object cnn/cnn/CMakeFiles/cnn.dir/param-nodes.cc.o [ 56%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/rnn.cc.o [ 60%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/rnn-state-machine.cc.o [ 63%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/saxe-init.cc.o [ 66%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/shadow-params.cc.o [ 70%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/tensor.cc.o [ 73%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/training.cc.o [ 76%] Building CXX object cnn/cnn/CMakeFiles/cnn.dir/treelstm.cc.o Linking CXX static library libcnn.a [ 76%] Built target cnn [ 80%] [ 83%] [ 86%] [ 90%] [ 93%] [ 96%] Building CXX object relation/CMakeFiles/RelationExtraction.dir/RelationExtraction.cpp.o Building CXX object relation/CMakeFiles/RelationExtraction.dir/RelLstmModel.cpp.o Building CXX object relation/CMakeFiles/RelationExtraction.dir/Parameter.cpp.o Building CXX object relation/CMakeFiles/RelationExtraction.dir/Document.cpp.o Building CXX object relation/CMakeFiles/RelationExtraction.dir/Table.cpp.o Building CXX object relation/CMakeFiles/RelationExtraction.dir/cnn/deptreelstm.cc.o [100%] Building CXX object relation/CMakeFiles/RelationExtraction.dir/cnn/zlstm.cc.o Linking CXX executable RelationExtraction CMakeFiles/RelationExtraction.dir/RelationExtraction.cpp.o: In function path<boost::filesystem::directory_entry>': /opt/boost_1_57_0/include/boost/filesystem/path.hpp:140: undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' CMakeFiles/RelationExtraction.dir/Document.cpp.o: In function path<boost::filesystem::directory_entry>': /opt/boost_1_57_0/include/boost/filesystem/path.hpp:140: undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [relation/RelationExtraction] Error 1 make[1]: [relation/CMakeFiles/RelationExtraction.dir/all] Error 2 make: *** [all] Error 2 rzai@rzai00:~/prj/LSTM-ER/build$

SeekPoint commented 7 years ago

this is the way that I install boost1.57 on Ubuntu 14.04:

sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2 tar xvjf ./boost_1_57_0.tar.bz2 ./bootstrap.sh --prefix=/opt/boost_1_57_0 sudo ./b2 sudo ./b2 install

and cmake with:

rzai@rzai00:~/prj/LSTM-ER/build$ cmake .. -DEIGEN3_INCLUDE_DIR=eigen -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DBOOST_ROOT=/opt/boost_1_57_0 -DBOOST_INCLUDEDIR=/opt/boost_1_57_0/include -DBoost_LIBRARIES=/opt/boost_1_57_0/lib

tijiang13 commented 7 years ago

generally speaking, you need to make sure that different components are building with the exactly same compiler. That is, you are highly suggested to build boost from source, and most importantly, with clang.

changzhisun commented 7 years ago

@loveJasmine I also had the same issue, how do you fixed it ?

tanghy2016 commented 7 years ago

@loveJasmine hi, I have encountered the same problem, how can you solve?