Compiling GMP 5.0.5 -
LarBob - 07-16-2018
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:
../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:
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
Re: Compiling GMP 5.0.5 -
jpstewart - 07-16-2018
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.
Re: Compiling GMP 5.0.5 -
LarBob - 07-16-2018
<QUOTE author="jpstewart" post_id="1543" time="1531755020" user_id="129">
jpstewart post_id=1543 time=1531755020 user_id=129 Wrote: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...