我正在尝试在我的x86_64 RHEL机器(CentOS 6.4)上编译带有Intel CilkPlus(v4.9)模块的GCC编译器,用于编译面向并行多核平台的应用程序。
我正在关注GNU GCC Doc进行安装,这对于具有CilkPlus扩展的GCC非常相似。我特别注重提前关注前面提到的文档的Prerequisites和Configuration部分。
我确实使用this snapshot中指定的Instructions page下载了我需要的所有内容。下载也很成功,也没有tar。我确实将文件夹重命名为cilkplus-gcc
并将其放在我的$HOME
目录下。
我还创建了另一个目录:$HOME/b-gcc
,我打算运行configure
命令,然后运行make
命令。这将阻止安装到同一目录中(此过程不合需要的东西鼓励在不同的目录上构建所有内容)。
如文档中所述,我移动到$HOME/cilkplus-gcc/contrib
目录,以构建安装过程所需的三个最重要的库(即:编译GCC):
$HOME/cilkplus-gcc/contrib/gmp-4.3.2
目录。$HOME/cilkplus-gcc/contrib/mpfr-2.4.2
目录。$HOME/cilkplus-gcc/contrib/mpc-0.8.1
目录。我按照出现的顺序构建它们,因为MPFR取决于GMP,MPC取决于GMP和MPFR。我想将所需的ll文件放入$HOME/cilkplus-gcc
目录中,因此我指示这些库的安装程序将所有内容放入$HOME/cilkplus-gcc/contrib/tmp
目录中。所以:
sudo $HOME/cilkplus-gcc/contrib/gmp-4.3.2/configure --enable-shared --enable-static --prefix=$HOME/cilkplus-gcc/contrib/tmp
sudo $HOME/cilkplus-gcc/contrib/mpfr-2.4.2/configure --enable-shared --enable-static --prefix=$HOME/cilkplus-gcc/contrib/tmp --with-gmp=$HOME/cilkplus-gcc/contrib/tmp
sudo $HOME/cilkplus-gcc/contrib/mpc-0.8.1/configure --enable-shared --enable-static --prefix=$HOME/cilkplus-gcc/contrib/tmp --with-gmp=$HOME/cilkplus-gcc/contrib/tmp --with-mpfr=$HOME/cilkplus-gcc/contrib/tmp
直接结果是,我的$HOME/cilkplus-gcc/contrib/tmp
目录中填充了目录lib
,include
,share
和bin
,里面有这三个库。
忙于编译所有内容的时间。我进入$HOME/b-gcc
目录,然后从那里发出以下命令:
sudo $HOME/cilkplus-gcc/configure --prefix=$HOME/cilkplus-install --enable-languages="c,c++" --with-gmp=$HOME/cilkplus-gcc/contrib/tmp/ --with-mpfr=$HOME/cilkplus-gcc/contrib/tmp/ --with-mpc=$HOME/cilkplus-gcc/contrib/tmp/
配置顺利进行,并将内容创建到我当前的文件夹($HOME/b-gcc
)。是时候制作了,我发出了sudo make
。
两分钟,我收到此错误
g ++ -c -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -fno-common -DHAVE_CONFIG_H -I。 -Ic-family -I / home / andry / cilkplus-gcc / gcc -I / home / andry / cilkplus-gcc / gcc / c-family -I / home / andry / cilkplus-gcc / gcc /../ include - I / home / andry / cilkplus-gcc / gcc /../ libcpp / include -I / home / andry / cilkplus-gcc / contrib / tmp // include -I / home / andry / cilkplus-gcc / contrib / tmp / / include -I / home / andry / cilkplus-gcc / contrib / tmp // include -I / home / andry / cilkplus-gcc / gcc /../ libdecnumber -I / home / andry / cilkplus-gcc / gcc /。 ./libdecnumber/bid -I ../ libdecnumber -I / home / andry / cilkplus-gcc / gcc /../ libbacktrace /home/andry/cilkplus-gcc/gcc/c-family/cppspec.c -o c-family / cppspec.o g ++ -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -o cpp gcc.o ggc-none.o \ c-family / cppspec.o driver-i386.o libcommon-target.a \ libcommon.a ../libcpp/libcpp.a-liconv ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a /home/andry/b-gcc/./gcc/xgcc -B / home / andry / b-gcc /./ gcc / -dumpspecs> tmp-specs /home/andry/b-gcc/./gcc/xgcc:加载共享库时出错: libiconv.so.2:无法打开共享对象文件:没有这样的文件或 目录make 3: * [specs]错误127 make 3:离开目录
/home/andry/b-gcc/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory
/家/安德里/ B-GCC'制作1:* [stage1-bubble]错误2 make 1:离开目录 `/家庭/安德里/ B-GCC'
但我检查了/usr/local/lib
文件夹,我可以清楚地看到libiconv.so.2
在那里!所以我理解安装过程(即GCC编译本身)找不到库(明确引用,因为我可以看到-liconv
标志)。所以我删除$HOME/b-gcc
中的所有内容并发出修改后的configure
命令:
sudo $HOME/cilkplus-gcc/configure --prefix=$HOME/cilkplus-install --enable-languages="c,c++" --with-gmp=$HOME/cilkplus-gcc/contrib/tmp/ --with-mpfr=$HOME/cilkplus-gcc/contrib/tmp/ --with-mpc=$HOME/cilkplus-gcc/contrib/tmp/ --with-stage1-ldflags=-L/usr/local/lib
当我再次发出sudo make
时,不再遇到上一个错误,时间过去了。 5/6分钟后,我收到此错误:
检查x86_64-unknown-linux-gnu-ar ... ar检查 x86_64-unknown-linux-gnu-lipo ... lipo检查 x86_64-unknown-linux-gnu-nm ... /home/andry/b-gcc/./gcc/nm检查 for x86_64-unknown-linux-gnu-ranlib ... ranlib正在检查 x86_64-unknown-linux-gnu-strip ...剥离检查是否为ln -s 工作...是检查x86_64-unknown-linux-gnu-gcc ... /home/andry/b-gcc/./gcc/xgcc -B / home / andry / b-gcc /./ gcc / -B / home / andry / cilkplus-install / x86_64-unknown-linux-gnu / bin / -B / home / andry / cilkplus-install / x86_64-unknown-linux-gnu / lib / -isystem / home / andry / cilkplus -install / x86_64的未知-Linux的GNU /包括 -isystem / home / andry / cilkplus-install / x86_64-unknown-linux-gnu / sys-include
检查目标文件的后缀... configure:error:in/home/andry/b-gcc/x86_64-unknown-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile See
的config.log'更多细节。 make 2: * [configure-stage1-target-libgcc]错误1 make 2:离开目录/home/andry/b-gcc' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory
/家/安德里/ B-GCC'
嗯,非常奇怪的东西......所以我查了$HOME/b-gcc/x86_64-unknown-linux-gnu/libgcc/config.log
(要显示相关的摘录):
-isystem / home / andry / cilkplus-install / x86_64-unknown-linux-gnu / sys-include
-c -g -O2 conftest.c>& 5 /home/andry/b-gcc/./gcc/cc1:加载共享库时出错:libmpc.so.2:无法打开共享对象文件: 没有这样的文件或目录配置:3593:$? = 1配置:失败 程序是:| / * confdefs.h * / | #define PACKAGE_NAME" GNU C Runtime 文库" | #define PACKAGE_TARNAME" libgcc" | #define PACKAGE_VERSION " 1.0" | #define PACKAGE_STRING" GNU C运行时库1.0" | #限定 PACKAGE_BUGREPORT"" | #define PACKAGE_URL " http://www.gnu.org/software/libgcc/" | / *结束confdefs.h。 * / | | int | main()| {| | ; |返回0; |配置:3607:错误:in/home/andry/b-gcc/x86_64-unknown-linux-gnu/libgcc': configure:3610: error: cannot compute suffix of object files: cannot compile See
的config.log'了解更多详情。
说错误基本上如下:
/ home / andry / b-gcc /./ gcc / cc1:加载共享库时出错: libmpc.so.2:无法打开共享对象文件:没有这样的文件或目录
但我没有告诉它(在配置期间)去libmpc.so.2
搜索$HOME/cilkplus-gcc/contrib/tmp
???
我怎样才能完成任务?
我怎样才能解决这个问题?三江源
答案 0 :(得分:0)
**
我从http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/cilkplus-4_8-branch下载了cilkplus分支的快照,然后单击签入列表顶行的快照链接。服务器需要一些时间来获取源并构建压缩的tarfile。下载压缩的tarfile后,将其放入目录/ home:
后,使用以下命令将其解压缩cd /home
tar -xf gcc-3cfca5e.tar.gz
这会创建一个目录gcc-3cfca5e 下载最新的mpfr,mpc和gmp,并将这些tar包放入gcc-3fca5e目录。
cd /home/gcc-3cfca5e
tar -jxvf mpfr-3.1.2.tar.bz2
tar -xzvf mpc-1.0.1.tar.gz
tar -vxjf gmp-5.1.3.tar.bz2
ln -sf mpfr-3.1.2 mpfr
ln -sf mpc-1.0.1 mpc
ln -sf gmp-5.1.3 gmp
cd /home
mkdir gcc-cilk-obj
mkdir gcc-cilk
cd /home/gcc-cilk-obj
../gcc-3cfca5e/configure --prefix=/home/gcc-cilk --disable-multilib -enable-languages=c
make
make install
============ 在VirtualBox 4中运行Slackware当前的核心2 duo花了大约4个小时 (VBox设置>系统>处理器>检查启用PAE)Windows 7专业版。我的linux系统没有autogen,但无论如何都有效。