l********r 发帖数: 175 | 1 When trying to compile lammps source code using fftw-2.1.5 and intel
compiler, I always got following error message:
fft_3d.o: In function `fft_3d_destroy_plan_c':
fft_3d.c:(.text+0x1788): undefined reference to `fftw_destroy_plan'
fft_3d.c:(.text+0x1793): undefined reference to `fftw_destroy_plan'
fft_3d.c:(.text+0x17a3): undefined reference to `fftw_destroy_plan'
fft_3d.c:(.text+0x17ae): undefined reference to `fftw_destroy_plan'
fft_3d.c:(.text+0x17b9): undefined reference to `fftw_destroy_pl |
l******n 发帖数: 9344 | 2 you do not use the fftw right, the compilor could not fined the definition
of fftw subroutines
check your makefile and directory of fftw3.la
destroy
【在 l********r 的大作中提到】 : When trying to compile lammps source code using fftw-2.1.5 and intel : compiler, I always got following error message: : fft_3d.o: In function `fft_3d_destroy_plan_c': : fft_3d.c:(.text+0x1788): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x1793): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17a3): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17ae): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17b9): undefined reference to `fftw_destroy_pl
|
l********r 发帖数: 175 | 3 Hi, In fact, I installed the fftw-2.1.5 several times on Ubuntu system and
by testing it, it looks right. How to make sure it was really installed
correctly? thanks again. |
O******e 发帖数: 734 | 4 You need to specify the path for the FFTW library somehow. Try using the
-L compiler option.
destroy
【在 l********r 的大作中提到】 : When trying to compile lammps source code using fftw-2.1.5 and intel : compiler, I always got following error message: : fft_3d.o: In function `fft_3d_destroy_plan_c': : fft_3d.c:(.text+0x1788): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x1793): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17a3): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17ae): undefined reference to `fftw_destroy_plan' : fft_3d.c:(.text+0x17b9): undefined reference to `fftw_destroy_pl
|
l******n 发帖数: 9344 | 5 do you write a small code to test it?
put your makefile here
【在 l********r 的大作中提到】 : Hi, In fact, I installed the fftw-2.1.5 several times on Ubuntu system and : by testing it, it looks right. How to make sure it was really installed : correctly? thanks again.
|
l********r 发帖数: 175 | 6 here is the makefile I used. I installed intel-f and intel-c compiler. My
source code is lammps2001. But I added some programs into it, so it prefer
to use the old edition. Thanks a lot.
# Makefile for Linux cluster
SHELL = /bin/sh
.IGNORE:
# search path for fortran, C, and include files (GNU make specific)
vpath %.c .:..
vpath %.f .:..
vpath %.F .:..
vpath %.h .:..
# System-specific settings
#TARGMACH = -tp p7 #Intel Xeon
TARGMACH = #AMD Athlon MP
# Note: fftw requires a single |
O******e 发帖数: 734 | 7 For LINKFLAGS and SYSLIB in the makefile, are those really supposed to
be absolute paths? The -L/usr/local/lib looks fine, but these
-L/mpich2-install/build/LINUX/ch_p4/lib/
-L/fftw-2.1.5/
are not right unless you really did install them at the / directory.
Check whether these should be
-L/usr/local/ . . . /mpich2-install/build/LINUX/ch_p4/lib/
-L/usr/local/ . . . /fftw-2.1.5/
or something similar.
【在 l******n 的大作中提到】 : do you write a small code to test it? : put your makefile here
|
O******e 发帖数: 734 | 8 I also think you need to put -L before -l in SYSLIB.
【在 l********r 的大作中提到】 : here is the makefile I used. I installed intel-f and intel-c compiler. My : source code is lammps2001. But I added some programs into it, so it prefer : to use the old edition. Thanks a lot. : # Makefile for Linux cluster : SHELL = /bin/sh : .IGNORE: : # search path for fortran, C, and include files (GNU make specific) : vpath %.c .:.. : vpath %.f .:.. : vpath %.F .:..
|
l******n 发帖数: 9344 | 9 i agree, you need to specify the absolute directory and it seems to be the
problem you have now
【在 O******e 的大作中提到】 : For LINKFLAGS and SYSLIB in the makefile, are those really supposed to : be absolute paths? The -L/usr/local/lib looks fine, but these : -L/mpich2-install/build/LINUX/ch_p4/lib/ : -L/fftw-2.1.5/ : are not right unless you really did install them at the / directory. : Check whether these should be : -L/usr/local/ . . . /mpich2-install/build/LINUX/ch_p4/lib/ : -L/usr/local/ . . . /fftw-2.1.5/ : or something similar.
|
l********r 发帖数: 175 | 10 I checked the fftw-2.1.5 and decided to install it again. I used "make
clean" to clean the files I built before. Then did following:
>./configure. by piping the output and reading the output
,it is ok
> make piping and reading the output
carefully, it is also ok.
> make install I changed myself into superuser first, and
piped the output to log.make_install file, which looks ok. but on the
screen, it showed me following |
|
|
O******e 发帖数: 734 | 11
for
I'm not sure what this mean, never installed FFTW2 before, but the .info
file is just documentation. Sounds like the rest of the stuff was
successfully installed.
If FFTW2 is anything like FFTW3, the compiled library will be installed
under /usr/local/lib by default. Do you see the library files there?
If they are there, you now have to fix your make file as I indicated.
【在 l********r 的大作中提到】 : I checked the fftw-2.1.5 and decided to install it again. I used "make : clean" to clean the files I built before. Then did following: : >./configure. by piping the output and reading the output : ,it is ok : > make piping and reading the output : carefully, it is also ok. : > make install I changed myself into superuser first, and : piped the output to log.make_install file, which looks ok. but on the : screen, it showed me following
|
l********r 发帖数: 175 | 12 Thanks. I think the fftw-2.1.5 was installed completely. But I still got the
error message complaining about the reference of fftw_destroy_plan and so
on. Reading the fftw.la file, I could see that it just do linking. It did
not list the function as "fftw_destroy_plan" at all. So what else could I do
? thanks again. |
l******n 发帖数: 9344 | 13 do you use the same compilor for installing fftw and compiling your codes?
I once had a problem on this issue.
you said you tested, and it was fine?
the
do
【在 l********r 的大作中提到】 : Thanks. I think the fftw-2.1.5 was installed completely. But I still got the : error message complaining about the reference of fftw_destroy_plan and so : on. Reading the fftw.la file, I could see that it just do linking. It did : not list the function as "fftw_destroy_plan" at all. So what else could I do : ? thanks again.
|
K*****n 发帖数: 23 | 14 I guess your problem might be the directory of fftw. If you do install fftw
2.1.5 under the directory of /fftw-2.1.5, then your link variable should
look like:
-I/fftw-2.1.5/include
-L/fftw-2.1.5/lib
Just specify the home directory of /fftw-2.1.5 is not enough.
the
do
【在 l********r 的大作中提到】 : Thanks. I think the fftw-2.1.5 was installed completely. But I still got the : error message complaining about the reference of fftw_destroy_plan and so : on. Reading the fftw.la file, I could see that it just do linking. It did : not list the function as "fftw_destroy_plan" at all. So what else could I do : ? thanks again.
|
l********r 发帖数: 175 | 15 In fact, I installed fftw-2.1.5 at several different places. One is to use
the default address, /usr/local/include and /usr/local/lib. I found fftw
related files there. I also installed it from scratch at ~/fftw2/ directory.
It also has /include and /lib directories. They are also fine. Anyway,
after using the correct address for the fftw part, I still got the same
error message.
One thing I am wondering is about this part:
SYSLIB= -ldfftw -ldrfftw -I/usr/local/lib
here, why it should be -ldfftw |
O******e 发帖数: 734 | 16
Did you try
-L/usr/local/lib -ldfftw -ldrfftw
i.e., put the library path before the library?
The difference between dfftw, drfftw, etc. is explained in the manual.
You need check the manual for LAMMPS and FFTW2 to find out which one(s)
you need, and you might need to built FFTW2 several times with different
options to build the different (single and double) libraries.
【在 l********r 的大作中提到】 : In fact, I installed fftw-2.1.5 at several different places. One is to use : the default address, /usr/local/include and /usr/local/lib. I found fftw : related files there. I also installed it from scratch at ~/fftw2/ directory. : It also has /include and /lib directories. They are also fine. Anyway, : after using the correct address for the fftw part, I still got the same : error message. : One thing I am wondering is about this part: : SYSLIB= -ldfftw -ldrfftw -I/usr/local/lib : here, why it should be -ldfftw
|
K*****n 发帖数: 23 | 17
directory.
why
some
whether -ldfftw or -lfftw depends on the way you compile fftw. If you
enalbed
【在 l********r 的大作中提到】 : In fact, I installed fftw-2.1.5 at several different places. One is to use : the default address, /usr/local/include and /usr/local/lib. I found fftw : related files there. I also installed it from scratch at ~/fftw2/ directory. : It also has /include and /lib directories. They are also fine. Anyway, : after using the correct address for the fftw part, I still got the same : error message. : One thing I am wondering is about this part: : SYSLIB= -ldfftw -ldrfftw -I/usr/local/lib : here, why it should be -ldfftw
|
l********r 发帖数: 175 | 18 Thanks for all those information. I found that I installed intel-f and
intel-c, but when installing mpich2, I did not specify using ifort. So it
should use the default one: gcc or g77. Could that make trouble for me? I
did not see any choice to install mpich2 using ifort. But for fftw, I used
ifort to install it. |
l******n 发帖数: 9344 | 19 全部统一用一个compile,不然没办法
ifort其实不好,很慢
【在 l********r 的大作中提到】 : Thanks for all those information. I found that I installed intel-f and : intel-c, but when installing mpich2, I did not specify using ifort. So it : should use the default one: gcc or g77. Could that make trouble for me? I : did not see any choice to install mpich2 using ifort. But for fftw, I used : ifort to install it.
|
O******e 发帖数: 734 | 20 Forget about lammps for a second. After you compile and install FFTW2,
have your tried writing just a small test program to make sure it works?
【在 l********r 的大作中提到】 : Thanks for all those information. I found that I installed intel-f and : intel-c, but when installing mpich2, I did not specify using ifort. So it : should use the default one: gcc or g77. Could that make trouble for me? I : did not see any choice to install mpich2 using ifort. But for fftw, I used : ifort to install it.
|
|
|
O******e 发帖数: 734 | 21 Even though it is advisable to use the same compiler suite (gcc/g77/gfortran,
or icc/ifort), I'm not sure that this is the cause of the problem. I've
been mixing gcc/g77/icc/ifort all the time when testing my code, and I have
never had any problem.
(I don't use gfortran because it is too buggy. I'm also curious why you
say ifort is slow? In my experience the code it produces is way faster
than g77 or pgf77/pgf90, but you have to make good use of the Fortran 9x
language. Well, maybe you are c
【在 l******n 的大作中提到】 : 全部统一用一个compile,不然没办法 : ifort其实不好,很慢
|
l******n 发帖数: 9344 | 22 I am saying ifort is slow from my own experience, and it depends on my
machine of course. For compiling the same program, pfg90 and mpif90 is much
faster than ifort for me.
mixing compilors is doable, but you need to figure out the settings and all
the flags. Different compiler has different default setting, so reading the
whole manual is must. There also might be something which has not a
counterpart in others, this is very bad.
gfortran,
have
【在 O******e 的大作中提到】 : Even though it is advisable to use the same compiler suite (gcc/g77/gfortran, : or icc/ifort), I'm not sure that this is the cause of the problem. I've : been mixing gcc/g77/icc/ifort all the time when testing my code, and I have : never had any problem. : (I don't use gfortran because it is too buggy. I'm also curious why you : say ifort is slow? In my experience the code it produces is way faster : than g77 or pgf77/pgf90, but you have to make good use of the Fortran 9x : language. Well, maybe you are c
|
O******e 发帖数: 734 | 23 Interesting. I might have to give PGF a try again some time.
much
all
the
【在 l******n 的大作中提到】 : I am saying ifort is slow from my own experience, and it depends on my : machine of course. For compiling the same program, pfg90 and mpif90 is much : faster than ifort for me. : mixing compilors is doable, but you need to figure out the settings and all : the flags. Different compiler has different default setting, so reading the : whole manual is must. There also might be something which has not a : counterpart in others, this is very bad. : : gfortran, : have
|
l********r 发帖数: 175 | 24 well, there is a test program could be used after installing fftw2. I used
command make test, it passed the test. So I think the fftw was installed
correctly. I don't know how to write a small program to test fftw. Do you
have one to send me so that I could test my installation? Thanks a lot. |
O******e 发帖数: 734 | 25 Read the FFTW2 manual. There should be very short examples in the first
few pages of the manual. You can fill an array of size N with random
numbers, do a forward FFT followed by a backward FFT, and see whether your
array is multiplied by N.
The "make test" or "make check" only tests FFTW2 after it is compiled but
before it is installed. If you run the test after you "make install", it
is still testing the unstalled copy.
I use FFTW3, and my code is too big to send to you.
【在 l********r 的大作中提到】 : well, there is a test program could be used after installing fftw2. I used : command make test, it passed the test. So I think the fftw was installed : correctly. I don't know how to write a small program to test fftw. Do you : have one to send me so that I could test my installation? Thanks a lot.
|
l******n 发帖数: 9344 | 26 Testing code is very short, just do a whatever fft transform and then
transform it back.
【在 O******e 的大作中提到】 : Read the FFTW2 manual. There should be very short examples in the first : few pages of the manual. You can fill an array of size N with random : numbers, do a forward FFT followed by a backward FFT, and see whether your : array is multiplied by N. : The "make test" or "make check" only tests FFTW2 after it is compiled but : before it is installed. If you run the test after you "make install", it : is still testing the unstalled copy. : I use FFTW3, and my code is too big to send to you.
|