cilk 8503_x86_64 compilation error when linking with libgmpxx.so

cilk 8503_x86_64 compilation error when linking with libgmpxx.so

We tried to link libgmpxx.so to our .o file. However, we ran into this compiler errow while compling with cilk++

========================================================================
cilk++ Parroco.cilk -O2 -g -lcilkutil -lgmpxx -lgmp -o Parroco
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.so when searching for -lgmpxx
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.a when searching for -lgmpxx
/usr/bin/ld: cannot find -lgmpxx
collect2: ld returned 1 exit status
make: *** [Parroco] Error 1
========================================================================

I am currently using the version cilk_8503-x86_64.release.tar.gz on Linux. If I switch to the version cilk_8269-x86_64.eval-2009-07-10.tar.gz, I successfully compiled the program without any error.

Is there something I do not get to link with a .so file?

Thanks in advance,

Liyun

publicaciones de 5 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Hi Liyun,

The "skipping incompatible..." messages probably indicate that those libraries are 32-bit. You can verify this with:

> file /usr/local/lib/libgmpxx.so

Not being able to find libgmpxx.so is a strange bug, though. I don't know how that might have happened. However, you can see where the older cilk++ found the library using "ldd" like:

> ldd ./Parroco

That will give you a list of shared libraries that were linked in and where it found them when it linked. Once you know where the correct version of libgmpxx.so lives, try compiling again with the newer cilk++:

> cilk++ Parroco.cilk -O2 -g -L -lcilkutil -lgmpxx -lgmp -o Parroco

Thanks William!

I have tried your suggestions and now I can compile the program without any errors. However, my labmate encountered the same problem and he is still not able to resolve it.

The following may provide more information about the error.
============================================================
cilk++ --version
-------------------------------------------------
cilk++ (GCC) 4.2.4 (Cilk Arts build 8269)
-------------------------------------------------
cilk++ Parroco.cilk -O2 -g -lcilkutil -lgmpxx -lgmp -o Parroco
-------------------------------------------------
(successful)
-------------------------------------------------
ldd Parroco
-------------------------------------------------
......
libgmpxx.so.4 => /usr/local/lib/libgmpxx.so.4 (0x00007f0de4cfd000)
libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x00007f0de4a8e000)
......
-------------------------------------------------
file /usr/local/lib/libgmpxx.so.4
-------------------------------------------------
/usr/local/lib/libgmpxx.so.4: symbolic link to `libgmpxx.so.4.2.1'
-------------------------------------------------
file /usr/local/lib/libgmpxx.so.4.2.1
-------------------------------------------------
/usr/local/lib/libgmpxx.so.4.2.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), not stripped
-------------------------------------------------
cilk++ Parroco.cilk -O2 -g -lcilkutil -L/usr/local/lib -lgmpxx -lgmp -o Parroco
-------------------------------------------------
(successful)
-------------------------------------------------
cilk++ --version
=================================================
cilk++ (GCC) 4.2.4 (Cilk Arts build 8503)
-------------------------------------------------
cilk++ Parroco.cilk -O2 -g -lcilkutil -lgmpxx -lgmp -o Parroco
-------------------------------------------------
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.so when searching for -lgmpxx
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.a when searching for -lgmpxx
/usr/bin/ld: cannot find -lgmpxx
collect2: ld returned 1 exit status
make: *** [Parroco] Error 1
-------------------------------------------------
cilk++ Parroco.cilk -O2 -g -lcilkutil -L/usr/local/lib -lgmpxx -lgmp -o Parroco
-------------------------------------------------
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.so when searching for -lgmpxx
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.a when searching for -lgmpxx
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.so when searching for -lgmpxx
/usr/bin/ld: skipping incompatible /usr/local/lib/libgmpxx.a when searching for -lgmpxx
/usr/bin/ld: cannot find -lgmpxx
collect2: ld returned 1 exit status
-------------------------------------------------

I recently reinstalled my computer though. It may happen that some enviromental variables have been set correctly to resolve the problem. It seems to me that libgmpxx.so is 64-bit and the compiler can find it except regarding it as incompatible file.

Thanks,

Liyun

Hi Liyun,

I'm glad it worked for you. That's strange, though, that it isn't working for your labmate...

You may be right that it is significant that your system is more recent. I wonder if the libraries on his system are outdated. Can he try updating them or reinstalling them?

-wml

Thanks William,

He reinstalled gmp but it still does not work together with cilk++ 8503 version. For now, he just switches to version 8269 when linking with gmp. It works fine now,

Liyun

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya