mercredi 9 mai 2018

Compilation error: `‘error_category’ does not name a type` with g++ 6.3.0

I try to compile this C++/Python library https://bitbucket.org/fluiddyn/fluidfft

If mpi4py is installed, it works well.

If mpi4py is not installed, code that does not use MPI cannot be compiled.

An error is raise during the compilation of a Cython file. The error is long and it starts by:

In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from src_cpp/base/base_fft.h:10,
                 from fluidfft/fft2d/fft2d_with_fftw1d.cpp:543:
/usr/include/c++/6/system_error:143:31: error: ‘error_category’ does not name a type
     error_code(int __v, const error_category& __cat) noexcept
                               ^~~~~~~~~~~~~~
/usr/include/c++/6/system_error:152:27: error: ‘error_category’ does not name a type
     assign(int __v, const error_category& __cat) noexcept
                           ^~~~~~~~~~~~~~
/usr/include/c++/6/system_error:172:11: error: ‘error_category’ does not name a type
     const error_category&
           ^~~~~~~~~~~~~~
/usr/include/c++/6/system_error:191:11: error: ‘error_category’ does not name a type
     const error_category*  _M_cat;

[...]

I guess it could be a C++11 problem (http://en.cppreference.com/w/cpp/error/error_category) but I don't see how to solve the problem.

The compilation command is

g++ -pthread -fwrapv -O3 -Wall -Wno-unused-result -Wsign-compare -Wno-unused-result -Wsign-compare -fwrapv -O3 -Wall -fPIC -I/home/users/me/opt/miniconda3/include/python3.6m -I/home/users/me/opt/miniconda3/include -Isrc_cy -Ifluidfft/fft2d -Ifluidfft/fft3d -Isrc_cpp/base -Isrc_cpp/3d -Isrc_cpp/2d -Iinclude -I/home/users/me/opt/miniconda3/lib/python3.6/site-packages/numpy/core/include -c fluidfft/fft2d/fft2d_with_fftw1d.cpp -o build/temp.linux-x86_64-3.6/fluidfft/fft2d/fft2d_with_fftw1d.o

Aucun commentaire:

Enregistrer un commentaire