How to install the library
cindywxw opened this issue · 7 comments
@adamstark Hi Adam! Thanks for sharing the code. This may be a silly question -- I don't know how to install the library. I didn't find ./configure file. Could you explain the procedure a little bit? Thanks!
Also, in "AccelerateFFT.h", line31: #include <Accelerate/Accelerate.h>. Where to find this header file?
Hi Cindy!
Definitely not a silly question - a lot of libraries have some kind of config routine. I developed this one with the intention that you would just include it in your project.
So include the Gist files in your project, and then include the library header...
#include "path/to/your/copy/of/Gist.h"
Regarding Accelerate - that is an Apple DSP library, so it will only work if you are on a mac. Even so, you don't need to use it - you can choose to use Kiss FFT, which is included in the project. Just add the flag -DUSE_KISS_FFT
Let me know if any of this isn't clear or if you have any more questions! :)
Thanks!
Adam
I see. I'll try this way. Thanks for your reply!
Hi @adamstark I'm trying to incorporate Gist. I get linker errors if I just include the header file as suggested above. Obviously there's no CMake file or something like that to build this project, so how are people using the project? How could any of the definitions in the .cpp files be compiled without that? I'm guessing I've misunderstood your instructions above.
Hi @BennetLeff,
You'll need to include the source files for the library in your project (i.e. everything in the src
folder) - the library won't compile unless these files (particularly the .cpp files) are visible to the compiler. Without that you'll get linker errors.
Adding a CMake file is something I'm considering doing in a future update
Let me know if it doesn't work,
Thanks,
Adam
@adamstark
Ok, I'm writing a project that uses the JUCE framework so here's what I did. I'd be happy to work on a PR to add a CMake file as well. Anyways:
What didn't work:
I created a CMakeLists.txt file which I've shared here.
I then created a new build directory, ran cmake, generated a Visual Studio solution file, and finally built the solution to generate a Gist.dll
file. I tried linking this many different ways in Projucer, though ultimately none of this worked (but I would like to figure out how to make it work).
What worked:
I simply added the entire Gist folder ("add existing files" in Projucer) to my source directory. Then I removed the python-module
and the test
module. Selecting to not compile these in Projucer would be adequate but for my use case I figured it'd be better for me to reduce project size.
Since I'm on Windows, I needed to tell Projucer not to compile AccelerateFFT.cpp, which I did by expanding Gist/src/fft
then toggling "Compile" off.
Finally, I hit save and opened the generated solution in Visual Studio and it built :)
I think it would be ideal to continue working on the CMake file to make this whole process a bit simpler and remove the need to recompile the project each time - which is necessary if building through the steps I just laid out. However, they do work and there seem to be a few issues asking how to install the library so hopefully this was some help.
Below I've attached a picture of Projucer folder to help anyone else. I know this project isn't explicitly meant for JUCE users but I figure many JUCE users will use this project.
Yes, that's great and what I would have suggested. :)
Definitely a CMake file would be good and yours looks good to me. I am not very familiar with CMake so I was waiting until I had moved some big JUCE projects over to CMake as a learning experience, before doing this library (and some others). But maybe if you do a pull request that will force me to get it sorted out, haha :)