Problem with installation

Problem with installation

Hello allIm having some troubles with the installation of cilk or i might missing something.I have installed gcc-4.7 and downloaded the tar.gz file.I installed the tar.gz file under /usr/local/ and now there is a new directory cilk.I set the PATH enviroment variable but i still cant compile anything.I tried with the examples but always gives a bunch of errors.The thing is that when i change the PATH to point to /cilk i cant use g++ either.Im typing g++ -v and gives me back "gcc version 4.2.4 (Cilk Arts Build 8503)"Any ideas what i have done wrong or if there is something i didnt do at allThanks

21 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Giannhssdra,
Where did you install this g++? "gcc version 4.2.4 (Cilk Arts Build 8503)".

From what you tell me, it looks like the Cilk Arts Build 8503g++overwrote the original G++ installed in your machine.


Balaji V. Iyer.

Thanks for the reply.If i set the PATH variable then the cilk directory is read first so it change the gcc(i dont know if this is correct).If i remove the cilk directory from the PATH then the gcc -v is gcc-4.7And it works correct.But when im trying to compile with cilk++ then not only i cant compile cilk files but not even .cpp files with g++.I installed gcc-4.7 using these 3 commands

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7
And cilk using the instructions from the programmers guide.pdf

Do i need to install or do something else?


Hello Giannhssdra,
Are you trying to use Cilk++? If so, then install them in some directory (e.g. /opt/cilk). After that call the whole path for it without setting the path:

e.g. let's say you have thecilk++ g++ in /opt/cilk/bin/g++ and you want to compile, then type the following into the command prompt:

/opt/cilk/bin/g++ test.c

This way, you don't have to set the path variable.


Balaji V. Iyer.

I deleted the file from /usr/local and installed it under /opt/ as you said.But is still gives the same errors.I now can use the gcc-4.7 but when i use the /opt/cilk/bin/g++ or /opt/cilk/bin/cilk++ it gives errors.It gives errors from standard files/usr/include/string.h:57: error: expected constructor, destructor, or type conversion before extern/usr/include/string.h:65: error: expected constructor, destructor, or type conversion before extern/usr/include/string.h:57: error: expected constructor, destructor, or type conversion before extern/usr/include/string.h:65: error: expected constructor, destructor, or type conversion before externI compile with this command /opt/cilk/bin/cilk++ main.cilk -o testbut even if use the makefiles from the examples with make it still gives the same errors

hello againDo i need to install anything else?The only thing i did was to download the tar.gz file from installed it.I have also installed gcc-4.7.What else do i need?Thanks

Let's back up a bit. Exactly what are you intending to install?

Cilk++ isan extension of C++ done by Cilk Arts, which was acquired by Intel almost 3 years ago. Cilk++ is unsupported, and most of the developers who worked on it are no longer with Intel.

Intel Cilk Plus is an extension of C and C++ to suport Cilk. It was originally shipped with V12.0 of Intel's C/C++ compiler and is available for Windows, Linux and MacOS. It's also been merged into the "cilkplus" branch of gcc 4.7 and 4.8.

Let me emphasize again that Cilk++ is unsupported.It is purely "as-is" software.

- Barry

Hello againI was a little bit confused but now im lost.The only downloads i found was intels gcc branch also this installation guide for the gcc branch i dont have 64-bit os).Which one are you saying is unsupported and which one is the correct to install.You asked me what am i intending to install.I just have a project which i have to do using cilk.I have no idea about cilk yet becide the tutorials and pdfs i found on the net.I just wanted to install it first and start using it from terminal.I dont know if its better through terminal or an ide.But first i need some help with the installation.Thnaks

Hello Giannhssdra,
From what you tell me, I believe you are using Intel Cilk Plus which is the current one.

First of all, the following 3 lines that you used a while backis NOT the correct way to install the Cilk Plus GCC.

I installed gcc-4.7 using these 3 commands

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install gcc-4.7

Here is a tutorial that I wrote a while back to install Cilk plus GCC. It is a little different from the one that you found on the web. This one seem to work for several people we gave to.

Before you start this tutorial, please bring your machine state to the way it was before you started whole Cilk work (e.g. remove the usr/local/cilk directory, reinstall the original GCC that your machine came up with, undo anyPATH settings you may have done,etc.)

Please let me know if you have further questions.


How to Download, Build and Install Cilkplus GCC on Linux.


You will need the following packages to build GCC:

Source packages. Note that the links below are for the versions needed to build the initial release of the cilkplus GCC branch. Newer versions may need to be used with future versions of the compiler.

