Building GMPlib on Mac M1

Bjørn Christensen bhc at dyalog.com
Thu Nov 17 09:26:52 CET 2022


I think this is a red herring, it turns out that the nfs share has some kind of problem causing the compiler to generate empty object files at random.

 

 

Sorry for inconvenience. 

 

 

/bhc

 

From: Bjørn Christensen [mailto:bhc at dyalog.com] 
Sent: 15. november 2022 20:13
To: gmp-bugs at gmplib.org
Subject: Building GMPlib on Mac M1

 

 

Have downloaded gmp-6.2.1.

 

It seems that all the tests for different headers are failing eg fcntl.h , float.h

 

Resulting in errors when I make install.

 

set_str.c:132:24: error: implicit declaration of function 'localeconv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

  const char  *point = GMP_DECIMAL_POINT;

                       ^

../gmp-impl.h:4435:29: note: expanded from macro 'GMP_DECIMAL_POINT'

#define GMP_DECIMAL_POINT  (localeconv()->decimal_point)

                            ^

/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I..   -g -m64 -O2 -pedantic -fomit-frame-pointer  -mmacosx-version-min=10.10 -Werror=unguarded-availability -c -o sqrt.lo sqrt.c

set_str.c:132:24: error: member reference type 'int' is not a pointer

  const char  *point = GMP_DECIMAL_POINT;

                       ^~~~~~~~~~~~~~~~~

../gmp-impl.h:4435:43: note: expanded from macro 'GMP_DECIMAL_POINT'

#define GMP_DECIMAL_POINT  (localeconv()->decimal_point)

                            ~~~~~~~~~~~~  ^

/

 

 

Trying to configure with

 

CFLAGS="-g -m64 -O2 -pedantic -fomit-frame-pointer  -mmacosx-version-min=10.10 -Werror=unguarded-availability" ./configure --prefix=/Volumes/devt/users/bhc/tmp/congassl/mac-arm/64 --disable-shared --with-pic ABI=64

 

 

Output:

checking fcntl.h usability... no

checking fcntl.h presence... yes

configure: WARNING: fcntl.h: present but cannot be compiled

configure: WARNING: fcntl.h:     check for missing prerequisite headers?

configure: WARNING: fcntl.h: see the Autoconf documentation

configure: WARNING: fcntl.h:     section "Present But Cannot Be Compiled"

configure: WARNING: fcntl.h: proceeding with the compiler's result

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

configure: WARNING:     ## Report this to gmp-bugs at gmplib.org ##

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

checking for fcntl.h... no

checking float.h usability... no

checking float.h presence... yes

configure: WARNING: float.h: present but cannot be compiled

configure: WARNING: float.h:     check for missing prerequisite headers?

configure: WARNING: float.h: see the Autoconf documentation

configure: WARNING: float.h:     section "Present But Cannot Be Compiled"

configure: WARNING: float.h: proceeding with the compiler's result

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

configure: WARNING:     ## Report this to gmp-bugs at gmplib.org ##

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

checking for float.h... no

checking invent.h usability... no

checking invent.h presence... no

checking for invent.h... no

checking langinfo.h usability... no

checking langinfo.h presence... yes

configure: WARNING: langinfo.h: present but cannot be compiled

configure: WARNING: langinfo.h:     check for missing prerequisite headers?

configure: WARNING: langinfo.h: see the Autoconf documentation

configure: WARNING: langinfo.h:     section "Present But Cannot Be Compiled"

configure: WARNING: langinfo.h: proceeding with the compiler's result

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

configure: WARNING:     ## Report this to gmp-bugs at gmplib.org ##

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

checking for langinfo.h... no

checking locale.h usability... no

checking locale.h presence... yes

configure: WARNING: locale.h: present but cannot be compiled

configure: WARNING: locale.h:     check for missing prerequisite headers?

configure: WARNING: locale.h: see the Autoconf documentation

configure: WARNING: locale.h:     section "Present But Cannot Be Compiled"

configure: WARNING: locale.h: proceeding with the compiler's result

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

configure: WARNING:     ## Report this to gmp-bugs at gmplib.org ##

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

checking for locale.h... no

checking nl_types.h usability... no

checking nl_types.h presence... yes

configure: WARNING: nl_types.h: present but cannot be compiled

configure: WARNING: nl_types.h:     check for missing prerequisite headers?

configure: WARNING: nl_types.h: see the Autoconf documentation

configure: WARNING: nl_types.h:     section "Present But Cannot Be Compiled"

configure: WARNING: nl_types.h: proceeding with the compiler's result

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

configure: WARNING:     ## Report this to gmp-bugs at gmplib.org ##

configure: WARNING:     ## ssssssssssssssssssssssssssssssssss ##

checking for nl_types.h... no

 

Are there any suggestions on how to build gmp 6.2.1 on Mac M1? 

Is this only a problem for me?

 

I have created a small test program that includes the locale.h and that compiles fine. Also I have copied from the config.log the content of confdefs.h and included that with no problems.

 

/bhc

 

PS Notice I have created the confdefs.h from content in config.log.

 

 



More information about the gmp-bugs mailing list