make cdec出错

时间:2018-04-06 09:19:08

标签: makefile

我正在尝试实现JAMR的文本生成器。它重定向我安装cdec。我按照this教程安装了cdec。 BUT

我安装了gcc-4.8(我有一个更好的版本5.x但我认为4.8是必要的)。所以我使用this安装了gcc-4.8。我使用this~/prefix/sw)构建了Boost,我使用了boost_1_58因为它是最新的。一切都很好。

回到教程,而不是cd ~/prefix/sw我去了我的cdec所在的cd jamr/tools/cdecautoreconf -ifv./configure --prefix=/home/student/prefix到目前为止一直很好(我只需评论包含boost_major_version的第216行并撰写boost_major_version="158")。但是一段时间后我做make

libtool: link: g++ -std=gnu++11 -fPIC -g -O3 /usr/lib /usr/lib -o reconstruct_weights reconstruct_weights.o  -L/usr/lib libutils.a -ldl -lrt -lboost_program_options -lboost_regex -lboost_serialization -lboost_system -lboost_filesystem -lz -lbz2
/usr/bin/ld: cannot find /usr/lib: File format not recognized
/usr/bin/ld: cannot find /usr/lib: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:836: recipe for target 'reconstruct_weights' failed
make[2]: *** [reconstruct_weights] Error 1
make[2]: Leaving directory '/home/student/ATS/jamr/tools/cdec-2014-10-12/utils'
Makefile:480: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/student/ATS/jamr/tools/cdec-2014-10-12'
Makefile:410: recipe for target 'all' failed
make: *** [all] Error 2

我尝试了sudo make,简单./configuremake clean;make。没有帮助。 This是make file。

1 个答案:

答案 0 :(得分:0)

当您位于cdec文件夹中并尝试按照说明在其中执行命令时,我们看到您得到了collect2 error: error: ld returned 1 exit status。在cdec文件夹中,我最初执行命令:

gcc -std=gnu99 -Wall -Werror -g array_product.c -o array_product -I../../ZDK -L../../ZDK -I../../TestLib04 -L../../TestLib04 -ltestlib04 -lzdk -lncurses -lm

此命令后,错误已解决,我进入文件并显示:

> First, you need all the build dependencies, and the fastest way to install them all is this command, which installs not only the compiler but the additional boost libraries and Flex that you'll need. sudo apt-get install build-essential libboost-all-dev cmake flex

> Secondly, create a directory and go into it (you said ~/prefix/sw in your comments).

> Thirdly, git clone https://github.com/redpony/cdec.git

> Fourthly, you probably did not read the README page on the GitHub repository which explains what commands to run to make the software build. It lists these as the build steps, after cd-ing into the newly created cdec folder.