miro ilias added the comment:
Dear Space,
On my Ubuntu 11.10 x86_64 Linux I have static python buildup prescription:
./configure LDFLAGS="-static -static-libgcc" --disable-shared
CPPFLAGS=-static --prefix=/home/ilias/bin/python_static
with *static* in Modules/Setup
but 'make' failes, getting errors like:
collect2: ld returned 1 exit status
/usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires
dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime;
recompile with -fPIC
collect2: ld returned 1 exit status
/usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires
dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime;
recompile with -fPIC
collect2: ld returned 1 exit status
.
.
.
/home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:
In function ‘mmap_resize’:
/home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3193:5:
warning: implicit declaration of function ‘mremap’
[-Wimplicit-function-declaration]
/home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3193:16:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
/home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:
In function ‘sys_trim’:
/home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3612:62:
warning: comparison between pointer and integer [enabled by default]
/usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires
dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime;
recompile with -fPIC
collect2: ld returned 1 exit status
Python build finished, but the necessary bits to build these modules were not
found:
_bsddb _curses_curses_panel
_sqlite3 _ssl _tkinter
bsddb185 bz2dbm
dl gdbm imageop
linuxaudiodev ossaudiodevreadline
sunaudiodevzlib
To find the necessary bits, look in setup.py in detect_modules() for the
module's name.
Failed to build these modules:
_bisect_codecs_cn _codecs_hk
_codecs_iso2022_codecs_jp _codecs_kr
_codecs_tw _collections _csv
_ctypes_ctypes_test _elementtree
_functools _heapq _hotshot
_io_json _locale
_lsprof_md5 _multibytecodec
_multiprocessing _random_sha
_sha256_sha512_socket
_struct_testcapi array
audioopbinascii cmath
cPicklecrypt cStringIO
datetime fcntl future_builtins
grpitertools math
mmap nisoperator
parser pyexpatresource
select spwd strop
syslog termiostime
unicodedata
Any help, please ?
From: Space Li [rep...@bugs.python.org]
Sent: Wednesday, February 29, 2012 2:49 AM
To: Ilias Miroslav
Subject: [issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3
(Fedora Core 5?)
Space Li added the comment:
Hi,
I recently compiled Python 2.7.2 and got an ImportError on struct module during
'make install'.
What I found working for me is just to 'make'. Before doing 'make install',
copy the lib.linux-x directory in 'build' to {prefix}/lib/python2.7 and
rename it as lib-dynload.
Then find something that looks like followings:
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHA