Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite fails to build on 32bit #194

Open
mbanck opened this issue Oct 11, 2020 · 5 comments
Open

testsuite fails to build on 32bit #194

mbanck opened this issue Oct 11, 2020 · 5 comments

Comments

@mbanck
Copy link
Contributor

mbanck commented Oct 11, 2020

Trying to run make check on a 32bit systems fails to build the test programs:

make[3]: Entering directory '/<<PKGBUILDDIR>>/tests/eri'
g++ -M -c -DHAVE_CONFIG_H  -I../../src/bin -I../../include -I/<<PKGBUILDDIR>>/tests/eri/../../include -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin -I/usr/include/eigen3 -I/usr/include -I../../include -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin/libint -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri -I/<<PKGBUILDDIR>>/tests/eri/../../src/lib/libint -I../../src/bin/libint -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security   test.cc | sed 's/^test.o/test.o test.d/g' > test.d
g++ -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -DNDEBUG  -DHAVE_CONFIG_H  -I../../src/bin -I../../include -I/<<PKGBUILDDIR>>/tests/eri/../../include -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin -I/usr/include/eigen3 -I/usr/include -I../../include -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin/libint -I/<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri -I/<<PKGBUILDDIR>>/tests/eri/../../src/lib/libint -I../../src/bin/libint  -c -o test.o test.cc
In file included from /<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri/eri.h:31,
                 from test.cc:31:
../../include/libint2/boys.h: In member function ‘void libint2::TennoGmEval<Real>::init_table()’:
../../include/libint2/boys.h:1291:73: error: no matching function for call to ‘max(unsigned int, long unsigned int)’
 1291 |         int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
      |                                                                         ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from test.cc:24:
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  222 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:222:5: note:   template argument deduction/substitution failed:
In file included from /<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri/eri.h:31,
                 from test.cc:31:
../../include/libint2/boys.h:1291:73: note:   deduced conflicting types for parameter ‘const _Tp’ (‘unsigned int’ and ‘long unsigned int’)
 1291 |         int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
      |                                                                         ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from test.cc:24:
/usr/include/c++/9/bits/stl_algobase.h:268:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  268 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:268:5: note:   template argument deduction/substitution failed:
In file included from /<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri/eri.h:31,
                 from test.cc:31:
../../include/libint2/boys.h:1291:73: note:   deduced conflicting types for parameter ‘const _Tp’ (‘unsigned int’ and ‘long unsigned int’)
 1291 |         int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
      |                                                                         ^
In file included from /usr/include/c++/9/algorithm:62,
                 from ../../include/libint2/util/vector.h:28,
                 from ../../include/libint2/libint2_types.h:24,
                 from ../../include/libint2/util/generated/libint2_types.h:26,
                 from ../../include/libint2.h:35,
                 from test.cc:29:
/usr/include/c++/9/bits/stl_algo.h:3456:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)’
 3456 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
In file included from /<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri/eri.h:31,
                 from test.cc:31:
../../include/libint2/boys.h:1291:73: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘unsigned int’
 1291 |         int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
      |                                                                         ^
In file included from /usr/include/c++/9/algorithm:62,
                 from ../../include/libint2/util/vector.h:28,
                 from ../../include/libint2/libint2_types.h:24,
                 from ../../include/libint2/util/generated/libint2_types.h:26,
                 from ../../include/libint2.h:35,
                 from test.cc:29:
/usr/include/c++/9/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
 3462 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3462:5: note:   template argument deduction/substitution failed:
In file included from /<<PKGBUILDDIR>>/tests/eri/../../src/bin/test_eri/eri.h:31,
                 from test.cc:31:
../../include/libint2/boys.h:1291:73: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘unsigned int’
 1291 |         int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
      |                                                                         ^
make[3]: *** [<builtin>: test.o] Error 1

See e.g. https://buildd.debian.org/status/fetch.php?pkg=libint2&arch=armhf&ver=2.6.0-2&stamp=1579049562&raw=0 or https://buildd.debian.org/status/fetch.php?pkg=libint2&arch=i386&ver=2.6.0-2&stamp=1579037869&raw=0 for the full build log.

@mbanck
Copy link
Contributor Author

mbanck commented Oct 13, 2020

I've fixed it like that, not sure whether that's the right fix:

--- ./include/libint2/boys.h.orig	2020-10-11 23:15:59.685939261 +0200
+++ ./include/libint2/boys.h	2020-10-11 23:16:08.674430894 +0200
@@ -1288,7 +1288,7 @@
 
         // get memory
         void* result;
-        int status = posix_memalign(&result, std::max(sizeof(Real), 32ul), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
+        int status = posix_memalign(&result, std::max(sizeof(Real), std::size_t(32)), (mmax_ - mmin_ + 1) * cheb_table_nintervals * ORDERp1 * ORDERp1 * sizeof(Real));
         if (status != 0) {
           if (status == EINVAL)
             throw std::logic_error(

@junghans
Copy link

On openSUSE i586, a simple program:

#include <libint2.hpp>
int main(){return 0;}

fails with the same error.

@mbanck
Copy link
Contributor Author

mbanck commented Jan 19, 2021

@junghans in case you patched it up somehow, does the testsuite then actually run on 32bit on openSUSE?

Oh, I see you dropped 32bit, ok

@junghans
Copy link

The test suite fails with:

make[1]: *** No rule to make target '-lint2', needed by 'test'.  Stop.
[22679s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/libint-2.6.0/tests/eri'
[22679s] make: *** [Makefile:107: check] Error 1

@mbanck
Copy link
Contributor Author

mbanck commented Jan 20, 2021

Right, I am running it like this, I guess I had the same issue:

$(MAKE) -k check LD_LIBRARY_PATH=$(CURDIR)/lib/.libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants