Building on Arch Linux with gcc 12.2.0 and mpfr 4.1.0 produces the error below.
Updating include/mpreal.h from https://github.com/advanpix/mpreal seems to fix this.
(venv) t490:smcpp $ python -m build
...
<snip long irrelevant stuff>
...
running build_ext
building 'smcpp._smcpp' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/smcpp
creating build/temp.linux-x86_64-cpython-310/src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug -flto=auto -fPIC -I/tmp/build-env-hou20_3y/lib/python3.10/site-packages/numpy/core/include -Iinclude -Iinclude/eigen3 -I/tmp/build-env-hou20_3y/include -I/usr/include/python3.10 -c smcpp/_smcpp.cpp -o build/temp.linux-x86_64-cpython-310/smcpp/_smcpp.o -O2 -std=c++11 -Wno-deprecated-declarations -Wno-int-in-bool-context -DNO_CHECK_NAN -fopenmp -DEIGEN_DONT_PARALLELIZE
In file included from /tmp/build-env-hou20_3y/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969,
from /tmp/build-env-hou20_3y/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /tmp/build-env-hou20_3y/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from smcpp/_smcpp.cpp:647:
/tmp/build-env-hou20_3y/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
In file included from include/mpreal.h:121,
from include/common.h:12,
from smcpp/_smcpp.cpp:639:
include/mpreal.h: In copy constructor ‘mpfr::mpreal::mpreal(const mpfr::mpreal&)’:
include/mpreal.h:582:27: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
582 | mpfr_init2(mpfr_ptr(),mpfr_get_prec(u.mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:582:27: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
582 | mpfr_init2(mpfr_ptr(),mpfr_get_prec(u.mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:583:5: error: expected ‘;’ before ‘_p’
583 | mpfr_set (mpfr_ptr(),u.mpfr_srcptr(),mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:583:5: error: invalid use of non-static member function ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
583 | mpfr_set (mpfr_ptr(),u.mpfr_srcptr(),mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:316:19: note: declared here
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:583:5: error: ‘_p’ was not declared in this scope; did you mean ‘mp’?
583 | mpfr_set (mpfr_ptr(),u.mpfr_srcptr(),mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h: In constructor ‘mpfr::mpreal::mpreal(const __mpfr_struct*, bool)’:
include/mpreal.h:614:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(const __mpfr_struct*&)’
614 | mpfr_init2(mpfr_ptr(), mpfr_get_prec(u));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:614:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(const __mpfr_struct*&)’
614 | mpfr_init2(mpfr_ptr(), mpfr_get_prec(u));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:615:9: error: expected ‘;’ before ‘_p’
615 | mpfr_set (mpfr_ptr(), u, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:615:9: error: invalid use of non-static member function ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
615 | mpfr_set (mpfr_ptr(), u, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:316:19: note: declared here
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:615:9: error: ‘_p’ was not declared in this scope; did you mean ‘mp’?
615 | mpfr_set (mpfr_ptr(), u, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h: In member function ‘mpfr::mpreal& mpfr::mpreal::operator=(const mpfr::mpreal&)’:
include/mpreal.h:919:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
919 | mp_prec_t tp = mpfr_get_prec( mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:919:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
919 | mp_prec_t tp = mpfr_get_prec( mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:920:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
920 | mp_prec_t vp = mpfr_get_prec(v.mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:920:32: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
920 | mp_prec_t vp = mpfr_get_prec(v.mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:927:9: error: expected ‘;’ before ‘_p’
927 | mpfr_set(mpfr_ptr(), v.mpfr_srcptr(), mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:927:9: error: invalid use of non-static member function ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
927 | mpfr_set(mpfr_ptr(), v.mpfr_srcptr(), mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:316:19: note: declared here
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:927:9: error: ‘_p’ was not declared in this scope; did you mean ‘mp’?
927 | mpfr_set(mpfr_ptr(), v.mpfr_srcptr(), mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h: In member function ‘mpfr::mpreal& mpfr::mpreal::operator=(const char*)’:
include/mpreal.h:1041:19: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
1041 | mpfr_init2(t, mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1041:19: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
1041 | mpfr_init2(t, mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1045:9: error: expected ‘;’ before ‘_p’
1045 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:1045:9: error: invalid use of non-static member function ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1045 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:316:19: note: declared here
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:1045:9: error: ‘_p’ was not declared in this scope; did you mean ‘mp’?
1045 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h: In member function ‘mpfr::mpreal& mpfr::mpreal::operator=(const std::string&)’:
include/mpreal.h:1064:19: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
1064 | mpfr_init2(t, mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1064:19: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
1064 | mpfr_init2(t, mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1068:9: error: expected ‘;’ before ‘_p’
1068 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:1068:9: error: invalid use of non-static member function ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1068 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h:316:19: note: declared here
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:1068:9: error: ‘_p’ was not declared in this scope; did you mean ‘mp’?
1068 | mpfr_set(mpfr_ptr(), t, mpreal::get_default_rnd());
| ^~~~~~~~
include/mpreal.h: In member function ‘bool mpfr::mpreal::toBool() const’:
include/mpreal.h:1720:83: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1720 | inline bool mpreal::toBool ( ) const { return mpfr_zero_p (mpfr_srcptr()) == 0; }
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
316 | ::mpfr_srcptr mpfr_srcptr() const;
| ^~~~~~~~~~~
include/mpreal.h:316:19: note: candidate expects 0 arguments, 1 provided
include/mpreal.h: In member function ‘std::string mpfr::mpreal::toString(int, int, mpfr_rnd_t) const’:
include/mpreal.h:1773:49: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1773 | int digits = (n >= 0) ? n : 1 + bits2digits(mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1773:49: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1773 | int digits = (n >= 0) ? n : 1 + bits2digits(mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h: In member function ‘int mpfr::mpreal::getPrecision() const’:
include/mpreal.h:1956:16: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1956 | return int(mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1956:16: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1956 | return int(mpfr_get_prec(mpfr_srcptr()));
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h: In member function ‘mpfr_prec_t mpfr::mpreal::get_prec() const’:
include/mpreal.h:1995:12: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1995 | return mpfr_get_prec(mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:1995:12: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr) const’
1995 | return mpfr_get_prec(mpfr_srcptr());
| ^~~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h: In member function ‘mp_exp_t mpfr::mpreal::get_exp()’:
include/mpreal.h:2006:12: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
2006 | return mpfr_get_exp(mpfr_srcptr());
| ^~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
include/mpreal.h:2006:12: error: no matching function for call to ‘mpfr::mpreal::mpfr_srcptr(mpfr_srcptr)’
2006 | return mpfr_get_exp(mpfr_srcptr());
| ^~~~~~~~~~~~
include/mpreal.h:1731:23: note: candidate: ‘const __mpfr_struct* mpfr::mpreal::mpfr_srcptr() const’
1731 | inline ::mpfr_srcptr mpreal::mpfr_srcptr() const { return mp; }
| ^~~~~~
include/mpreal.h:1731:23: note: candidate expects 0 arguments, 1 provided
smcpp/_smcpp.cpp: In function ‘PyObject* __pyx_pf_5smcpp_6_smcpp_19_PyInferenceManager_6Q(__pyx_obj_5smcpp_6_smcpp__PyInferenceManager*, PyObject*)’:
smcpp/_smcpp.cpp:8258:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1> > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
8258 | for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_15; __pyx_t_5+=1) {
| ~~~~~~~~~~^~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
ERROR Backend subprocess exited when trying to invoke build_wheel
Building on Arch Linux with gcc 12.2.0 and mpfr 4.1.0 produces the error below. Updating
include/mpreal.h
from https://github.com/advanpix/mpreal seems to fix this.