ld: cannot find -lspike_adapt_de

ld: cannot find -lspike_adapt_de

Hi,

I have just downloaded Spike 1.0 and encounted a link error when making the C examples on an AMD opteron and Linux platform. The spike library is automatically included in the compile command line:

cc cc -o _results/toeplitz toeplitz.o help.o -L/home/SPIKE/1.0/examples/examples_c/../../lib/em64t -lspike -lspike_adapt -lspike_adapt_de -lspike_adapt_grid_f -lspike_mpi_comm_intelmpi -lmkl_solver -lmkl_lapack -lmkl -lguide -lpthread -lm

The linker complains:

/usr/bin/ld: cannot find -lspike_adapt_de

Actually the libspike_adapt_de.so does exist in /home/SPIKE/1.0/lib/em64t. I have tried GNU and PGI compilers. Both have got the same error. The linker seems only complaining about the unfound shared library. As Spike is a pre-compiled library for Intel processors and compilers, I'd like to know whether this is an incompatibility problem or there is a workaround to the error.

Thanks.

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

Hello,
Spike should work fine on AMD systems. Did you run the setup script in./SPIKE/1.0/tools/environment? The Spike installer updates the setup scripts with the location of libspike_adapt_de.so. You should run spikevarsem64t.{sh|csh} depending on which shell you are using.

Best regards,
Henry

Hi Henry,

Thanks for your reply. The error still occurs after running spikevarsem64t.sh. In my case

$ source spikevarsem64t.sh

$ echo $SPIKEROOT
/home/SPIKE/1.0

$ echo $INCLUDE
/home//SPIKE/1.0/include

$ echo $LD_LIBRARY_PATH
/home/SPIKE/1.0/lib/em64t:...

$ echo $SPIKE_ADAPT_DATA
/home/SPIKE/1.0/spike_adapt/em64t/de

$ ls /home/SPIKE/1.0/lib/em64t
... libspike_adapt_de.so ...

$ cd /home/SPIKE/1.0/examples/examples_c

$ make mpi=mpich2 CC=cc all
...
cc -O3 -I/home/SPIKE/1.0/examples/examples_c/../../include -c src/`basename toeplitz.o .o`.c
cc -o _results/toeplitz toeplitz.o help.o -L/home/SPIKE/1.0/examples/examples_c/../../lib/em64t -lspike -lspike_adapt -lspike_adapt_de -lspike_adapt_grid_f -lspike_mpi_comm_mpich2 -lmkl_solver -lmkl_lapack -lmkl -lguide -lpthread -lm
/opt/cray/xt-asyncpe/3.6/bin/cc: INFO: linux target is being used
/usr/bin/ld: cannot find -lspike_adapt_de
make[1]: *** [toeplitz] Error 2

I do the work on Cray XT4 with AMD Opteron quadcore nodes and Cray Linux Environment (CLE). The C compiler is always called via the compiler wrapper script cc which also compiles MPI. No mpicc is used on the system. I have tried PGI and GNU C compilers. Both fail with this error. I don't know why the linker can't find spike_adapt_de which is actually in /lib/em64t. Is it a library format problem?

The cc wrapper script can link other shard libraries under /usr/lib etc.

Thanks.

Hi,
Let's try building one of the examples directly rather than using the makefile. On my system, I built the toeplitz.c example as follows:

$ cd ~/SPIKE/1.0/examples/examples_c/source
$ mpicc toeplitz.c help.c -o toeplitz -I${HOME}/SPIKE/1.0/include/ \
-L${HOME}/SPIKE/1.0/lib/em64t \
-lspike -lspike_adapt -lspike_adapt_de \
-lspike_adapt_grid_f -lspike_mpi_comm_intelmpi \
-lmkl_solver -lmkl_lapack -lmkl -lguide -lpthread -lm

You will have to modify the compile command to use MPICH2 instead of Intel MPI, cc instead of mpicc, and to manuallylink the necessary MPI libraries. If we can at least get an executable, we can use ldd to figure out why libspike_adapt_de is not found. Here's the ldd output from my system:

$ ldd toeplitz

