Discussion:
[Dev-C++] newbie: trying to install FFTW library on XP
j***@student.umass.edu
2004-07-30 00:02:03 UTC
Permalink
Hi, I'm pretty new to using outside libraries...so I don't really understand
how to install the FFTW(fast fourier transform made at MIT) library for use
with my C++ programs(in fact i probably wouldn't really get how to install any
outside library other than including a .h file). I have Windows XP and use
Bloodshed Dev-C++ Version 2...if anyone could walk me through(please don't make
assumptions about what I already know other than how to write C++ code...) it
would be a great help, and I would really appreciate it.

thanks a ton
Siva Chandra
2004-07-30 03:14:01 UTC
Permalink
Hello,
Post by j***@student.umass.edu
Hi, I'm pretty new to using outside libraries...so I
don't really understand
how to install the FFTW(fast fourier transform made
at MIT) library for use
with my C++ programs(in fact i probably wouldn't
really get how to install any
outside library other than including a .h file).
Here is what I have done to get going with FFTW.

1. First go to the fftw web-site and download the
mingw binaries. The downloaded stuff includes two
binaries fftw3.dll and fftw3.lib. It also has the
include file.
Copy this include file to the include folder of
DevC++.

2. Create a new empty C project using Dev-C++.

3. Add a new *.c source file to your project. In this
file you can add the #include <fftw3.h> directive and
put in the rest of your code. As test you can copy the
code from the fftw tutorial.

4. Go to Project->Options->Parameters. There, use the
"add a library button" to add the fftw3.lib file.

5. Then compile your project.

6. You should now have an executable ready. Put the
fftw3.dll in the same directory as the executable or
the windows system directory.

7. Run your executable!

Hope this helps,
Siva Chandra




__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
j***@student.umass.edu
2004-07-30 15:10:09 UTC
Permalink
Siva:

Thanks for your help, and I did as you suggested, and tried compiling the
tutorial code...but I'm getting an error I don't quite understand:

invalid conversion from `void*' to `double (*)[2]'

this appears at the two lines with fftw_malloc(lines starred in my code below)
here's the exact code I'm trying to compile...and I already put the header in
the include folder and linked the .lib file. If you or anyone else had any
ideas why this would happen, I'd appreciate it thanks.

#include <stdlib.h>
#include <fftw3.h>

int main()
{
int N = 256;
fftw_complex *in, *out;
fftw_plan p;
* in = fftw_malloc(sizeof(fftw_complex) * N);
* out = fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p); /* repeat as needed */
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
system("PAUSE");
return 0;
}
Siva Chandra
2004-07-30 15:46:15 UTC
Permalink
Hello,

Below is the code you said you used to test. I have
tried compiling it but with two changes. And it works.
I removed the two *'s which are at the begining of the
lines which call the fftw_malloc function. But
everything else is as you said you did.
Post by j***@student.umass.edu
#include <stdlib.h>
#include <fftw3.h>
int main()
{
int N = 256;
fftw_complex *in, *out;
fftw_plan p;
* in = fftw_malloc(sizeof(fftw_complex) * N);
* out = fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD,
FFTW_ESTIMATE);
fftw_execute(p); /* repeat as needed */
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
system("PAUSE");
return 0;
}
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
Siva Chandra
2004-07-30 16:42:01 UTC
Permalink
Sorry, I mis-read the last mail from ***@st...
and gave a reply based on my mis-understanding.



__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
Per Westermark
2004-07-30 20:24:06 UTC
Permalink
Are you compiling the code as C++?

In that case you should rewrite the lines like:
in = (fftw_complex*)fftw_malloc(sizeof...
out = (fftw_complex*)fftw_malloc(sizof...
to typecast from void* to the data type of the in and out variables.

In older standards, there was an automagic cast from void* to everything
but newer standards likes you to manually specify that you know what data
types you have and what data types you want.

/Per W
Post by j***@student.umass.edu
Thanks for your help, and I did as you suggested, and tried compiling the
invalid conversion from `void*' to `double (*)[2]'
this appears at the two lines with fftw_malloc(lines starred in my code below)
here's the exact code I'm trying to compile...and I already put the header in
the include folder and linked the .lib file. If you or anyone else had any
ideas why this would happen, I'd appreciate it thanks.
#include <stdlib.h>
#include <fftw3.h>
int main()
{
int N = 256;
fftw_complex *in, *out;
fftw_plan p;
* in = fftw_malloc(sizeof(fftw_complex) * N);
* out = fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p); /* repeat as needed */
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
system("PAUSE");
return 0;
}
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Dev-cpp-users mailing list
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
Loading...