-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
[2.7] bpo-11566: Extension build errors on Windows for _hypot #880
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This addresses C extension build errors related to an undefined _hypot symbol when building with the Microsoft Visual C++ Compiler for Python 2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++ extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not been declared' On line 71 of PC/pyconfig.h, HAVE_HYPOT is defined, indicating that hypot is expected to be available in current Windows toolchains. [1] https://www.microsoft.com/en-us/download/details.aspx?id=44266 [2] https://mingwpy.github.io/
ca3d872
to
54ca571
Compare
IIRC the MSVC |
@rgommers Thanks for the pointer. I was able to find the NumPy and a discrepancy between the NumPy backup implementation and the CPython one: Line 35 in 3cc8259
but the existing MSVC Lines 722 to 732 in 9dc2b38
When looking into replacing it, does not looks trivial -- I was able to dig up an old VS 2008 to test this patch. |
I'm experiencing this problem with regard to mingw-w64 builds. Is this likely to be accepted? |
Also hitting this issue at sagemath/cysignals#76 |
It doesn't matter whether |
…ore Python.h is discouraged This is an open python issue and should be fixed there (python/cpython#880). Windows workarounds exist.
…rch, python ci in venv (#337) * fix(python) Rename dsigmaydp -> dsigma_ydp also in extern declaration * ci(python) Include python-sbml import and simulation in CI (Closes #338) * fix(*) Replace sigma_* by sigma* in all C++ code to have more uniform naming in python- and matlab-generated code * Add missing newly created model files * Fix typo * ci(python) Set exit status according to test outcome (Fixes #339) * ci(python) Disable building python package with cmake-generated libraries until they are repaired to work with current setup.py. Use plain setuptools package. * ci(python) Don't run tests/testSBML.py twice. Is already run as part of scripts/run-codecov.sh -> tests/testCoverage.py * debug(python) Print info if hdf5 was found * feature(python) Check for HDF5 in standard location if pkgconfig is unsuccesful * Fix variable name * added standard osx include and library dir hints * Fix hdf5 library path * Adapt hdf5 library path, be verbose * ci(): List hdf5 files * ci() Maybe we can find the static hdf5 library * ci() List brew hdf5 files * Adapt hdf5 library path * c() Add travis macOS hdf5 directories, remove debug output * fix(cmake) Don't use PYTHON_INCLUDE_PATH which was already deprecated in cmake 3.0.2 or earlier * cmake() VERSION_GREATER_EQUAL only introduced in cmake 3.7, making this check mostly useless * cmake() VERSION_GREATER_EQUAL only introduced in cmake 3.7, making this check mostly useless * Recreate example model code * Revert mingw ::hypot hypot _hypot fix, since ncluding STL headers before Python.h is discouraged This is an open python issue and should be fixed there (python/cpython#880). Windows workarounds exist. * ci(python) Install amici package to virtual environment and run tests there (Closes #342) * cmake() Add target for python source distribution * ci() install h5py * Revert "ci() install h5py" This reverts commit ea79054. * Install h5py in venv * Squashed commit of the following: commit 985646a Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:52:18 2018 +0200 ci(python) no --user in venv; install wheel commit f991ce6 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:51:35 2018 +0200 ci(python) no --user in venv; install wheel commit 62f828b Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:30:57 2018 +0200 ci(python) install pkgconfig commit b3d37c9 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:21:41 2018 +0200 ci (python) correct package name commit 039ebb0 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:11:55 2018 +0200 ci (python) venv activate commit 49d5412 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 13:05:03 2018 +0200 ci (python) venv activate commit d1f5824 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 12:57:45 2018 +0200 ci (python) venv activate commit 1446015 Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 12:49:14 2018 +0200 ci (python) h5py commit b88701d Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 12:42:56 2018 +0200 ci(python) install sdist commit 220323b Author: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Date: Tue Jul 3 12:15:40 2018 +0200 ci(python) install --user commit 190a270 Merge: 7adcc83 2e2e445 Author: Fabian Fröhlich <fabian@schaluck.com> Date: Tue Jul 3 10:02:21 2018 +0200 Merge branch 'master' into feature_venv * ci(python) python 3.6 venv to find proper symengine wheel on osx? * ci(python) install python3.6 * ci(python) install python3.6
@embray Do you happen to have the powers to merge this (or know a friend who does)? |
- Add a reference to python/cpython#880
- Add a reference to python/cpython#880. - Remove some commented code.
- Remove linebreak changes/ - Add a reference to python/cpython#880. - Remove some commented code.
- Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code.
- Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD.
Closing and re-opening to trigger bedevere/news and appveyor CI |
If this is an issue for 3.x, we would normally patch master first and then backport. |
This is a 2.7-only issue. |
Are you sure? master branch has same defines. Anyway, I prefer removing them in master branch. |
Here is the PR for This patch is significant for people that want to create Python C extensions with binary compatibility for Python 2.7 distributed by Python.org or many other sources. This requires Visual Studio 2008, the Microsoft Visual C++ Compiler for Python 2.7, or MinGWPy. MinGWPy is currently only available for Python 2.7. The patch for |
Thanks. |
@methane thanks for merging!! |
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors.
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors.
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
Modify cysignals for windows - (windows) Use POSIX macro in macro.h - Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD. - Remove some unecessary "#ifndef POSIX" in implementation.c and macro.h. - In macro.h replace abort() and raise(SIGFPE) by raise(SIGABRT).
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
Modify cysignals for windows - (windows) Use POSIX macro in macro.h - Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD. - Remove some unecessary "#ifndef POSIX" in implementation.c and macro.h. - In macro.h replace abort() and raise(SIGFPE) by raise(SIGABRT).
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
Modify cysignals for windows - (windows) Use POSIX macro in macro.h - Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD. - Remove some unecessary "#ifndef POSIX" in implementation.c and macro.h. - In macro.h replace abort() and raise(SIGFPE) by raise(SIGABRT).
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
Modify cysignals for windows - (windows) Use POSIX macro in macro.h - Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD. - Remove some unecessary "#ifndef POSIX" in implementation.c and macro.h. - In macro.h replace abort() and raise(SIGFPE) by raise(SIGABRT).
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
Modify cysignals for windows - (windows) Use POSIX macro in macro.h - Remove linebreak changes. - Add a reference to python/cpython#880. - Remove some commented code. - define SIGHUP SIGBUS SIGQUIT and SIGALRM for windows - Implementation.c: reorder functions declaration to stick with HEAD current order. - Reorder code in many place to minimize git diff with HEAD. - Remove some unecessary "#ifndef POSIX" in implementation.c and macro.h. - In macro.h replace abort() and raise(SIGFPE) by raise(SIGABRT).
- Work around for hypot problem python/cpython#880 - Rebase on 582dbf6. - Fix indentation and whitespace errors. - Remove #define PTHREAD_STACK_MIN 65536 - Remove unecessary #include <float.h> - simplify "int mapped_sig =" with "sig =" - define sigjmp, sigsetjmp and siglongjmp in implementation.c
This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'
On line 71 of PC/pyconfig.h, HAVE_HYPOT is defined, indicating that
hypot is expected to be available in current Windows toolchains.
[1] https://www.microsoft.com/en-us/download/details.aspx?id=44266
[2] https://mingwpy.github.io/
https://bugs.python.org/issue11566