Software Archive
Read-only legacy content
17061 Discussões

cilk/cilk.h: no such file or directory

Ryan_M_3
Principiante
4.789 Visualizações

I thought I start a new thread since it doesn't pertain to the bug anymore. I am getting this: 

cute_rj@Cute:~/code/src/sort/build$ make
g++ -std=c++0x -O2 -DHAVE_OPENMP=1 -DHAVE_CILKPLUS=1 -fcilkplus -lcilkrts -I.. ../common/test_sort.cpp -ltbb -lgomp -lrt -o test_sort.x
../common/test_sort.cpp:9:23: fatal error: cilk/cilk.h: No such file or directory
#include <cilk/cilk.h>
^
compilation terminated.
make: *** [test_sort.x] Error 1

and yes my environment variables are set!

cute_rj@Cute:~/code/src/sort/build$ echo $PATH
/home/cute_rj/gcc-cilk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
cute_rj@Cute:~/code/src/sort/build$ echo $LIBRARY_PATH
/home/cute_rj/gcc-cilk/lib
cute_rj@Cute:~/code/src/sort/build$ echo $LD_LIBRARY_PATH
/home/cute_rj/gcc-cilk/lib

What the heck is going on? -.- lol

0 Kudos
17 Respostas
Barry_T_Intel
Funcionário
4.789 Visualizações

You have two options:

  1. You can add a -I (capital i) option to add to the list of directories that will be searched for include files. For example,
    g++ -std=c++0x -O2 -DHAVE_OPENMP=1 -DHAVE_CILKPLUS=1 -fcilkplus -lcilkrts -I.. \
    -I/home/cute_rj/gcc-cilk/include../common/test_sort.cpp -ltbb -lgomp -lrt -o test_sort.x

  2. You can define CPATH (or  CPLUS_INCLUDE_PATH) to specify the list of directories that will be searched for include files.  For example:
       export CPATH=/home/cute_rj/gcc-cilk/include:$CPATH

I don't believe that g++ will automatically add the directory to the include file search path when you use the -fcilkplus.

   - Barry

Ryan_M_3
Principiante
4.789 Visualizações

Didn't work but i did look at the snapshot provided by cilkplus.org and i see that i'm missing my libcilkrts directory -.- thats where the cilk.h file is

Ryan_M_3
Principiante
4.789 Visualizações

aha! found my problem. let me see if that fixes it

Barry_T_Intel
Funcionário
4.789 Visualizações

I hadn't realized that you were running from the snapshot at http://www.cilkplus.org/node/78#gcc-development-branch . If there is a problem there, of if I should update the "how to build with the Cilk Plus extension", please let me know.

   - Barry

Ryan_M_3
Principiante
4.789 Visualizações

i wasn't running from snapshot xD it was more of a guide sir

Lokesh_P_
Principiante
4.789 Visualizações

Hello guys

I am also having the same problem ' cilk/cilk.h' file not found. I set my environment variables correctly and checked twice. It all seems fine but libcilkrts is missing. Can anyone tell me how to add this libcilkrts runtime library to LLVM's Clang.

Thank you

Barry_T_Intel
Funcionário
4.789 Visualizações

You'll need to use the LLVM/Clang from the CilkPlus/LLVM project on GitHub.  See http://www.cilkplus.org/which-license#llvm-development .

     - Barry

Lokesh_P_
Principiante
4.789 Visualizações

The installation and the downloading gonna take too much time, isn't there any way to fix the libcilrts problem in LLVM's Clang.?

Barry_T_Intel
Funcionário
4.789 Visualizações

Cilk Plus is not in the mainline version of LLVM/Clang. The only version that supports Cilk Plus is the one from the CilkPlus/LLVM project.

   - Barry

Lokesh_P_
Principiante
4.789 Visualizações

Hi is there any easy way I could download these cilkplus files in a short time from http://gcc.gnu.org/svn/gcc/branches/cilkplus link?please suggest

 

Barry_T_Intel
Funcionário
4.789 Visualizações

The snapshots download in a reasonable time. Follow the links in http://www.cilkplus.org/build-gcc-cilkplus under "Using a snapshot". You'll get a compressed tarball of the latest build in the branch.

   - Barry

Lokesh_P_
Principiante
4.789 Visualizações

hey Barry,

Thank you for helping me. But at last stage where building Cilkplus application with GCC compilers requires explicitly enabling the Cilk Plus extension and linking with libcilkrts. For example:

$HOME/cilkplus-install/bin/gcc -fcilkplus -lcilkrts <OTHER_FLAGS> <SRC_FILES>
$HOME/cilkplus-install/bin/g++ -fcilkplus -lcilkrts <OTHER_FLAGS> <SRC_FILES>,What this says and what is the meaning of OTHER_FLAGS here!!!!!

One more thing I am doing my final year project based on this topic. Can you suggest me some problems in which I can show the parallelism.

Thank you.

Ryan_M_3
Principiante
4.789 Visualizações

Other flags are the flags you use when compiling your files. Such as -o and -g

Lokesh_P_
Principiante
4.789 Visualizações

Ok

Can you suggest me some standard problems on which I can work on and enjoy this concept.

Barry_T_Intel
Funcionário
4.789 Visualizações

You might want to look at the problems from "Structured Parallel Programming" by Michael McCool, James Reinders and Arch Robison. The sources are available at http://parallelbook.com/downloads .

You might also look at some of the examples at the http://cilkplus.org website.

   - Barry

Lokesh_P_
Principiante
4.789 Visualizações

Hey everyone I have a very silly doubt.

I am compiling my file using :

/home/aryan/cilkplus-install/bin/gcc -fcilkplus -lcilkrts -o test tes.c

the compilation done succesfully, and runs too. But what is the meaning of -fcilkplus and -lcilkrts here!!!!!!.

And to run a program I am using

CILK_NWORKER=1 time ./test. What this line says? Please reply.

Barry_T_Intel
Funcionário
4.789 Visualizações

-fcilkplus enables the Cilk Plus extension.

-lcilkrts tells the compiler to add libcilkrts.so to the list of libraries that are linked against.

The statement "CILK_NWORKER=1 time ./test." is doing 3 things:

  1. It's setting the environment variable CILK_NWORKERS to "1". This tells the Cilk runtime to only use one worker, so there's only 1 thread to do the work. If you don't do this, the Cilk runtime will use as many workers as your system has logical cores - Assuming you're using Linux, the number of cores in the /proc/cpuinfo file. The environment variable is only set for the duration of the command.
  2. It's timing the run of your application. When the application completes, you should see output specifying how long your application ran.  You can use the command "man time" to see the "time" man page which has all the details.
  3. It's running the application "test" from the current directory.

   - Barry

Responder