0
votes

I am trying to compile, on my x86_64 RHEL machine (CentOS 6.4), the GCC compiler with Intel CilkPlus (v4.9) module for compiling applications targeting parallel multicore platforms.

I am following GNU GCC Doc for installation which is very very similar for the GCC with CilkPlus extension. I was particularly focused on providing good attention to the Prerequisites and Configuration sections of the before-mentioned doc.

1) Download

I did download everything I needed using this snapshot as specified in the Instructions page. Download was successful and un-tar as well. I did rename the folder as cilkplus-gcc and put it under my $HOME directory.

I also created another directory: $HOME/b-gcc from where I intend to run the configure command and then make commands. This will prevent from installing into the same directory (something undesirable for this procedure which encourages building everything on a different directory).

2) Initial configuration

As specified in the documentation, I moved into the $HOME/cilkplus-gcc/contrib directory in order to build the three most important libraries needed by the installation process (that is: compiling GCC):

  • GMP: located into the $HOME/cilkplus-gcc/contrib/gmp-4.3.2 directory.
  • MPFR: located into the $HOME/cilkplus-gcc/contrib/mpfr-2.4.2 directory.
  • MPC: located into the $HOME/cilkplus-gcc/contrib/mpc-0.8.1 directory.

I build them in the order of appearance as MPFR depends on GMP and MPC depends on both GMP and MPFR. I wanted to place ll needed files into the $HOME/cilkplus-gcc directory so I instructed the installers of these libraries to place everything into the $HOME/cilkplus-gcc/contrib/tmp directory. So:

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

As direct result, my $HOME/cilkplus-gcc/contrib/tmp directory is filled with directories lib, include, share and bin with those three libs inside.

3) Installation

Time to get busy compiling everything. I move into the $HOME/b-gcc directory and from there I issue the following command:

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/

The configuration goes smoothly and creates make stuff into my current folder ($HOME/b-gcc). Time to make and I issue: sudo make.

Two minutes and I get this error

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: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory make3: * [specs] Error 127 make3: Leaving directory /home/andry/b-gcc/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory/home/andry/b-gcc' make1: * [stage1-bubble] Error 2 make1: Leaving directory `/home/andry/b-gcc'

But I check my /usr/local/lib folder and I can clearly see that libiconv.so.2 is there! So I understand the installation procedure (that is GCC compiling itself) cannot find the library (clearly referenced as I can see the -liconv flag). So I delete everything in $HOME/b-gcc and issue a modified configure command:

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

As I issue sudo make again, the previous error is not encountered anymore and time passes. After 5/6 minutes I get this error:

checking for x86_64-unknown-linux-gnu-ar... ar checking for x86_64-unknown-linux-gnu-lipo... lipo checking for x86_64-unknown-linux-gnu-nm... /home/andry/b-gcc/./gcc/nm checking for x86_64-unknown-linux-gnu-ranlib... ranlib checking for x86_64-unknown-linux-gnu-strip... strip checking whether ln -s works... yes checking for 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-unknown-linux-gnu/include -isystem /home/andry/cilkplus-install/x86_64-unknown-linux-gnu/sys-include
checking for suffix of object files... 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' for more details. make2: * [configure-stage1-target-libgcc] Error 1 make2: Leaving directory /home/andry/b-gcc' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory/home/andry/b-gcc'

Well, quite a strange stuff... So I checked $HOME/b-gcc/x86_64-unknown-linux-gnu/libgcc/config.log (gonna show the relevant excerpt):

-isystem /home/andry/cilkplus-install/x86_64-unknown-linux-gnu/sys-include
-c -g -O2 conftest.c >&5 /home/andry/b-gcc/./gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory configure:3593: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3607: error: in /home/andry/b-gcc/x86_64-unknown-linux-gnu/libgcc': configure:3610: error: cannot compute suffix of object files: cannot compile Seeconfig.log' for more details.

Saying that the error is basically the following:

/home/andry/b-gcc/./gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory

But didn't I already told it (during configure) to go search for libmpc.so.2 into $HOME/cilkplus-gcc/contrib/tmp???

How can I get things done?

How can I get through this? Thankyou

1

1 Answers

0
votes

**

I downloaded the snapshot of the cilkplus branch from http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/cilkplus-4_8-branch and click the snapshot link on the top line of the list of checkins. It will take a few moments for the server to fetch the sources and build a compressed tarfile. Once the compressed tarfile has downloaded, unpack it using the following commands after placing it in directory /home :

cd /home
tar -xf gcc-3cfca5e.tar.gz

This creates a directory gcc-3cfca5e Download latest mpfr, mpc and gmp and place these tarballs into the gcc-3fca5e directory.

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

============ It took about 4 hours to make on a core 2 duo running Slackware current inside VirtualBox 4 (VBox settings>system>processor> check enable PAE) Windows 7 professional. My linux system did not have autogen but it worked anyway.