MADjestic Posted August 15, 2006 Share Posted August 15, 2006 Hi there, I am trying to play a bit with fftw library (Fastest Fourier Transform in the West) and I hit the following obstacle Quote Link to comment Share on other sites More sharing options...
Jason Posted August 15, 2006 Share Posted August 15, 2006 I can't give you any direct help (perhaps eloop can?) but you could try and take a look at the HoudiniOceanToolkit which also uses fftw and see if there is anything he's doing in there that you might not be doing? Quote Link to comment Share on other sites More sharing options...
rjpieke Posted August 15, 2006 Share Posted August 15, 2006 Samlples/SOP>Houdini: symbol lookup error: /home/madjestic/houdini8.1/dso/SOP_FFTNull.so: undefined symbol: fftw_malloc Are you linking against the fftw library when compiling? Are you linking against it statically or dynamically? If dynamically, is the fftw .so file somewhere in your $LD_LIBRARY_PATH? These are usually the "ah darn it!" mistakes that I make PS, for what it's worth, it IS definitely possible to use this library in Houdini ... we use it in our ocean SOPs and shadeops Quote Link to comment Share on other sites More sharing options...
eloop Posted August 16, 2006 Share Posted August 16, 2006 It's a bit hard to guess what's going on here from the information you've given. Are you using a static or dynamic fftw library ? If you are using a dynamic library you'll need to make sure that the fftw.so (or whatever it's been named) is on your LD_LIBRARY_PATH. Also using 64 bit could be complicating matters, you may need to compile your own 64 bit version of fftw (assuming it's 64 bit clean). I haven't done any 64 bit development under linux so I'm not up with the details I'm afraid. If it was me I would be trying to compile a small standalone test program that calls some fftw routines and make sure that links and runs properly first. -Drew Samples/SOP>houdiniSamlples/SOP>Houdini: symbol lookup error: /home/madjestic/houdini8.1/dso/SOP_FFTNull.so: undefined symbol: fftw_malloc Quote Link to comment Share on other sites More sharing options...
MADjestic Posted August 16, 2006 Author Share Posted August 16, 2006 Thanks, eloop, I'll try to do this (compiling a standaolne app). Sorry, I am not sure which fftw I am linking - I install fftw as it is written in the INSTALL file (./configure, make make install), then I simply do a #include<fftw3.h> in the *.C file and compile it (I tried both linking and not lnking the fftw libraries with the hcustom -l... - the same as you do with the HOT compile script...). Actually I'll be quite happy if I can do static linking of fftw - could you give me a hint how to do static linking of fftw librries to my *.C file? Something like #include static <fftw3.h>? Or I must recompile the fftw somehow?... ============ Thank you for your feedback, however either because it SOP_FFTNull.zip Quote Link to comment Share on other sites More sharing options...
MADjestic Posted August 17, 2006 Author Share Posted August 17, 2006 Hmm... I've done a new clean installation of Windows XP (32bit version) and Visual Studio 2003, tried to compile the same code and... I get the same error - undefined symbol... I guess I have problems with dynamic linking. I am not a programmer (in true sense) and googling for static linking didn't help much, at least it is not clear to me yet how to perform static linking with fftw3.h - Can somebody give a small example, or a pair of lines of code of static linking? Thanks Hmm...I've done a new clean installation of Windows XP (32bit version) and Visual Studio 2003, tried to compile the same code and... I get the same error - undefined symbol... I guess I have problems with dynamic linking. I am not a programmer (in true sense) and googling for static linking didn't help much, at least it is not clear to me yet how to perform static linking with fftw3.h - Can somebody give a small example, or a pair of lines of code of static linking? Thanks PS. I am not actually sure that I've installed fftw correctly - I followed the instructions and it seemes pretty straightforward, but you can never be sure - is there a way to test whether it was installed correctly? I ran bench.exe and it seemed to work - on the other hand it may not use dynamic linking so it might run independently from what I did with the installation... Quote Link to comment Share on other sites More sharing options...
eloop Posted August 17, 2006 Share Posted August 17, 2006 For building the win32 version I would recommend grabbing one of the dynamically linked win32 binary distributions of fftw (fftw.org) and just link against that. (I managed to find a statically linked distribution a while back and I've been using that for building the distributions, less work for users to install, but I can't find where I got it from now). Make sure the fftw3.dll is on your executable path. See http://www.fftw.org/install/windows.html Sorry I can't be of more help with the 64 bit version. From the website it looks like you can make 64 bit clean versions of fftw. There are lots of platform specific gotcha's when it comes to dynamic vs static linking. Note that the SOP plugin has to be dynamically linked to make it loadable under houdini, but you can have it such that the fftw is linked statically to it. I notice you are using a .a file so that has been made to be statically linked against (.so -> dynamic library). Things are more complicated under windows in that you link against ".lib" filesw for both static and dynamic cases.... Google will be you friend here. .... I did manage to get your example linking under 32 bit linux, using the static libraries that I use for building HOT distributions. I changed all occurrences of fftw_ to fftwf_ so that you're using float instead of double precision. Then running up hscript brings the SOP in as expected without any errors. I think the win32 binary distributions of fftw that are on the web site bundle in all the routines for the different precisions together into one library, but when you build fftw from source it only builds one at a time (see configure options, web docs etc). Note, I mostly use the Makefiles for building the HOT these days. They should be up to date. I use CYGWIN under windows to get a unix like environment. If you are getting into diagnosing problems with linking dumpbin.exe (win32) and ldd (linux) are your friends. You will be a true programmer if you keep hammering away at this stuff for long enough :-) -Drew Hmm...I've done a new clean installation of Windows XP (32bit version) and Visual Studio 2003, tried to compile the same code and... I get the same error - undefined symbol... I guess I have problems with dynamic linking. I am not a programmer (in true sense) and googling for static linking didn't help much, at least it is not clear to me yet how to perform static linking with fftw3.h - Can somebody give a small example, or a pair of lines of code of static linking? Thanks PS. I am not actually sure that I've installed fftw correctly - I followed the instructions and it seemes pretty straightforward, but you can never be sure - is there a way to test whether it was installed correctly? I ran bench.exe and it seemed to work - on the other hand it may not use dynamic linking so it might run independently from what I did with the installation... Quote Link to comment Share on other sites More sharing options...
MADjestic Posted August 17, 2006 Author Share Posted August 17, 2006 Thanks eloop for compiling my code - it encourages me to persue the goal further. =============== I Quote Link to comment Share on other sites More sharing options...
peship Posted August 20, 2006 Share Posted August 20, 2006 just add the -fPIC flag to your gcc command. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.