Page 1 of 1

Compilation failure on 32-bit

Posted: 27 Sep 2015, 18:18
by jamesjer
Thank you for the 2.14r1 release, which has fixed the perl 5.22 issue on x86_64. Unfortunately, the build is now broken on i386. A little investigation shows that the problem is some integer constants that do not fit into a 32-bit perl integer, namely the first two of these constants from perllib/Polymake/Overload.pm:

Code: Select all

use Polymake::Enum qw( has_trailing_list=1<<48 has_keywords=1<<47 has_repeated=1<<31 num_args_mask=(1<<31)-1 has_final_typecheck_sub=1 has_typecheck_object=2 has_typecheck_sub=4 );
Do you have any suggestions on how to fix this problem? There is some urgency here, as polymake is about to be evicted from the set of packages going into Fedora 23, because the build is still broken (starting with the release of perl 5.22). Thank you.

Re: Compilation failure on 32-bit

Posted: 27 Sep 2015, 23:23
by gawrilow
So you want to tell us the nice news that perl in Fedora is built "without 64-bit support"? Usually integer values in perl are 64-bit regardless of the executable format, unless the platform nor the C library support them.

As a quick fix, you can try to replace the values 48, 47, 31 with 31, 30, 29 correspondingly.
We will try it out as well on our test farm; we have all possible perl versions there, but all configured for 64-bit platforms.

Re: Compilation failure on 32-bit

Posted: 01 Oct 2015, 05:42
by jamesjer
Yes, I'm afraid that 32-bit perl on Fedora has only 32-bit integers. That seems to go back a long way: https://bugzilla.redhat.com/show_bug.cgi?id=168373. That's a very old bug. I can ask the perl maintainers to reconsider. I can make a stronger case with some facts. What 32-bit platforms have you encountered where perl has 64-bit native integers?

Replacing 48, 47, 31 with 31, 30, 29 resulted in this:
polymake: ERROR: "/builddir/build/BUILD/polymake-2.14r1/apps/common/rules/basic_types", line 44: ambiguous overloading for construct(Polymake::common::Text)
Makefile:186: recipe for target 'release-docs' failed

I will try a few experiments to see if I can find a workaround.

Re: Compilation failure on 32-bit

Posted: 01 Oct 2015, 15:43
by gawrilow
I haven't worked on a 32-bit Linux system for years, so unfortunately I can't supply you with concrete examples. I just looked into the perl Configure and saw that it tries to enable 64-bit integers even if the native machine int is 32-bit - presumably, by calling some library functions for arithmetic operations, but still better than nothing...

Regarding your failure: I can't reproduce it, in our test farm all perl versions successfully ran all tests, including documentation generation. I hope you've replaced both occurrences of 31 with 29?

Re: Compilation failure on 32-bit

Posted: 02 Oct 2015, 23:56
by blorenz
After setting up a 32bit VM that will hopefully soon be included in our tests I was able to reproduce the error and it seems you need to reduce the numbers one further to make it work:

Code: Select all

use Polymake::Enum qw( has_trailing_list=1<<30 has_keywords=1<<29 has_repeated=1<<28 num_args_mask=(1<<28)-1
Benjamin

PS: The reason is that the numbers are treated as signed because 'use integer' is active and thus (on a perl without 64bitint):

Code: Select all

$ perl -e 'use integer; print 1<<31;' -2147483648
Which causes problems in some comparisons.

Re: Compilation failure on 32-bit

Posted: 03 Oct 2015, 17:12
by jamesjer
Thank you very much, Benjamin. That worked indeed. I will lobby Fedora's perl package maintainers to build 32-bit perl with 64-bit native integer support, so we can avoid such problems in the future.