I added some changes in the cmake file
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=native -O2")
instead of "-mavx"
And I tried to install and use the C++ endpoint but I am getting segmentation faults on FCWT::cwt.
int main(){
std::cout << "The server started." << std::endl;
std::string filepath = "../static/sample.csv";
int nchannels = 6;
std::vector<std::vector<float>> data = readCSV(filepath, 6); // this part will be replaced with an active socket connection received
std::cout << "File read successfully. Size " << data.size() <<","<<data[0].size() << std::endl;
int sampling_rate = 44100;
int nframe = 128;
int nsamples = data[0].size();
int fstart = 1, fend = 64;
Morlet morlet(2.0f);
Wavelet *wavelet = &morlet;
int nthreads = 8;
FCWT fcwt(wavelet, nthreads, true, false);
Scales scales(wavelet, FCWT_LOGSCALES, sampling_rate, fstart, fend, nframe);
std::vector<MatrixXcf> spectrum(nframe, MatrixXcf::Zero(nchannels, nsamples));
std::cout << nchannels << std::endl;
std::vector<complex<float>> spec(data.size()*data[0].size() + 5, 0);
std::cout << spec[0] << std::endl;
for (int i = 0; i < nchannels; i++)
{
std::cout << i << std::endl;
fcwt.cwt(&data[i][0], nsamples, &spec[0], &scales);
std::cout << "good" << std::endl;
std::cout << spec[0] << std::endl;
}
}
[100%] Linking CXX executable server
[100%] Built target server
The server started.
File read successfully. Size 6,8000
6
(0,0)
0
WARNING: Optimization scheme 'n8192_t8.wis' was not found, fallback to calculation without optimization.
Segmentation fault
I tried installation using pip, but resulted in the following error
I added some changes in the cmake file
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=native -O2")
instead of "-mavx"And I tried to install and use the C++ endpoint but I am getting segmentation faults on FCWT::cwt.
How should I rectify this?