Problems with configure script for gmp when cross-compiling for BlueGene/L

I.Gutheil i.gutheil at fz-juelich.de
Wed Sep 27 16:57:30 CEST 2006


Hello,

I tried to compile the GMP library for an IBM BlueGene/L and run into 
expected problems: The BlueGene/L consists of a front-end, IBM ppc64 ...
and a back-end, the BlueGene/L system with powerpc440 processors. As
powerpc440 is not included in the host list, I have to configure with 
--host='none-ibm-linux'
The compilers for the front-end and the back-end are different, so I 
gave the options CC=mpcc (this is a local shortcut for blrts_xlc -I... 
-L...) CC_FOR_BUILD=/usr/bin/xlc as the compiler for the front-end is 
/usr/bin/xlc.

Although the documentation says that the configure-script avoids 
executing programs this is not true.
When the configure script tests for size of unsigned short, it runs 
./conftest, and a program compiled with the compiler for the back-end 
cannot be run on the front-end. It has to be run with mpirun even if it 
is a sequential program.

Up to now I only saw one configure script with an option to run the 
programs configure needs to test some properties of the system as a 
batch-program. This is the configure script for PETSc. Here it is really 
necessary as almost all parallel systems run in batch-mode only. The 
solution there is that the executable is created, the user gets a message:
================================================================================= 

     Since your compute nodes require use of a batch system or mpirun 
you must:
  1) Submit ./conftest to 1 processor of your batch system; this will 
generate the file reconfigure
  2) Run "python reconfigure" (to complete the configure process). 

================================================================================= 


Is it possible to install such an option to run the executable via 
mpirun or any other command if an option --batch='true' or something 
like that is given?
I now cannot go on with the configure as I do not know where to change 
the configure script to prevent it from saying ./conftest and then  get
configure:30851: ./conftest
configure:30854: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.2"
| #define PACKAGE_STRING "GNU MP 4.2"
| #define PACKAGE_BUGREPORT "gmp-bugs at swox.com"
| #define PACKAGE "gmp"
| #define VERSION "4.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_none 1
| #define PROTOTYPES 1
| #define __PROTOTYPES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STRING_H 1
| #define STDC_HEADERS 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_NL_TYPES_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_SYSINFO_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_DECL_FGETC 1
| #define HAVE_DECL_FSCANF 1
| #define HAVE_DECL_OPTARG 1
| #define HAVE_DECL_UNGETC 1
| #define HAVE_DECL_VFPRINTF 1
| #define HAVE_DECL_SYS_ERRLIST 0
| #define HAVE_DECL_SYS_NERR 0
| #define RETSIGTYPE void
| #define HAVE_INTMAX_T 1
| #define HAVE_LONG_DOUBLE 1
| #define HAVE_LONG_LONG 1
| #define HAVE_PTRDIFF_T 1
| #define HAVE_QUAD_T 1
| #define HAVE_UINT_LEAST32_T 1
| #define HAVE_STRINGIZE 1
| #define restrict __restrict
| #define HAVE_STDARG 1
| #define HAVE_ATTRIBUTE_CONST 1
| #define HAVE_ATTRIBUTE_MALLOC 1
| #define HAVE_ATTRIBUTE_MODE 1
| #define HAVE_ATTRIBUTE_NORETURN 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define WANT_TMP_ALLOCA 1
| #define HAVE_LIMB_BIG_ENDIAN 1
| #define HAVE_DOUBLE_IEEE_BIG_ENDIAN 1
| #define HAVE_ALARM 1
| #define HAVE_CLOCK 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_GETRUSAGE 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_LOCALECONV 1
| #define HAVE_MEMSET 1
| #define HAVE_NL_LANGINFO 1
| #define HAVE_OBSTACK_VPRINTF 1
| #define HAVE_POPEN 1
| #define HAVE_RAISE 1
| #define HAVE_SIGACTION 1
| #define HAVE_STRCHR 1
| #define HAVE_STRERROR 1
| #define HAVE_STRNLEN 1
| #define HAVE_STRTOL 1
| #define HAVE_STRTOUL 1
| #define HAVE_SYSCONF 1
| #define HAVE_TIMES 1
| #define HAVE_VSNPRINTF 1
| #define GMP_MPARAM_H_SUGGEST "./mpn/generic/gmp-mparam.h"
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| long longval () { return (long) (sizeof (unsigned short)); }
| unsigned long ulongval () { return (long) (sizeof (unsigned short)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
|
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     exit (1);
|   if (((long) (sizeof (unsigned short))) < 0)
|     {
|       long i = longval ();
|       if (i != ((long) (sizeof (unsigned short))))
| 	exit (1);
|       fprintf (f, "%ld\n", i);
|     }
|   else
|     {
|       unsigned long i = ulongval ();
|       if (i != ((long) (sizeof (unsigned short))))
| 	exit (1);
|       fprintf (f, "%lu\n", i);
|     }
|   exit (ferror (f) || fclose (f) != 0);
|
|   ;
|   return 0;
| }
configure:30864: error: cannot compute sizeof (unsigned short), 77

You see the problem is not that a program cannot compute the sizeof int 
but that a program compiled for BlueGene/L cannot be run on the 
front-end for this machine. And even if it could it would not make sense 
as the sizeof .. of BlueGene is to be found and not the one on the 
front-end.

Thanks for any help
Inge Gutheil


--

****************************************************************************
Inge Gutheil, Forschungszentrum Juelich GmbH, ZAM
52425 Juelich
Phone: +49 2461 61-3135, FAX: +49 2461 61-6656, E-mail: 
i.gutheil at fz-juelich.de
****************************************************************************



More information about the gmp-bugs mailing list