Compiling GMP 5.0.5

For discussion of the IRIX OS and the software ecosystem surrounding it, including troubleshooting.
Post Reply
User avatar
LarBob
Posts: 62
Joined: Mon Dec 25, 2017 4:08 pm
Location: Kentucky, United States
Contact:

Compiling GMP 5.0.5

Post by LarBob » Mon Jul 16, 2018 3:27 am

Hi, I'm trying to compile GMP 5.0.5 with GCC 4.3.1 and am running into a weird issue that I haven't run into before when compiling it on IRIX.

Code: Select all

../gmp-impl.h:189: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gmp_uint_least32_t'
There's not an issue with the gmp-impl header obviously, but I'm not exactly sure where the problem actually lies. Any suggestions?

Dev environment info:

Code: Select all

versions | grep compiler.dev
I  compiler_dev         07/16/2018  Base Compiler Development Environment, 7.4
I  compiler_dev.books   07/16/2018  Base Compiler Books
I  compiler_dev.books.MProAsLg_PG  07/16/2018  MIPSpro Assembly Language Programming Guide
I  compiler_dev.books.MProCplrDbx_TG  07/16/2018  MIPSpro N32/64 Compiling and Performance Tuning Guide
I  compiler_dev.books.MPro_n32_ABI  07/16/2018  MIPSpro N32 ABI Handbook
I  compiler_dev.books.Pragmas  07/16/2018  MIPSpro C/C++ Pragmas
I  compiler_dev.hdr     07/16/2018  Base Compiler Headers
I  compiler_dev.hdr.lib 07/16/2018  Base Compiler Headers
I  compiler_dev.man     07/16/2018  Base Compiler Manual Pages
I  compiler_dev.man.base  07/16/2018  Base Compiler Components Man Pages
I  compiler_dev.man.ld  07/16/2018  Base Compiler Loader Man Pages
I  compiler_dev.man.lib 07/16/2018  Base Compiler Programmers Man Pages
I  compiler_dev.man.relnotes  07/16/2018  Base Compiler Release Notes
I  compiler_dev.man.util  07/16/2018  Base Compiler Utility Man Pages
I  compiler_dev.sw      07/16/2018  Base Compiler Software
I  compiler_dev.sw.base 07/16/2018  Base Compiler Components
I  compiler_dev.sw.ld   07/16/2018  Base Compiler Loader
I  compiler_dev.sw.lib  07/16/2018  Base Compiler Libraries
I  compiler_dev.sw.util 07/16/2018  Base Compiler Utilities
I  compiler_dev.sw64    07/16/2018  Base Compiler Software
I  compiler_dev.sw64.lib  07/16/2018  Base Compiler Libraries 64bit
I  compiler_dev         07/15/2018  Base Compiler Development Environment, 7.3
I  compiler_dev.books   07/15/2018  Base Compiler Books
I  compiler_dev.books.MProPort_TG  07/15/2018  MIPSpro Porting and Transition Guide
:Octane: Aezora - Octane - 2xR10k 250 MHz - SI Graphics - 1 GB RAM - 6.5.30f
:O2: Kiki - O2 - R5k 180 MHz - 192 MB RAM - Currently dead
:O3x0-2: Calcifer - Origin 300 - 4xR14k 500 MHz - 2 GB RAM - 6.5.30m
:O3x0-2: Tohru - Origin 350 - 4xR16k 800 MHz - 4 GB RAM - 6.5.30m - on loan from Raion
Mirrors

jpstewart
Posts: 27
Joined: Wed May 23, 2018 11:19 am
Location: Southwestern Ontario, Canada

Re: Compiling GMP 5.0.5

Post by jpstewart » Mon Jul 16, 2018 11:30 am

Line 189 of gmp-impl.h (as mentioned in the error message) tries to typedef gmp_uint_least32_t to the operating system's uint_least32_t type. On IRIX that's defined in stdint.h but only for C99 mode. So if you're compiling C++ there's no uint_least32_t available.

Also, gmp-impl.h will prefer to use inttypes.h instead of stdint.h (lines 110 to 116) if both are available. On IRIX, inttypes.h doesn't define uint_least32_t at all, regardless of mode.

My solution (when compiling gmp-4.3.2 a few years ago) was to just pass ac_cv_type_uint_least32_t=no to configure before building GMP to force it to fall back to other code (gmp-impl.h lines 191 to 200). Fortunately, GMP is well-written in that regard! That work-around should also suffice for the version you're trying.
SGI: Indigo, Indigo2, Octane, Origin 300
Sun: SPARCstation 20, Ultra 2, Blade 2500, T5240
HP: 9000/380, 425e, C8000
Digital: DECstation 5000/125

User avatar
LarBob
Posts: 62
Joined: Mon Dec 25, 2017 4:08 pm
Location: Kentucky, United States
Contact:

Re: Compiling GMP 5.0.5

Post by LarBob » Mon Jul 16, 2018 12:58 pm

jpstewart wrote:
Mon Jul 16, 2018 11:30 am
Line 189 of gmp-impl.h (as mentioned in the error message) tries to typedef gmp_uint_least32_t to the operating system's uint_least32_t type. On IRIX that's defined in stdint.h but only for C99 mode. So if you're compiling C++ there's no uint_least32_t available.

Also, gmp-impl.h will prefer to use inttypes.h instead of stdint.h (lines 110 to 116) if both are available. On IRIX, inttypes.h doesn't define uint_least32_t at all, regardless of mode.

My solution (when compiling gmp-4.3.2 a few years ago) was to just pass ac_cv_type_uint_least32_t=no to configure before building GMP to force it to fall back to other code (gmp-impl.h lines 191 to 200). Fortunately, GMP is well-written in that regard! That work-around should also suffice for the version you're trying.
Hm, thank you, I'll try that. What's weird is that I didn't have to do that before when compiling it on another machine though...
:Octane: Aezora - Octane - 2xR10k 250 MHz - SI Graphics - 1 GB RAM - 6.5.30f
:O2: Kiki - O2 - R5k 180 MHz - 192 MB RAM - Currently dead
:O3x0-2: Calcifer - Origin 300 - 4xR14k 500 MHz - 2 GB RAM - 6.5.30m
:O3x0-2: Tohru - Origin 350 - 4xR16k 800 MHz - 4 GB RAM - 6.5.30m - on loan from Raion
Mirrors

Post Reply