libspike_adapt_de.so => /home/henry/SPIKE/1.0/lib/em64t/libspike_adapt_de.so (0x00002aaaaaaad000)
/home/henry/SPIKE/1.0/lib/em64t/libmkl_intel_lp64.so (0x00002aaaaabb9000)
/home/henry/SPIKE/1.0/lib/em64t/libmkl_intel_thread.so (0x00002aaaaaebf000)
/home/henry/SPIKE/1.0/lib/em64t/libmkl_core.so (0x00002aaaab300000)
libguide.so => /home/henry/intel/mkl/10.1.0.015/lib/em64t/libguide.so (0x00002aaaab4d1000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e4e400000)
libm.so.6 => /lib64/libm.so.6 (0x0000003e4e800000)
libmpi.so.3.2 => /home/henry/intel/impi/3.2.0.011/lib64/libmpi.so.3.2 (0x00002aaaab656000)
libmpigf.so.3.2 => /home/henry/intel/impi/3.2.0.011/lib64/libmpigf.so.3.2 (0x00002aaaab96a000)
librt.so.1 => /lib64/librt.so.1 (0x0000003e4f000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003e4e000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003e4dc00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003e4d800000)

Best regards,
Henry

Hi Henry,

It's the same error by compiling a single example.

$ cc toeplitz.c help.c -o toeplitz -I/home/SPIKE/1.0/include/ -L/home/SPIKE/1.0/lib/em64t \
-lspike -lspike_adapt \
-lspike_adapt_de \
-lspike_adapt_grid_f -lspike_mpi_comm_mpich2 \
-lmkl_solver -lmkl_lapack -lmkl -lguide -lpthread -lm
/opt/cray/xt-asyncpe/3.6/bin/cc: INFO: linux target is being used
toeplitz.c:
help.c:
/usr/bin/ld: cannot find -lspike_adapt_de

There are three shared libraried to link: -lspike_adapt_de, -lmkl, -lguide. If I move -lmkl ahead of -lspike_adapt_de, the linker complains -lmkl unfound, i.e.,

$ cc toeplitz.c ... -lmkl -lspike_adapt_de ...
/opt/cray/xt-asyncpe/3.6/bin/cc: INFO: linux target is being used
toeplitz.c:
help.c:
/usr/bin/ld: cannot find -lmkl

If -lguide is moved in front, however, it can be found, e.g.,

$ cc toeplitz.c ... -lguide -lspike_adapt_de ...
/opt/cray/xt-asyncpe/3.6/bin/cc: INFO: linux target is being used
toeplitz.c:
help.c:
/usr/bin/ld: cannot find -lspike_adapt_de

Thanks.

Hi,
I haven't seen a problem like this before. The Spike package is mainly testedon Red Hat and SuSE Linux with the Intel and GNU compilers. Maybe there are subtle differences between the Cray and Red Hat environments. I don't have access to a Cray system for testing. Do you have access to a Red Hat or SuSE system to try to reproduce the problem there?

Best regards,

Henry

Hi Henry,

It works fine on Fedora 10/Intel Xeon quadcore. So it is likely a compatibility problem. The linker on Cray doesn't recognize the format of .so library since it's pre-compiled on another environment.

Thanks for your help.

Hi,
You're right. It must be a system incompatibility. I suggest that you contact Professor Ahmed Sameh (sameh@cs.purdue.edu). His group is preparing a new version of Spike that will be released as a source package under a BSD license. With the source package, you will be able to build the library for your system.

Best regards,
Henry

Hi,

On the Hector machine at EPCC, which is where this problem started, I have noticed now that we can now compile dynamic libraries using the 'export XTPE_LINK_TYPE=dynamic' before compilation.

BUT after compilation, the results for the test examples, including toeplitz.f90, or the hello world example in the SPIKE manual or page 7, gives at runtime.

UNSUCCESSFUL RUN FOR SPIKE - INFO EXIT -1
SPIKE_CORE ERROR CODE -313

I have checked by running the same codes on other machines and everything is fine there. So why does this happen?

Jitesh Gajjar

Login to leave a comment.