## Compilation failure on 32-bit

Discussions on installation issues go here.

Moderator: Moderators

jamesjer
Posts: 26
Joined: 01 Mar 2012, 16:51

### Compilation failure on 32-bit

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.

gawrilow
Main Author
Posts: 308
Joined: 25 Dec 2010, 17:40

### Re: Compilation failure on 32-bit

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.

jamesjer
Posts: 26
Joined: 01 Mar 2012, 16:51

### Re: Compilation failure on 32-bit

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:
Makefile:186: recipe for target 'release-docs' failed

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

gawrilow
Main Author
Posts: 308
Joined: 25 Dec 2010, 17:40

### Re: Compilation failure on 32-bit

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?

blorenz
Developer
Posts: 108
Joined: 10 Jan 2011, 17:21

### Re: Compilation failure on 32-bit

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.

jamesjer
Posts: 26
Joined: 01 Mar 2012, 16:51

### Re: Compilation failure on 32-bit

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.