How to build a 32-bit distribution of Python modules using Setup.py on x86_64 host

I need to compile a 32-bit PyEphem distribution . It doesn't seem to be complicated, however, I am facing some compiler issues.

$ CFLAGS=-m32 python setup.py bdist -p i386
running bdist
running bdist_dumb
running build
running build_py
running build_ext
building 'ephem._libastro' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -m32 -fPIC -Ilibastro-3.7.3 -I/usr/include/python2.6 -c extensions/_libastro.c -o build/temp.linux-x86_64-2.6/extensions/_libastro.o
In file included from /usr/include/python2.6/Python.h:58,
                 from extensions/_libastro.c:3:
/usr/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
error: command 'gcc' failed with exit status 1

The build system runs Ubuntu 10.04. Are python header files related to localhost architecture?

Update: I found interesting information about cross-compiling Python .

+3
source share
1 answer

32- ? , , 32- python , python.h.

Linux, , 64- Windows.

, , 32- VM .

+1

Source: https://habr.com/ru/post/1766507/


All Articles