dftlibs / xcfun

XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives
https://dftlibs.org/xcfun/
Mozilla Public License 2.0
57 stars 32 forks source link

xcfun does not build on 32-bit architectures #152

Closed susilehtola closed 3 years ago

susilehtola commented 3 years ago

Builds of xcfun fail on i686 and arm7hl architectures in Fedora.

The reason is broken C++ code:

/builddir/build/BUILD/xcfun-2.1.1/python/export_xcfun.cpp: In lambda function:
/builddir/build/BUILD/xcfun-2.1.1/python/export_xcfun.cpp:145:44: error: call of overloaded 'array_t(<brace-enclosed initializer list>)' is ambiguous
  145 |                   {{nr_points, output_len}});
      |                                            ^
In file included from /builddir/build/BUILD/xcfun-2.1.1/python/export_xcfun.cpp:15:
/usr/include/pybind11/numpy.h:865:14: note: candidate: 'pybind11::array_t<T, ExtraFlags>::array_t(pybind11::array::ShapeContainer, const T*, pybind11::handle) [with T = double; int ExtraFlags = 17; pybind11::array::ShapeContainer = pybind11::detail::any_container<int>]'
  865 |     explicit array_t(ShapeContainer shape, const T *ptr = nullptr, handle base = handle())
      |              ^~~~~~~
/usr/include/pybind11/numpy.h:835:64: note: candidate: 'pybind11::array_t<double, 17>::array_t(const pybind11::array_t<double, 17>&)'
  835 | template <typename T, int ExtraFlags = array::forcecast> class array_t : public array {
      |                                                                ^~~~~~~
/usr/include/pybind11/numpy.h:835:64: note: candidate: 'pybind11::array_t<double, 17>::array_t(pybind11::array_t<double, 17>&&)'

The same issue exists on

bast commented 3 years ago

Thanks! I will try to reproduce. (I will have a bit more time next week)

susilehtola commented 3 years ago

@bast any progress?

bast commented 3 years ago

I am unsure how to reproduce it. I am also surprised that 32 bit releases still exist. Again, not saying that the problem isn't there but it would help me debugging it if I could see it locally. Any idea how?

susilehtola commented 3 years ago

In Fedora, you can just use mock to run builds in chroots.

susilehtola commented 3 years ago

Or, you can try building xcfun with g++ -m32 to force a 32-bit build

susilehtola commented 3 years ago

@bast any progress?

bast commented 3 years ago

Back from vacation ... I will discuss this with Roberto this week to unblock this. Thanks for your patience.

bast commented 3 years ago

In Fedora, you can just use mock to run builds in chroots.

I might need a bit more help here to describe how to use "mock" in chroots.

The easiest for me is if you can provide me with:

Setting -m32 is not so easy since CMake sets -m64 on top of it.

Is it an option that we define/decide that XCFun does not support 32-bit architecture?

Maybe we can schedule a call together where we debug this on screenshare?

susilehtola commented 3 years ago

I've launched a new scratch build at https://koji.fedoraproject.org/koji/taskinfo?taskID=75327017 from which you can see all flags and commands.

susilehtola commented 3 years ago

Ideally one would like to fix the issue, since cross-platform compatibility is generally a good thing. I am in Finland for September, so we can also schedule a call if necessary.

susilehtola commented 3 years ago

Roberto's patch fixes the issue.

robertodr commented 3 years ago

@susilehtola Thanks for your extreme patience. Give me one day to mint a new release: I'd like to get #156 in too, so that tests on Windows can run too.

susilehtola commented 3 years ago

No need for a new release, I've already built new packages.

bast commented 3 years ago

Really glad the issues got solved.