Dear,
I want to Build LAMMPS( 08version ) as a library, But there are some errors. May be fftw linker interface wrong, but I don’t know how to solve it . I have run make makelib and make -f makefile.lib g++ and created the libmp_g++.a. I have checked the relative path of FFTW is right. I also tried the absolute path. The following is command, error, and makefile, I hope some kind man tell me why. Thanks in advance.
*icc -I…/…/src -I…/…/…/…/lib/fftw215/include *
*-L…/…/…/…/lib/fftw215/lib -L…/…/src c++_driver.cpp *
*-lfftw -llmp_g++ /usr/lib/libmpi++.so /usr/lib/libmpi.so -lstdc++ *
-mcpu=itanium2-p9000 -mtune=itanium2-p9000 -o c++_driver
ERROR:
…/…/src/liblmp_g++.a(fft3d.o): In function fft_1d_only(fftw_complex*, int, int, fft_plan_3d*)': fft3d.cpp:(.text+0x4d2): undefined reference to
fftw’
fft3d.cpp:(.text+0x5d2): undefined reference to fftw' fft3d.cpp:(.text+0x6d2): undefined reference to
fftw’
fft3d.cpp:(.text+0x962): undefined reference to fftw' fft3d.cpp:(.text+0xa62): undefined reference to
fftw’
…/…/src/liblmp_g++.a(fft3d.o):fft3d.cpp:(.text+0xb62): more undefined references to fftw' follow ../../src/liblmp_g++.a(fft3d.o): In function
fft_3d_destroy_plan(fft_plan_3d*)’:
fft3d.cpp:(.text+0x1642): undefined reference to fftw_destroy_plan' fft3d.cpp:(.text+0x1662): undefined reference to
fftw_destroy_plan’
fft3d.cpp:(.text+0x1692): undefined reference to fftw_destroy_plan' fft3d.cpp:(.text+0x16b2): undefined reference to
fftw_destroy_plan’
fft3d.cpp:(.text+0x16d2): undefined reference to fftw_destroy_plan' ../../src/liblmp_g++.a(fft3d.o):fft3d.cpp:(.text+0x16f2): more undefined references to
fftw_destroy_plan’ follow
…/…/src/liblmp_g++.a(fft3d.o): In function fft_3d_create_plan(unsigned int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int*)': fft3d.cpp:(.text+0x2c62): undefined reference to
fftw_create_plan’
fft3d.cpp:(.text+0x2c82): undefined reference to fftw_create_plan' fft3d.cpp:(.text+0x2f82): undefined reference to
fftw_create_plan’
fft3d.cpp:(.text+0x2fb2): undefined reference to fftw_create_plan' fft3d.cpp:(.text+0x3012): undefined reference to
fftw_create_plan’
…/…/src/liblmp_g++.a(fft3d.o):fft3d.cpp:(.text+0x3032): more undefined references to fftw_create_plan' follow ../../src/liblmp_g++.a(fft3d.o): In function
fft_3d(fftw_complex*, fftw_complex*, int, fft_plan_3d*)’:
fft3d.cpp:(.text+0x3ad2): undefined reference to fftw' fft3d.cpp:(.text+0x3c62): undefined reference to
fftw’
fft3d.cpp:(.text+0x3df2): undefined reference to fftw' fft3d.cpp:(.text+0x40b2): undefined reference to
fftw’
fft3d.cpp:(.text+0x41b2): undefined reference to fftw' ../../src/liblmp_g++.a(fft3d.o):fft3d.cpp:(.text+0x42b2): more undefined references to
fftw’ follow
MAKEfile:
CC = icc
CCFLAGS = -DFFT_FFTW -DGZIP -O2 -mcpu=itanium2-p9000 -mtune=itanium2-p9000 -I…/…/…/…/lib/fftw215/include
DEPFLAGS = -M
one user needed icpc to link
LINK = icc
LINKFLAGS = -O0 -L…/…/…/…/lib/fftw215/lib
USRLIB = -lfftw
SYSLIB = /usr/lib/libmpi++.so /usr/lib/libmpi.so -lstdc++
SIZE = size