Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"kiss_fft_scalar" definition not been replaced if build with double type #62

Open
kemen209 opened this issue Mar 21, 2021 · 1 comment

Comments

@kemen209
Copy link

I use cmake to build kissfft as staticlib on macOS 11 with property -DKISSFFT_DATATYPE=double, every thing works fine until i try to use it my project.

I got nan values from kiss_fft(), and my input array also been changed!!!

After i done some debugging and search on Web, i found that the definition of kiss_fft_scalar in file kiss_fft.h:

# ifndef kiss_fft_scalar
/*  default is float */
#   define kiss_fft_scalar float
# endif

It still set to float, which cause the kissfft fail to calculate the pos of data, lead to access someone else's memory. After i change the float to double, everything works like charm!

I dont' know if i made some mistake during the build process, or there is something you guys missed here.

My build step:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DKISSFFT_DATATYPE=double -DKISSFFT_STATIC=ON -DKISSFFT_TEST=OFF -DKISSFFT_TOOLS=OFF ..
make
@Panadestein
Copy link

Hello,

I see that this post is one year old, but I am still having the same issue. There is a problem with the default type of kiss_fft_scalar when using kissfft for double input. If one sets the default value to double as @kemen209 then one gets the correct result. Seems like a bug to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants