···4343The core fft and most tools/ code can be compiled to use float, double,
4444 Q15 short or Q31 samples. The default is float.
45454646+BUILDING:
4747+4848+There are two functionally-equivalent build systems supported by kissfft:
4949+5050+ * Make (traditional Makefiles for Unix / Linux systems)
5151+ * CMake (more modern and feature-rich build system developed by Kitware)
5252+5353+To build kissfft, the following build environment can be used:
5454+5555+ * GNU build environment with GCC, Clang and GNU Make or CMake (>= 3.6)
5656+ * Microsoft Visual C++ (MSVC) with CMake (>= 3.6)
5757+5858+Additional libraries required to build and test kissfft include:
5959+6060+ * libpng for psdpng tool,
6161+ * libfftw3 to validate kissfft results against it,
6262+ * python 2/3 with Numpy to validate kissfft results against it.
6363+ * OpenMP supported by GCC, Clang or MSVC for multi-core FFT transformations
6464+6565+Environments like Cygwin and MinGW can be highly likely used to build kissfft
6666+targeting Windows platform, but no tests were performed to the date.
6767+6868+Both Make and CMake builds are easily configurable:
6969+7070+ * 'KISSFFT_DATATYPE=<datatype>' (for Make) or '-DKISSFFT_DATATYPE=<datatype>'
7171+ (for CMake) denote the principal datatype used by kissfft. It can be one
7272+ of the following:
7373+7474+ * float (default)
7575+ * double
7676+ * int16_t
7777+ * int32_t
7878+ * SIMD (requires SSE instruction set support on target CPU)
7979+8080+ * 'KISSFFT_OPENMP=1' (for Make) or '-DKISSFFT_OPENMP=ON' (for CMake) builds kissfft
8181+ with OpenMP support. Please note that a supported compiler is required and this
8282+ option is turned off by default.
8383+8484+ * 'KISSFFT_STATIC=1' (for Make) or '-DKISSFFT_STATIC=ON' (for CMake) instructs
8585+ the builder to create static library ('.lib' for Windows / '.a' for Unix or Linux).
8686+ By default, this option is turned off and the shared library is created
8787+ ('.dll' for Windows, '.so' for Linux or Unix, '.dylib' for Mac OSX)
8888+8989+ * '-DKISSFFT_TEST=OFF' (for CMake) disables building tests for kissfft. On Make,
9090+ building tests is done separately by 'make testall' or 'make testsingle', so
9191+ no specific setting is required.
9292+9393+ * 'KISSFFT_TOOLS=0' (for Make) or '-DKISSFFT_TOOLS=OFF' (for CMake) builds kissfft
9494+ without command-line tools like 'fastconv'. By default the tools are built.
9595+9696+ * 'KISSFFT_USE_ALLOCA=1' (for Make) or '-DKISSFFT_USE_ALLOCA=ON' (for CMake)
9797+ build kissfft with 'alloca' usage instead of 'malloc' / 'free'.
9898+9999+ * "PREFIX=/full/path/to/installation/prefix/directory" (for Make) or
100100+ "-DCMAKE_INSTALL_PREFIX=/full/path/to/installation/prefix/directory' (for CMake)
101101+ specifies the prefix directory to install kissfft into.
102102+103103+For example, to build kissfft as a static library with 'int16_t' datatype and
104104+OpenMP support using Make, run the command from kissfft source tree:
105105+106106+ make KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 all
107107+108108+The same configuration for CMake is:
109109+110110+ mkdir build && cd build
111111+ cmake -DKISSFFT_DATATYPE=int16_t -DKISSFFT_STATIC=ON -DKISSFFT_OPENMP=ON ..
112112+ make all
113113+114114+To specify '/tmp/1234' as installation prefix directory, run:
115115+116116+ make PREFIX=/tmp/1234 KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 install
117117+118118+or
119119+120120+ mkdir build && cd build
121121+ cmake -DCMAKE_INSTALL_PREFIX=/tmp/1234 -DKISSFFT_DATATYPE=int16_t -DKISSFFT_STATIC=ON -DKISSFFT_OPENMP=ON ..
122122+ make all
123123+ make install
124124+125125+TESTING:
126126+127127+ To validate the build configured as an example above, run the following command from
128128+kissfft source tree:
129129+130130+ make KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 testsingle
131131+132132+if using Make, or:
133133+134134+ make test
135135+136136+if using CMake.
137137+138138+To test all possible build configurations, please run an extended testsuite from
139139+kissfft source tree:
140140+141141+ sh test/kissfft-testsuite.sh
142142+143143+Please note that the extended testsuite takes around 20-40 minutes depending on device
144144+it runs on. This testsuite is useful for reporting bugs or testing the pull requests.
4614547146BACKGROUND:
48147
+114
README.md
···4444The core fft and most tools/ code can be compiled to use float, double,
4545 Q15 short or Q31 samples. The default is float.
46464747+## BUILDING:
4848+4949+There are two functionally-equivalent build systems supported by kissfft:
5050+5151+ - Make (traditional Makefiles for Unix / Linux systems)
5252+ - CMake (more modern and feature-rich build system developed by Kitware)
5353+5454+To build kissfft, the following build environment can be used:
5555+5656+ - GNU build environment with GCC, Clang and GNU Make or CMake (>= 3.6)
5757+ - Microsoft Visual C++ (MSVC) with CMake (>= 3.6)
5858+5959+Additional libraries required to build and test kissfft include:
6060+6161+ - libpng for psdpng tool,
6262+ - libfftw3 to validate kissfft results against it,
6363+ - python 2/3 with Numpy to validate kissfft results against it.
6464+ - OpenMP supported by GCC, Clang or MSVC for multi-core FFT transformations
6565+6666+Environments like Cygwin and MinGW can be highly likely used to build kissfft
6767+targeting Windows platform, but no tests were performed to the date.
6868+6969+Both Make and CMake builds are easily configurable:
7070+7171+ - `KISSFFT_DATATYPE=<datatype>` (for Make) or `-DKISSFFT_DATATYPE=<datatype>`
7272+ (for CMake) denote the principal datatype used by kissfft. It can be one
7373+ of the following:
7474+7575+ - float (default)
7676+ - double
7777+ - int16_t
7878+ - int32_t
7979+ - SIMD (requires SSE instruction set support on target CPU)
8080+8181+ - `KISSFFT_OPENMP=1` (for Make) or `-DKISSFFT_OPENMP=ON` (for CMake) builds kissfft
8282+ with OpenMP support. Please note that a supported compiler is required and this
8383+ option is turned off by default.
8484+8585+ - `KISSFFT_STATIC=1` (for Make) or `-DKISSFFT_STATIC=ON` (for CMake) instructs
8686+ the builder to create static library ('.lib' for Windows / '.a' for Unix or Linux).
8787+ By default, this option is turned off and the shared library is created
8888+ ('.dll' for Windows, '.so' for Linux or Unix, '.dylib' for Mac OSX)
8989+9090+ - `-DKISSFFT_TEST=OFF` (for CMake) disables building tests for kissfft. On Make,
9191+ building tests is done separately by 'make testall' or 'make testsingle', so
9292+ no specific setting is required.
9393+9494+ - `KISSFFT_TOOLS=0` (for Make) or `-DKISSFFT_TOOLS=OFF` (for CMake) builds kissfft
9595+ without command-line tools like 'fastconv'. By default the tools are built.
9696+9797+ - `KISSFFT_USE_ALLOCA=1` (for Make) or `-DKISSFFT_USE_ALLOCA=ON` (for CMake)
9898+ build kissfft with 'alloca' usage instead of 'malloc' / 'free'.
9999+100100+ - `PREFIX=/full/path/to/installation/prefix/directory` (for Make) or
101101+ `-DCMAKE_INSTALL_PREFIX=/full/path/to/installation/prefix/directory` (for CMake)
102102+ specifies the prefix directory to install kissfft into.
103103+104104+For example, to build kissfft as a static library with 'int16_t' datatype and
105105+OpenMP support using Make, run the command from kissfft source tree:
106106+107107+```
108108+make KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 all
109109+```
110110+111111+The same configuration for CMake is:
112112+113113+```
114114+mkdir build && cd build
115115+cmake -DKISSFFT_DATATYPE=int16_t -DKISSFFT_STATIC=ON -DKISSFFT_OPENMP=ON ..
116116+make all
117117+```
118118+119119+To specify '/tmp/1234' as installation prefix directory, run:
120120+121121+122122+```
123123+make PREFIX=/tmp/1234 KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 install
124124+```
125125+126126+or
127127+128128+```
129129+mkdir build && cd build
130130+cmake -DCMAKE_INSTALL_PREFIX=/tmp/1234 -DKISSFFT_DATATYPE=int16_t -DKISSFFT_STATIC=ON -DKISSFFT_OPENMP=ON ..
131131+make all
132132+make install
133133+```
134134+135135+## TESTING:
136136+137137+To validate the build configured as an example above, run the following command from
138138+kissfft source tree:
139139+140140+```
141141+make KISSFFT_DATATYPE=int16_t KISSFFT_STATIC=1 KISSFFT_OPENMP=1 testsingle
142142+```
143143+144144+if using Make, or:
145145+146146+```
147147+make test
148148+```
149149+150150+if using CMake.
151151+152152+To test all possible build configurations, please run an extended testsuite from
153153+kissfft source tree:
154154+155155+```
156156+sh test/kissfft-testsuite.sh
157157+```
158158+159159+Please note that the extended testsuite takes around 20-40 minutes depending on device
160160+it runs on. This testsuite is useful for reporting bugs or testing the pull requests.
4716148162## BACKGROUND
49163