This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: configure script cannot detect float word ordering on linux
Type: compile error Stage:
Components: Installation Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, sourish.basu
Priority: normal Keywords:

Created on 2021-10-14 21:19 by sourish.basu, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
config.log sourish.basu, 2021-10-16 16:27
conftest.o sourish.basu, 2021-10-20 13:23
conftest.c sourish.basu, 2021-10-20 13:23
conftest_unoptimized.o sourish.basu, 2021-10-20 14:08
Messages (12)
msg403951 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-14 21:19
I am trying to compile Python 3.10.0 on a Red Hat linux system with intel C/C++ compilers. This is my configure command:

```
./configure --with-computed-gotos --without-gcc --with-ensurepip=install --enable-optimizations --with-libm=-limf --with-cxx-main=icpc --with-threads --enable-ipv6 --with-signal-module CC=icc CXX=icpc LD=xild AR=xiar LIBS='-lpthread -limf -lirc' CFLAGS='-O3 -fPIC -fp-model strict -fp-model source -axCORE-AVX512,CORE-AVX2 -xAVX -ipo -prec-div -prec-sqrt' LDFLAGS='-ipo' CPP='icc -E'
```

The failure comes as follows:

```
checking for --with-libm=STRING... set LIBM="-limf"
checking for --with-libc=STRING... default LIBC=""
checking for x64 gcc inline assembler... yes
checking whether float word ordering is bigendian... unknown
configure: error:

Unknown float word ordering. You need to manually preset
ax_cv_c_float_words_bigendian=no (or yes) according to your system.
```

I saw issue 38527 was fixed in 3.10. Perhaps fixing it on Solaris broke it on some other platforms?
msg403978 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-10-15 07:18
Python uses the AX_C_FLOAT_WORDS_BIGENDIAN macro from autoconf-archive to detect byte order of floats. You can find the code at https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html .

Please attach your config.log file and the conftest.o output file of the follow command:

$ cat > conftest.c << EOF
double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
EOF
$ icc -c conftest.c
msg404096 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-16 16:27
See attached my config log.

When I tried to compile conftest.c with 'icc -c conftest.c', it produced 'conftest.o' without any errors.
msg404135 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-10-17 10:56
Please build conftest.o with compiler flags 

    icc -c -O3 -fPIC -fp-model strict -fp-model source -axCORE-AVX512,CORE-AVX2 -xAVX -ipo -prec-div -prec-sqrt 

and attach the file.
msg404138 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-17 13:25
I executed:

$ icc -c -O3 -fPIC -fp-model strict -fp-model source -axCORE-AVX512,CORE-AVX2 -xAVX -ipo -prec-div -prec-sqrt conftest.c

and conftest.o was built without errors. It has one symbol, as expected:

$ nm conftest.o
                 U __must_be_linked_with_icc_or_xild
0000000000000000 D d
msg404447 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-10-20 13:20
Please upload and attach the .o file to this bug. I need to see the content of the file.
msg404448 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-20 13:23
conftest.o attached
msg404449 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-20 13:23
conftest.c attached
msg404450 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-10-20 13:43
Your conftest.o does not contain the magic string "seesnoon". Either ICC uses a different serialization format or your CFLAGS optimize the value away.

Please run 

   icc -c -o conftest_unoptimized.o conftest.c

and upload "conftest_unoptimized.o".
msg404459 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-20 14:08
conftest_unoptimized.o uploaded
msg404463 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-10-20 14:25
One of your optimization flags breaks the AX_C_FLOAT_WORDS_BIGENDIAN macro. The optimized object file does not have seesnoon in its data section.

$ objdump -x conftest.o conftest_unoptimized.o 

conftest.o:     file format elf64-x86-64
conftest.o
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 __ildata      000004eb  0000000000000000  0000000000000000  00000118  2**0
                  CONTENTS, READONLY, EXCLUDE
  1 .data         00000008  0000000000000000  0000000000000000  00000608  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  2 .note.GNU-stack 00000000  0000000000000000  0000000000000000  00000610  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000 conftest.c
0000000000000000 l    d  __ildata       0000000000000000 __ildata
0000000000000000 l    d  .data  0000000000000000 .data
0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
0000000000000000 g     O .data  0000000000000008 d
0000000000000000         *UND*  0000000000000000 __must_be_linked_with_icc_or_xild


RELOCATION RECORDS FOR [.data]:
OFFSET           TYPE              VALUE 
0000000000000000 R_X86_64_64       __must_be_linked_with_icc_or_xild



conftest_unoptimized.o:     file format elf64-x86-64
conftest_unoptimized.o
architecture: i386:x86-64, flags 0x00000010:
HAS_SYMS
start address 0x0000000000000000

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .data         00000008  0000000000000000  0000000000000000  000000f8  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  1 .bss          00000000  0000000000000000  0000000000000000  00000100  2**2
                  ALLOC
  2 .text         00000000  0000000000000000  0000000000000000  00000100  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .note.GNU-stack 00000000  0000000000000000  0000000000000000  00000100  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000 conftest.c
0000000000000000 l    d  .data  0000000000000000 .data
0000000000000000 l    d  .bss   0000000000000000 .bss
0000000000000000 l    d  .text  0000000000000000 .text
0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
0000000000000000 g     O .data  0000000000000008 d



$ readelf -x .data conftest.o conftest_unoptimized.o 

File: conftest.o

Hex dump of section '.data':
 NOTE: This section has relocations against it, but these have NOT been applied to this dump.
  0x00000000 00000000 00000000                   ........


File: conftest_unoptimized.o

Hex dump of section '.data':
  0x00000000 73656573 6e6f6f6e                   seesnoon
msg404836 - (view) Author: Sourish Basu (sourish.basu) Date: 2021-10-22 22:49
By enabling and disabling optimization flags one by one, I figured out it was '-ipo' (inter-procedural optimization) that was the problem. Without that flag, 'configure' is successful. However, now I have a 'make' error:

./Programs/_testembed.c(1774): error: "__builtin_types_compatible_p" is only allowed in C
          config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv);
                                   ^

compilation aborted for ./Programs/_testembed.c (code 2)
make[3]: *** [Programs/_testembed.o] Error 2
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89640
2021-10-22 22:49:31sourish.basusetmessages: + msg404836
2021-10-20 14:25:32christian.heimessetmessages: + msg404463
2021-10-20 14:08:43sourish.basusetfiles: + conftest_unoptimized.o

messages: + msg404459
2021-10-20 13:43:31christian.heimessetmessages: + msg404450
2021-10-20 13:23:53sourish.basusetfiles: + conftest.c

messages: + msg404449
2021-10-20 13:23:38sourish.basusetfiles: + conftest.o

messages: + msg404448
2021-10-20 13:20:44christian.heimessetmessages: + msg404447
2021-10-17 13:25:22sourish.basusetmessages: + msg404138
2021-10-17 10:56:43christian.heimessetmessages: + msg404135
2021-10-16 16:27:32sourish.basusetfiles: + config.log

messages: + msg404096
2021-10-15 07:18:23christian.heimessetnosy: + christian.heimes
messages: + msg403978
2021-10-14 21:19:53sourish.basucreate