GNU Multiprecision Arithmetic Library (GMP) for arbitrary precision arithmetic: ( Download the latest version and unpack the compressed tar file and move the directory to $HOME/gmp .

GNU MPFR Library multiple-precision floating-point computations with correct rounding: ( Unpack the compressed tar file and move the directory to $HOME/mpfr .

GNU MPC Library for arithmetic using complex numbers: ( Download the latest version and unpack the compressed tar file. Move the unpacked directory to $HOME/mpc

In addition to the sources above, you will also need the following tools installed in your machine

flex or lex - Lexical analyzer

bison or Yacc - Parser generator

Make utility (example gmake) to automatically create executables

GCC/G++ Compiler (version 4.4 or above) with the appropriate binary utilities

GNU AutoGen utility - Automatic program generator

SVN or GIT source control packages

Diskspace: You will need approximately 2 GB of diskspace to hold the sources, executables and libraries. Along with this, you will also require ~3 GB of diskspace to hold the temporary files.

Time: This process is a bit time-consuming and so please have ~4-5 hours in-hand to complete the process. The most time consuming of all is step 6. This step is not interactive and so you can let this step run overnight if you wish.

Building the GCC C and C++ compilers

1.Cilkplus GCC is available as a development branch in the GCC source-tree. The development branch is called "cilkplus." They can be downloaded using GIT or SVN source-control systems. If you are a beginner to source-control, I would recommend you use SVN. I am making an assumption that you are currently in your $HOME directory.

To use SVN, please type the following in your command in your command prompt:

svn co cilkplus-gcc

If you are choosing to use GIT, please type the following commands in your command prompt. Please note that this step can take anywhere from 10-30 minutes.

git clone cilkplus-gcc
cd cilkplus-gcc
git checkout -b my_cilkplus_branch origin/cilkplus
cd ..

2.After step 1, the sources should be saved in a directory called $HOME/cilkplus-gcc. The final compiler executables and the appropriate libraries will be stored in $HOME/cilkplus-install. We will create the cilkplus-install directory later.

3.Move/Copy the gmp, mpc and mpfr directories from $HOME/ to the $HOME/cilkplus-gcc/ directory. This can be done using the following setof commands:

cp -r $HOME/mpc $HOME/cilkplus-gcc/.
cp -r$HOME/mpfr $HOME/cilkplus-gcc/.
cp -r $HOME/gmp $HOME/cilkplus-gcc/.

4.Create a new directory called "b-gcc" under $HOME/ . This directory will hold all the object files. You may delete this directory after the successful completion of all the steps in this tutorial.

5.Go into the b-gcc directory and type the following command:

$HOME/cilkplus-gcc/configure --prefix=$HOME/cilkplus-install --enable-languages="c,c++"

The above command will configure the compiler makefiles to set the install directory to be $HOME/cilkplus-install and build just the C and C++ compilers.

6.Type make in the same directory. This command will build the compiler sources. This will probably take quite a while.

7.Type make install. This command will copy the compiler executables and the required libraries to the install directory.

The compilers (g++ and gcc) should now be in the $HOME/cilkplus-install/bin directory.

Using the GCC compilers with the Intel Cilk Plus extensions

To use the GCC Cilk Plus compiler, it needs to be in your PATH and the libraries need to be in your LIBRARY_PATH and LD_LIBRARY_PATH. The following commands can be used (in a BASH Shell) to accomplish this:

export PATH=$HOME/cilkplus-install/bin:$PATH

export LD_LIBRARY_PATH=$HOME/cilkplus-install/lib

export LIBRARY_PATH=$HOME/cilkplus-install/lib

Building a Cilk Plus application with the GCC compilers requires explicitly linking with libcilkrts, libdl. For example:

$HOME/cilkplus-install/bin/gcc -ldl -lcilkrts

$HOME/cilkplus-install/bin/g++ -ldl -lcilkrts



Balaji V. Iyer.

Thanks for the answerI'll give a try and let you know.One question.I unistalled the gcc-4.7.Should i install it again before i start with the cilk or just continue with the gcc-4.6?Thanks

No, just try with whatever compiler that came with your linux box...


Balaji V. Iyer.

Sorry for this but it doesnt leave empty lines.
I did every step you said but i got an error when i typed make.The configuration file was successful but it gave me this when i typed make./opt/cilkplus-gcc/gcc/cp/cilk.c: In function for_local_cb:/opt/cilkplus-gcc/gcc/cp/cilk.c:292:13: warning: cast discards __attribute__((const)) qualifier from pointer target type [-Wcast-qual]/opt/cilkplus-gcc/gcc/cp/cilk.c: In function wrapper_local_cb:/opt/cilkplus-gcc/gcc/cp/cilk.c:337:15: warning: cast discards __attribute__((const)) qualifier from pointer target type [-Wcast-qual]/opt/cilkplus-gcc/gcc/cp/cilk.c: In function callable:/opt/cilkplus-gcc/gcc/cp/cilk.c:929:16: error: LOOKUP_COMPLAIN undeclared (first use in this function)/opt/cilkplus-gcc/gcc/cp/cilk.c:929:16: note: each undeclared identifier is reported only once for each function it appears inmake[3]: *** [cp/cilk.o] Error 1make[3]: Leaving directory `/opt/b-gcc/gcc'make[2]: *** [all-stage1-gcc] Error 2make[2]: Leaving directory `/opt/b-gcc'make[1]: *** [stage1-bubble] Error 2make[1]: Leaving directory `/opt/b-gcc'make: *** [all] Error 2--------------------------------------------------------And this in the configuration file which seems strange*** This configuration is not supported in the following subdirectories: gnattools target-libada target-libgfortran target-libgo target-libffi target-zlib target-libjava target-libobjc target-boehm-gc (Any other directories should still work fine.)checking for default BUILD_CONFIG... bootstrap-debug*** removing build-i686-pc-linux-gnu/libiberty/Makefile to force reconfigure*** removing build-i686-pc-linux-gnu/fixincludes/Makefile to force reconfigure*** removing intl/Makefile to force reconfigure*** removing libiberty/Makefile to force reconfigure*** removing zlib/Makefile to force reconfigure*** removing libcpp/Makefile to force reconfigure*** removing libdecnumber/Makefile to force reconfigure*** removing gcc/Makefile to force reconfigure*** removing lto-plugin/Makefile to force reconfigure

Please try it again. I have fixed this bug.

If you are using SVN, just go into the cilkplus-gcc directory and do "svn update"

Then just type "make" and continue with the rest of the steps :-).


-Balaji V. Iyer.

Thanks for your timeI did what you said with svn.It compiled a little longer than previous but it gave me this error nowconfigure: error: cannot compute suffix of object files: cannot compileSee `config.log' for more details.configure: error: cannot compute suffix of object files: cannot compileSee `config.log' for more details.You know what this is?

what does the config.log say?

-Balaji V. Iyer.

I have no idea what to tell from this file so take a copy

First of all, never put your sources in places like /opt or /usr or in any of those system directory. This almost always leads to disasters. This error probably has to do with permission issues...

Can you copy the source directory to your $HOME directoryand try to build it from there?

Also, where are you putting your build directory (b-gcc directory)? It definitely should not be in /opt. Please try and put it in $HOME if possible.


Balaji V. Iyer.

HelloStill nothing .It stops in the same point giving the same error.configure: error: in `/home/subuntu/b-gcc/i686-pc-linux-gnu/libgcc':configure: error: cannot compute suffix of object files: cannot compileI moved everything in /home/user/ and i reinstalled gmp,mpfr and mpc in this directoryI used this command for the configurationsudo ../cilkplus-gcc/configure --prefix=/home/subuntu/cilkplus-install --with-gmp=/home/subuntu/gmp/ --with-mpfr=/home/subuntu/mpfr/ --with-mpc=/home/subuntu/mpc/ --enable-languages=c,c++And i tried the whole procedure with the source from svn and from a tar file which i downloadedIm using these versionsgmp-4.3.2mpfr-2.4.2mpc-0.8.1This the config.log from the diractory givving the error

HelloI finally did it.I just used these commands before type make

  1. exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gmp-4.3.2/lib:/opt/mpfr-2.4.2/lib:/opt/mpc-0.8.1/lib
  2. exportC_INCLUDE_PATH=/usr/include/i386-linux-gnu&&exportCPLUS_INCLUDE_PATH=$C_INCLUDE_PATH&&exportOBJC_INCLUDE_PATH=$C_INCLUDE_PATH
  3. exportLIBRARY_PATH=/usr/lib/i386-linux-gnu

Thanks a lot for your time

Dear Balaji V. Iyer.Do you happen to have such a tutorial like "How to Download, Build and Install Cilkplus GCC on Linux." for Mac to?Greetings

Hello Madawael,
At present, Cilkplus GCC is only supported on Linux.


Balaji V. Iyer.

Leave a Comment

Please sign in to add a comment. Not a member? Join today