-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure script cannot detect float word ordering on linux #89640
Comments
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:
The failure comes as follows:
I saw bpo-38527 was fixed in 3.10. Perhaps fixing it on Solaris broke it on some other platforms? |
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 |
See attached my config log. When I tried to compile conftest.c with 'icc -c conftest.c', it produced 'conftest.o' without any errors. |
Please build conftest.o with compiler flags
and attach the file. |
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 |
Please upload and attach the .o file to this bug. I need to see the content of the file. |
conftest.o attached |
conftest.c attached |
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". |
conftest_unoptimized.o uploaded |
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 Sections: RELOCATION RECORDS FOR [.data]: conftest_unoptimized.o: file format elf64-x86-64 Sections: $ readelf -x .data conftest.o conftest_unoptimized.o File: conftest.o Hex dump of section '.data': File: conftest_unoptimized.o Hex dump of section '.data': |
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 compilation aborted for ./Programs/_testembed.c (code 2) |
Closing as this is not a CPython issue but rather a compiler bug and icc is not supported as per PEP 11. |
Author of the AX_C_FLOAT_WORDS_BIGENDIAN macro here. I committed a permanent fix to this issue in |
Pinging @tiran; without the updated macro, float word ordering won't be detected if e.g. -flto is present in one's CFLAGS. |
There is a CI job that verifies generated files (autoconf-related and some others) match those found on ubuntu 22.04: cpython/.github/workflows/build.yml Line 121 in 681778c
As a result, CPython may need to wait for a new autoconf-archive Ubuntu package that includes the fix (autoconf-archive/autoconf-archive#279) |
Was this included in Autoconf 2.71, or must we upgrade to Autoconf 2.72? |
It's in autoconf-archive, which is a separate collection of autoconf macros, namespaced |
Ah, yes of course. Unless Ubuntu 22.04 upgrades autoconf-archive, we'd have to explicitly force |
Could you also backport the fix for emscripten? It would be helpful for me. |
…ython#126387) Properly detect float word ordering on Linux (pythongh-125571) autoconf-archive patch by Dan Amelang. (cherry picked from commit 26d6277) Hardcode WASM float word ordering to little endian (pythongh-126387) (cherry picked from commit 532fc08)
I created the following backports:
These include both the autoconf-archive patch and the Emscripten workaround |
Thanks! |
…float word order Before python#126387, if we didn't detect float word order we'd raise the following configure error: ``` Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. ``` This puts it back (except for host_cpu arm or wasm).
…float word order Before python#126387, if we didn't detect float word order we'd raise the following configure error: ``` Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. ``` This puts it back (except for host_cpu arm or wasm).
…word order (#126569) Before #126387, if we didn't detect float word order we'd raise the following configure error: Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. This puts it back (except for ARM or WASM, which as hardcoded).
…nf-archive Pulls in the updated docker container from this PR: python/cpython-devcontainers#34 which contains the autoconf-archive PR: autoconf-archive/autoconf-archive#316 I removed the workaround from configure.ac, regenerated everything, and manually tested that the fix works.
…nf-archive Pulls in the updated docker container from this PR: python/cpython-devcontainers#34 which contains the autoconf-archive PR: autoconf-archive/autoconf-archive#316 I removed the workaround from configure.ac, regenerated everything, and manually tested that the fix works.
…float word order (python#126569) Before python#126387, if we didn't detect float word order we'd raise the following configure error: Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. This puts it back (except for ARM or WASM, which as hardcoded).
- Update from version 2023.02.20 to 2024.10.16 - Update of rootfile - Changelog 2024.10.16 fix serial numbers Typo: ziping → zipinf (cherry picked from commit 4396d6e1f6213452d77fca3e02e7f7439204bcb0) ax_lua.m4: add LuaJIT support AX_LIB_READLINE: add check for minimum version m4_define with braces around concat source, m4_if without extra arg Fix typos found by codespell ax_code_coverage: remove /tmp/* from remove patterns failing with lcov 2.0 The lcov >= 2.0 refactored error handling and by default it fails when an unused remove pattern is provided: LCOV --remove /tmp/* */tests/*.c lcov: ERROR: 'exclude' pattern '/tmp/*' is unused. (use "lcov --ignore-errors unused ..." to bypass this error) Based on the macro history is is not clear why the /tmp/* would be needed by default. Usual autotools projects don't use /tmp/. If needed users can still add this pattern to CODE_COVERAGE_IGNORE_PATTERN. AX_CXX_COMPILE_STDCXX: Add C++23 support AX_CXX_COMPILE_STDCXX: Add (C) statements for myself AX_CXX_COMPILE_STDCXX: Check _MSVC_LANG This fixes a bug which meant AX_CXX_COMPILE_STDCXX([20]) would only actually test for C++17 support. fixup! ax_check_compile_flag: add -Werror when checking for compiler flags ax_check_compile_flag: add -Werror when checking for compiler flags Seemingly that at some point clang started accepting _any_ flags, whereas previously it would error out. These days, you can give it -Whamsandwich and it will succeed, while at the same time throwing an annoying warning. Add -Werror so that everything gets flagged and set accordingly. AX_BOOST_BASE: Don't set BOOST_*FLAGS if Boost is not found Previously BOOST_CPPFLAGS was set to a nonsensical -I/include/boost-0 value if Boost headers were not found at all and BOOST_LDFLAGS was similarly set to a wrong (although less obviously so) value in this case because they kept the last values tested by the macro. Just don't set these variables at all if detecting Boost failed. fix serial numbers Use AS_VAR_IF in ax_gcc_builtin.m4 The AS_VAR_IF check can be a simpler alternative to testing for variable value inside AS_IF. ax_switch_flags.m4: validate macro arguments at autoconf compile time This is a nicer experience for detecting outright misuse of macros than successfully creating a configure script and then having it fail. ax_check_glx.m4: validate macro arguments at autoconf compile time This is a nicer experience for detecting outright misuse of macros than successfully creating a configure script and then having it fail. ax_check_gl.m4: validate macro arguments at autoconf compile time This is a nicer experience for detecting outright misuse of macros than successfully creating a configure script and then having it fail. ax_is_release.m4: validate macro arguments at autoconf compile time This is a nicer experience for detecting outright misuse of macros than successfully creating a configure script and then having it fail. remove duplicated setting of CPPFLAGS/LDFLAGS ax_python_devel: fix typo preventing correct variable evaluation The test should check the variable, not the fixed string. Most probably a simple typo, so fix it. AX_CHECK_{PREPROC,COMPILE}_FLAG: improve logging message 2023.09.26 ax_lua.m4: add Lua 5.4 support ax_lua.m4: Fix case of no Lua version match since 'xnil' != '' 2023.09.04 AX_FUNC_WHICH_GETHOSTBYADDR_R: use canonical formatting AX_FUNC_WHICH_GETHOSTENT_R: use canonical formatting Re-generate macros using the canonical formatting. Merge pull request #280 from theAeon/master ax_blas: detect flexiblas 2023.09.03 Merge pull request #282 from bogdro/gethostent_r Create ax_func_which_gethostent_r.m4 Merge pull request #281 from bogdro/gethostbyaddr_r Create ax_func_which_gethostbyaddr_r.m4 Merge pull request #283 from cminyard/master ax_python_devel: Add an option to make it optional Merge pull request #284 from SoapGentoo/Wstrict-prototypes Make macros `-Wstrict-prototypes` compatible 2023.08.18 ax_prototype: Disable "unused variable" warning to prevent accidental failures 2023.08.13 Make macros `-Wstrict-prototypes` compatible * With Clang having switched to modern C conventions already and GCC following suit soon, we want to have macros that work in the presence of `-Wstrict-prototypes` in all C language modes, not just C23. 2023.07.25 ax_python_devel: Add an option to make it optional ax_python_devel will fail the autoconf run if it doesn't detect that a python development environment is available. That's not always what the user wants, they may want to go on without the functionality. This change adds a way to pass in an option to specify if you want it to fail or go on if the functionality is not found. The default is to fail, as before. 2023.06.28 Create ax_func_which_gethostent_r.m4 Create ax_func_which_gethostbyaddr_r.m4 2023.06.07 ax_blas: detect flexiblas 2023.06.06 Merge remote-tracking branch 'github/master'. Merge pull request #278 from rurban/fortify2 ax_add_fortify_source.m4: fix 2nd probe ax_c_float_words_bigendian: use canon formatting 2023.05.19 AX_C_FLOAT_WORDS_BIGENDIAN: Fix bug "AX_C_FLOAT_WORDS_BIGENDIAN fails whenever interprocedural optimization is enabled." Previous versions of this macro would not work when interprocedural optimization (via link-time optimization) was enabled. This would happen when, say, the GCC/clang "-flto" flag, or the ICC "-ipo" flag was used, for example. The problem was that under these conditions, the compiler did not allocate for and write the special float value in the data segment of the test object file. Thus, the special value (in platform-dependent binary form) could not be found, and the macro would fail. The solution to the above problem was to: 1) Compile and link a whole test program rather than just compile an object file. 2) Add code that requires the compiler to write the special value to the data segment of the program executable. For further details, refer to the documentation in the macro source file. Note that this change already increments the serial number of the file. This change resolves the following issues: CPython issue #89640 python/cpython#89640 Gentoo bug #700012 https://bugs.gentoo.org/700012 Cairo issue #459 https://gitlab.freedesktop.org/cairo/cairo/-/issues/459 Poky (Yocto Project) #12699 https://lists.yoctoproject.org/g/poky/topic/89131836 2023.05.07 ax_add_fortify_source.m4: fix 2nd probe it didnt error anymore, just warned. thus without -O it still enabled the 2nd variant 2023.05.01 bump serial numbers after recent changes 2023.04.19 ax_ext_have_lib.m4: fix typo ax_python_config_var.m4: fix typo ax_path_bdb.m4: fix typo ax_pkg_mico.m4: fix typo ax_cvs.m4: fix typo ax_cc_tentdef.m4: fix typo ax_ms_cpprest.m4: fix typo ax_check_java_plugin.m4: fix typo ax_cc_attrcommon.m4: Fix typo ax_boost_base.m4: fix comment typo 2023.04.13 Re-format macros into canonical format after recent changes. Merge pull request #263 from k4rtik/icu ax_check_icu: bump serial and update after icu-config deprecation Merge pull request #275 from cstes/ax_cc_tentdef ax_cc_tentdef: test for C tentative definitions Merge pull request #276 from theAeon/master AX_BLAS: Fix vecLib detection on modern MacOS 2023.04.12 Fix vecLib detection on modern MacOS For whatever reason Apple's hardened runtime scoping disallows third-party linking to -framework vecLib. Linking -framework Accelerate solves this issue. 2023.04.10 ax_cc_tentdef: test for C tentative definitions 2023.03.08 ax_lib_netcdf4: NF_CONFIG instead of NC_CONFIG for Fortran flags. NF_CONFIG is better and safer than NC_CONFIG, for NETCDF4_FFLAGS and NETCDF4_FLIBS configuration. Signed-off-by: Adolf Belka <[email protected]> Reviewed-by: Michael Tremer <[email protected]> Signed-off-by: Arne Fitzenreiter <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: