kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.67k stars 256 forks source link

kfrlib doesn't work at Qt 5.7.0 #7

Closed Bearsuny closed 7 years ago

Bearsuny commented 7 years ago

Hi dlevin256, When I build my Qt project, it gives me the compile output, like this:

/home/bearsuny/Libs/kfr-1.2.0/include/kfr/base/min_max.hpp:43: error: cannot convert ‘const simd_t {aka const vector(16) unsigned char}’ to ‘m128i {aka vector(2) long long int}’ for argument ‘1’ to ‘m128i _mm_min_epu8(m128i, m128i)’ And my project is simple, like this #include <QCoreApplication> #include <iostream> #include <kfr/dft.hpp> using namespace kfr; using namespace std; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); return a.exec(); } The .pro file: QT += core QT -= gui CONFIG += c++14 TARGET = PipeMonitor CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp INCLUDEPATH += /home/bearsuny/Libs/kfr-1.2.0/include the version of kfrlib is 1.2.0 and I don't know that should I use kfrlib 1.0.0 or else? Thank you

Bearsuny commented 7 years ago

And if I get kfrlib via git clone https://github.com/kfrlib/kfr.git The compile error doesn't occur, but it can lead to another error when I use the function data = irealdft(freq) / data.size(); ../../Libs/kfr/include/kfr/dft/fft.hpp:1119:30: internal compiler error: in tsubst_copy, at cp/pt.c:13039 const size_t csize = this->size / 2; I review you code in fft.hpp and I found that the to_fmt function said: void to_fmt(complex<T>* out, dft_pack_format fmt) const { using namespace internal; size_t csize = this->size / 2; // const size_t causes internal compiler error: in tsubst_copy in GCC 5.2 but the from_fmt function still use the const size_t csize = this->size/2; And my gcc version is gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) If I delete the const in the from_fmt function, the compile output doesn't occur any errors.

dancazarin commented 7 years ago

Hi,

Thank you for investigation and solution for this ICE.

Will you post a pull request or should I add your fix to repository?

GCC support is still experimental as for now, KFR 2.0 will introduce full support of GCC and MSVC including better optimization and vectorization.

Bearsuny commented 7 years ago

Hi, Well,you can just add my fix to your repository :) But I still don't know which release to include my project T T, Should I use the git clone to get the lib or the 1.2.0 release lib? Thank you~

dancazarin commented 7 years ago

Use the latest master branch, you can get it by cloning the repository: git clone https://github.com/kfrlib/kfr.git Current development is in the dev branch, so master gets only tested features.

ok, I will add your fix with your name.

Bearsuny commented 7 years ago

Thank you :) and have a nice day!~