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
Some functions in pymath.c should be moved elsewhere. #51767
Comments
The Python/pymath.c file currently defines substitutes for some C99 libm There are (at least) two problems with this approach: (1) on a platform that doesn't have (for example) log1p, we end up (2) It may not work! As an experiment, I tried adding a new function dlopen(build/lib.macosx-10.4-i386-2.7/math.so, 2): Symbol not found: When I moved the function to a different source file (I picked The reason for the above behaviour appears to be (I'm guessing a little I'm not sure what the best way to reorganize this setup is. |
Incidentally, the build failure described earlier can be fixed by creating python.exe with: gcc -u _PyMac_Error -o python.exe Modules/python.o -ldl -Wl,-force_load,libpython2.7.a -framework CoreFoundation instead of with: gcc -u _PyMac_Error -o python.exe Modules/python.o libpython2.7.a -ldl -framework CoreFoundation |
In general those functions has to be part of, lets call it "python |
For the recently added expm1 function (see issue bpo-3366), I've put the Roumen, I'm not sure I understand your comments about atan2. Is there |
May be is good to add depends=['_math.h'], for modules in setup.py. About atan2 - lets see comments in mathmodule and configure test. The |
So the configure test for tanh(-0.0) is purely informational: it doesn't The wrapper for atan2 in Modules/mathmodules.c is a separate issue; it
Which test(s) do you think will fail?
Good point---thanks! Done in r76865 (trunk), r76867 (py3k). |
Moved atanh, asinh, acosh, log1p from pymath.c to Modules/_math.c in |
I suspect the change here causes _math.c to be compiled to the same object file twice, and there is a race condition when the compilations are concurrent. See bpo-24421. |
Yes, there are almost certainly better ways to organize the build here. A hacky solution might be to simply #include _math.c in the two other files that need it. |
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:
The text was updated successfully, but these errors were encountered: