How to link cilk++

How to link cilk++

Imagen de BradleyKuszmaul

How do I use my standard linker to do the final link for a mixed
C++/Cilk program?

Here I have
foo.o compiled from foo.cilk by cilk++
bar.o compiled from bar.c++ (with a call to cilk::run) by cilk++
If I do the final link with cilk++ it works.

If I do the final link with g++ it doesn't. I tried
$ /home/bradley/cilkarts/8503/cilk/bin/c++ foo2.o bar2.o -o broken-lpthread-L/home/bradley/cilkarts/8503/cilk/lib64 -lcilkrts-Wl,-rpath=/home/bradley/cilkarts/8503/cilk/lib64

$ ./broken

and get a segfault.

What's the magic to linking with cilk? I need to know so that I can link with., e.g., icc.

-Bradley

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de John Carr (Intel)

Try adding -Wl,-z,now to the link command. The g++-based driver does this automatically when it links Cilk++ code. The dynamic loader feels free to use stack space to resolve lazy binding. In Cilk++ code there is no stack. -z now forces relocations to be resolved before entering main().

Inicie sesión para dejar un comentario.