Closed KenSporger closed 3 years ago
Hi,
For CMake way, try to use the following cmake file (place it in the same directory with you fft.cpp)
cmake_minimum_required(VERSION 3.1)
project(demo CXX)
add_subdirectory(${KFR_DIR} kfr-bin)
add_executable(demo fft.cpp)
target_link_libraries(demo kfr kfr_io kfr_dft use_arch)
And execute the following commands inside your directory (where fft.cpp is located).
mkdir build
cd build
cmake "-DKFR_DIR=<PATH-TO-KFR-SOURCE>" -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
In this case you do not need to build KFR binaries manually, cmake will do it automatically for you.
use_arch is a virtual target that exists only in cmake environment. It's intended for setting correct arch flags for you own executables, you should not use it in GCC command line.
Hi~ I am writing the programs according to the document tutorial, which includes KFR, DSP, DFT, IO four chapters. When I use the code in KFR, it works well; but if I use the code from the other three chapters, the compiler will report some errors. For examples: I wrote,
but an error occurred when compiling,
Besides,I wrote,
another error occurred,
I also try to write an CMakeLists.txt,like this:
but it turns out an error like first situation,
I suspect that I did not fullyinstall KFR, because I was a little confused about the installation tutorial. I saw that you provided two installation methods under Linux. I tried both of them, and finally obtained libkfr dft. a_ and libkfr io.a_. But examples/ CMakeLists.txt seems to be needed libdft.a and _libusearch.a?
There are my environments: Ubuntu18.04 Gcc 7.5.0 clang version 7.0.0 kfr 4.2.0
Any idea what's going on?