darioizzo / audi

Header only, C++ library (and the Python pyaudi package) implementing the algebra of Taylor truncated polynomials and a few algorithms useful for its applications (Differential Intelligence, automatic differentiation, Taylor Models, etc.)
http://darioizzo.github.io/audi/
GNU General Public License v2.0
71 stars 18 forks source link

Build fails on i386: error: constraints not satisfied for class template 'd_packed_monomial' #62

Open yurivict opened 1 year ago

yurivict commented 1 year ago
===>  Building for py39-pyaudi-1.9.2.1
[ 33% 2/3] /usr/bin/c++ -DFMT_SHARED -DUSING_pybind11 -Dcore_EXPORTS -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/.. -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/.build/include/pyaudi -isystem /usr/local/include/python3.9 -isystem /usr/local/include -isystem /usr/local/include/eigen3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fPIC -fwrapv -pthread -std=c++20 -MD -MT CMakeFiles/core.dir/docstrings.cpp.o -MF CMakeFiles/core.dir/docstrings.cpp.o.d -o CMakeFiles/core.dir/docstrings.cpp.o -c /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/docstrings.cpp
[ 66% 2/3] /usr/bin/c++ -DFMT_SHARED -DUSING_pybind11 -Dcore_EXPORTS -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/.. -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/.build/include/pyaudi -isystem /usr/local/include/python3.9 -isystem /usr/local/include -isystem /usr/local/include/eigen3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fPIC -fwrapv -pthread -std=c++20 -MD -MT CMakeFiles/core.dir/core.cpp.o -MF CMakeFiles/core.dir/core.cpp.o.d -o CMakeFiles/core.dir/core.cpp.o -c /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp
FAILED: CMakeFiles/core.dir/core.cpp.o 
/usr/bin/c++ -DFMT_SHARED -DUSING_pybind11 -Dcore_EXPORTS -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/.. -I/wrkdirs/usr/ports/math/py-pyaudi/work-py39/.build/include/pyaudi -isystem /usr/local/include/python3.9 -isystem /usr/local/include -isystem /usr/local/include/eigen3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fPIC -fwrapv -pthread -std=c++20 -MD -MT CMakeFiles/core.dir/core.cpp.o -MF CMakeFiles/core.dir/core.cpp.o.d -o CMakeFiles/core.dir/core.cpp.o -c /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:1:
In file included from /usr/local/include/audi/audi.hpp:12:
In file included from /usr/local/include/audi/functions.hpp:14:
In file included from /usr/local/include/audi/gdual.hpp:29:
/usr/local/include/obake/polynomials/d_packed_monomial.hpp:1411:1: error: constraints not satisfied for class template 'd_packed_monomial' [with T = unsigned long long, PSize = 8]
using d_packed_monomial = polynomials::d_packed_monomial<T, PSize>;
^~~~~
/usr/local/include/audi/gdual.hpp:73:51: note: in instantiation of template type alias 'd_packed_monomial' requested here
template <typename Cf, typename Monomial = obake::d_packed_monomial<std::uint64_t, 8>>
                                                  ^
/usr/local/include/obake/polynomials/d_packed_monomial.hpp:83:11: note: because 'unsigned long long' does not satisfy 'kpackable'
template <kpackable T, unsigned PSize>
          ^
/usr/local/include/obake/kpack.hpp:155:21: note: because 'is_kpackable_v<unsigned long long>' evaluated to false
concept kpackable = is_kpackable_v<T>;
                    ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:1:
/usr/local/include/audi/audi.hpp:20:23: error: too few template arguments for class template 'gdual'
using gdual_d = audi::gdual<double>;
                      ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:1:
/usr/local/include/audi/audi.hpp:21:23: error: too few template arguments for class template 'gdual'
using gdual_v = audi::gdual<audi::vectorized<double>>;
                      ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:1:
/usr/local/include/audi/audi.hpp:22:23: error: too few template arguments for class template 'gdual'
using gdual_c = audi::gdual<std::complex<double>>;
                      ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:35:12: error: too few template arguments for class template 'gdual'
py::class_<gdual<T>> expose_gdual(const py::module &m, std::string type)
           ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:38:22: error: too few template arguments for class template 'gdual'
        = py::class_<gdual<T>>(m, ("gdual_" + type).c_str(), gdual_docstring().c_str())
                     ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:40:35: error: too few template arguments for class template 'gdual'
              .def(py::init<const gdual<T> &>())
                                  ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:44:29: error: too few template arguments for class template 'gdual'
                   [](const gdual<T> &g) -> std::string {
                            ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:50:29: error: too few template arguments for class template 'gdual'
                   [](const gdual<T> &g) -> std::string {
                            ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:59:28: error: too few template arguments for class template 'gdual'
                  [](const gdual<T> &p) { // __getstate__
                           ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:69:23: error: too few template arguments for class template 'gdual'
                      gdual<T> p;
                      ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:76:53: error: too few template arguments for class template 'gdual'
              .def_property_readonly("symbol_set", &gdual<T>::get_symbol_set)
                                                    ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:77:58: error: too few template arguments for class template 'gdual'
              .def_property_readonly("symbol_set_size", &gdual<T>::get_symbol_set_size)
                                                         ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:78:49: error: too few template arguments for class template 'gdual'
              .def_property_readonly("degree", &gdual<T>::degree, gdual_degree_docstring().c_str())
                                                ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:79:48: error: too few template arguments for class template 'gdual'
              .def_property_readonly("order", &gdual<T>::get_order, "truncation order (>= degree)")
                                               ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:80:29: error: too few template arguments for class template 'gdual'
              .def("info", &gdual<T>::info, "Full information on the gdual")
                            ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:81:42: error: too few template arguments for class template 'gdual'
              .def("extend_symbol_set", &gdual<T>::extend_symbol_set, "Extends the symbol set")
                                         ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:82:34: error: too few template arguments for class template 'gdual'
              .def("integrate", &gdual<T>::template integrate<>, "Integrate with respect to argument")
                                 ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
In file included from /wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/core.cpp:14:
/wrkdirs/usr/ports/math/py-pyaudi/work-py39/audi-1.9.2-1-g899eb78/pyaudi/expose_gdual.hpp:83:32: error: too few template arguments for class template 'gdual'
              .def("partial", &gdual<T>::template partial<>, "Partial derivative with respect to argument")
                               ^
/usr/local/include/audi/gdual.hpp:74:7: note: template is declared here
class gdual
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Revision: 1.9.2-1-g899eb78 clang-14 OS: FreeBSD 13.1

bluescarni commented 1 year ago

@yurivict This is a 32-bit environment right?

I think the issue is here:

/usr/local/include/audi/gdual.hpp:73:51: note: in instantiation of template type alias 'd_packed_monomial' requested here
template <typename Cf, typename Monomial = obake::d_packed_monomial<std::uint64_t, 8>>
                                                  ^
/usr/local/include/obake/polynomials/d_packed_monomial.hpp:83:11: note: because 'unsigned long long' does not satisfy 'kpackable'
template <kpackable T, unsigned PSize>
          ^

I believe that 32-bit environments do not offer 128-bit integers (__int128_t and __uint128_t), which are needed in order to use std::uint64_t in the d_packed_monomial class. Can you confirm?

yurivict commented 1 year ago

I believe that 32-bit environments do not offer 128-bit integers [...]

Yes. So it can't work in 32-bit environments?

If this is the case you should add a check either for a 32-bit environment, or for the presence of __int128_t and __uint128_t, and fail with an appropriate message.