Linking with Intel Compiler

Hello,
I was installing a program with MPI and got the following message:

mpicc -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused -malign-double -funroll-all-loops -o mdrun glaasje.o gctio.o init_sh.o ionize.o do_gct.o relax_sh.o repl_ex.o xutils.o compute_io.o md.o mdrun.o genalg.o  ../mdlib/.libs/libmd_mpi.a -L/usr/lib64 ../gmxlib/.libs/libgmx_mpi.a -lnsl -lfftw3f -lm /usr/lib64/libSM.so -lICE /usr/lib64/libX11.so /usr/lib64/libxcb-xlib.so /usr/lib64/libxcb.so -lXau -ldl
/usr/local/lib/libfftw3f.a(rdft2-pad.o): In function `fftwf_rdft2_pad':
rdft2-pad.c:(.text+0x5b): undefined reference to `_intel_fast_memcpy'
/usr/local/lib/libfftw3f.a(rank0.o): In function `apply_io1':
rank0.c:(.text+0x9f): undefined reference to `_intel_fast_memcpy'
rank0.c:(.text+0xad): undefined reference to `_intel_fast_memcpy'
/usr/local/lib/libfftw3f.a(rank0.o): In function `apply_io2r':
rank0.c:(.text+0xf7): undefined reference to `_intel_fast_memcpy'
/usr/local/lib/libfftw3f.a(rank0.o): In function `apply_io2i':
rank0.c:(.text+0x15f): undefined reference to `_intel_fast_memcpy'
/usr/local/lib/libfftw3f.a(rank0.o):rank0.c:(.text+0xfc): more undefined references to `_intel_fast_memcpy' follow
collect2: ld returned 1 exit status

As I got it Intel C++ Compiler uses two routines _intel_fast_memcpy and _intel_fast_memset to perform memcpy and memset operations that are not macro expanded to __builtin_memcpy and __builtin_memset in the source code. These are found in libirc. If you use the gcc compiler to link your application or if you directly call the linker, ld, you might find these unresolved symbols. For this reason, Intel recomends using the Intel C++ Compiler for linking, using the same compiler options used during the compilation phase.

The question is HOW TO SET ICC TO BE THE LINKER ?

Thanks.

If you are using a Makefile, add a like like

LD = icc++

(or what ever the name of the C++ compiler is).

It looks like your fftw is compiled with Intel compiler (the fftw should be built with MPI options). There is a way to have mpi set up to have multiple wrappers to accomadate multiple compilers. I don’t know how to do this off hand and even if I did, I don’t know which mpi you are using.

Since the mpi wrappers are just a set of options to use, it should be possible to just call icc with the correct set of options if this is a one off job. If you’ll be using icc compiled fftw often with your flavor of mpi, it would be worth the time to figure out the multiple wrappers for multiple compilers as mentioned above. Details on how to do this should be found in your mpi user documentation - likely in the install / configuration sections.

Most mpi software have their own mailing lists that might be helpful too.

The fftw found from the OpenSUSE 11.0 community repository worked fine for me with gcc 4.3.

Certain versions of Intel Compilers 10.x are not held in high repute within the HPC community as certain users have seen buggy code as a result of those compiler versions. I do not know the versions in question other then they were from the 10.x series.

Lastly, if you decide to play with different math libraries and compilers, AMD’s ACML 4.1.0 for gfortran is not compatible with gfortran 4.3.

Good luck - sorry I couldn’t help fix your problem, but I do hope I get you a little closer.