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: _decimal build failure (unsupported platform for that module) - evolution possible?
Type: compile error Stage: resolved
Components: Extension Modules Versions: Python 3.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Hubert Holin, ned.deily, skrah
Priority: normal Keywords:

Created on 2018-04-05 10:19 by Hubert Holin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (8)
msg314976 - (view) Author: Hubert Holin (Hubert Holin) Date: 2018-04-05 10:19
_decimal fails to build on my platform due to lack of support:

In file included from /Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34:
/usr/local/include/mpdecimal.h:201:4: error: "unsupported platform: need mpd_size_t == mpd_uint_t"
  #error "unsupported platform: need mpd_size_t == mpd_uint_t"

My host system type: x86_64-apple-darwin17.5.0
My target system type: x86_64-apple-darwin17.5.0
Compiler used: clang+llvm-6.0.0-x86_64-apple-darwin
Hardware: 3,7 GHz Quad-Core Intel Xeon E5

Relevant configurations:

--enable-universalsdk... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk

--with-universal-archs... intel

MACHDEP... darwin

Could this module be upgraded?
msg314978 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2018-04-05 11:45
I don't have OS X. However, this is the first time in 6 years that anyone has reported an OS X build failure.

Perhaps Ned knows the answer.
msg314998 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-05 17:55
> However, this is the first time in 6 years that anyone has reported an OS X build failure.

Yes, I've never seen one before, either.

But I think the culprit is pointed to in the error message.  It looks like you have another version of mpdecimal in /usr/local/.
msg315027 - (view) Author: Hubert Holin (Hubert Holin) Date: 2018-04-06 17:25
This is correct: I had an older version of mpdecimal in /usr/local. However, when removed mpdecimal is (manually) removed from /usr/local (the libs and the header), making a "make clean", a config and make, the _decimal build still fails, but this time for a different reason:

/Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34:10: fatal error: 'mpdecimal.h' file not found
#include "mpdecimal.h"

Still, we are getting closer: should I install a newer version of mpdecimal and try again?
msg315028 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2018-04-06 17:50
It looks to me as if you are compiling --with-system-libmpdec.

You don't need that, libmpdec is included in the Python tarball.

-with-system-libmpdec was added mainly for Linux distros.  If there's a widespread interest to support it on OS X, I'd need a patch.



A hack that should work is "export PYTHON_DECIMAL_WITH_MACHINE=universal" during the Python build, then the external libmpdec *might* work.

This flag was mainly added for testing. Note that "universal" does not always build fat binaries -- it uses whatever Python is configured with.
msg315029 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2018-04-06 17:57
Another source of error is of course if the external libmpdec was not compiled as "universal" but Python is.
msg315165 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2018-04-10 10:18
I'm trying to reduce the number of open issues that I'm involved in.

If something concrete comes up, feel free to reopen.
msg315171 - (view) Author: Hubert Holin (Hubert Holin) Date: 2018-04-10 16:05
Yes, the error turned out to be that I had indeed forgotten to remove the --with-system-libmpdec along with the library and header. Now _decimal compiles fine. I will see if I can get Python to run with my system's mpdecimal (once I have updated it), but as far as this issue is concerned I believe it is indeed closed. Thanks for the help!
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77411
2018-04-10 16:05:22Hubert Holinsetmessages: + msg315171
2018-04-10 10:18:03skrahsetstatus: open -> closed
resolution: works for me
messages: + msg315165

stage: resolved
2018-04-06 17:57:55skrahsetmessages: + msg315029
2018-04-06 17:50:33skrahsetmessages: + msg315028
2018-04-06 17:25:34Hubert Holinsetmessages: + msg315027
2018-04-05 17:55:29ned.deilysetmessages: + msg314998
2018-04-05 11:45:01skrahsetnosy: + skrah, ned.deily
messages: + msg314978
2018-04-05 10:19:14Hubert Holincreate