Re: python3.2 'MODLIBS' includes -lffi (but not in Ubuntu)

2012-05-30 Thread Yaroslav Halchenko

On Mon, 28 May 2012, Jakub Wilk wrote:
> >while with python2 and python3.2 under Ubuntu 12.04 does not
> >include -lffi .

> Are you sure?

> $ dpkg-deb -x python3.2-minimal_3.2.3-0ubuntu1_i386.deb .
> $ grep LOCALMODLIBS.*ffi usr/lib/python3.2/config/Makefile
> LOCALMODLIBS= -lssl -lcrypto   -lssl -lcrypto-lffi  
> -L$(exec_prefix)/lib -lz  -lexpat

now I am sure:

root@head2:/# python3.2 -c "from distutils.sysconfig import get_config_var; 
print(get_config_var('MODLIBS'))"
-lssl -lcrypto   -lssl -lcrypto-L/usr/lib -lz  -lexpat
root@head2:/# dpkg -l python3.2
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name  Version   
Description
+++-=-=-==
ii  python3.2 3.2.3-0ubuntu3
Interactive high-level object-oriented language 
(version 3.2)

so a reasonable "guess" that it is due to 

python3.2 (3.2.3-0ubuntu3) precise-proposed; urgency=low

  * Build _ctypes as an extension, not a builtin. LP: #909292.
  * Mark symbols defined in the _ctypes extension as optional.

 -- Matthias Klose   Thu, 03 May 2012 13:20:08 +0200

and LP#909292 said to be the same as
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=665359
which is still open in Debian... heh

-- 
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120531031252.gi11...@onerussian.com



Re: python3.2 'MODLIBS' includes -lffi (but not in Ubuntu)

2012-05-30 Thread Yaroslav Halchenko
On Mon, 28 May 2012, Jakub Wilk wrote:
> >>python3.2 -c "from distutils.sysconfig import get_config_var; 
> >>print(get_config_var('MODLIBS'))"
> >-lssl -lcrypto   -lssl -lcrypto-lffi  -L/usr/lib -lz  -lexpat
> >while with python2 and python3.2 under Ubuntu 12.04 does not
> >include -lffi .
> Are you sure?

I was quite sure -- I logged into a clean 12.04 chroot and ran the
command and cut/pasted output -- could not go wrong! ;)

> $ dpkg-deb -x python3.2-minimal_3.2.3-0ubuntu1_i386.deb .
> $ grep LOCALMODLIBS.*ffi usr/lib/python3.2/config/Makefile
> LOCALMODLIBS= -lssl -lcrypto   -lssl -lcrypto-lffi  
> -L$(exec_prefix)/lib -lz  -lexpat

now I am not 100% sure but ... I also got an email from MK confirming
that it is a bug and it would be fixed with the next upload (whenever that
would be)

> >Maybe some one has a ready answer?
> Does "do not use (LOCAL)MODLIBS" count as an answer? :)

;-)  gygy -- thanks for such an in-depth answer since it works!  

indeed such a blunt patch

--- a/setup.py
+++ b/setup.py
@@ -235,7 +235,7 @@ def executables():
 for var in ('LIBDIR', 'LIBPL'):
 library_dirs += split_quoted(cfgDict.get(var, ''))
 for var in ('LDFLAGS',
-'LIBS', 'MODLIBS', 'SYSLIBS',
+'LIBS', 'SYSLIBS',
 'LDLAST'):
 link_args += split_quoted(cfgDict.get(var, ''))
 # MPI-enabled Python interpreter

helps even with other failures and seems to not cause any new ;)  Below
is the diff from unpatched build and patched build... hopefully within few days
I could wrap my head around WTF...  or may be Bradley (CCed who was helping
with this package and pushed python3 packaging) could confirm that this is a
logical thing to do ;) (I have pushed the patch for now to alioth's git)

@@ -203,30 +182,7 @@
 building 'python2.7-mpi' executable
 /usr/bin/mpicc.openmpi -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 
-Wall -Wstrict-prototypes -I/usr/include/python2.7 -c src/python.c -o 
build/temp.linux-x86_64-2.7/src/python.o
 creating build/exe.linux-x86_64-2.7
-/usr/bin/mpicc.openmpi -Wl,-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-2.7/src/python.o -L/usr/lib/python2.7/config 
-lpython2.7 -o build/exe.linux-x86_64-2.7/python2.7-mpi -Wl,-z,relro -lpthread 
-ldl -lutil -lssl -lcrypto -lssl -lcrypto -L/usr/lib -lz -lm
-/usr/lib/libmpi.so: undefined reference to `MPL_trid'
-/usr/lib/libmpi.so: undefined reference to `MPL_trvalid'
-/usr/lib/libmpi.so: undefined reference to `MPL_env2int'
-/usr/lib/libmpi.so: undefined reference to `MPL_trrealloc'
-/usr/lib/libmpi.so: undefined reference to `MPL_trspace'
-/usr/lib/libmpi.so: undefined reference to `MPL_trDebugLevel'
-/usr/lib/libmpi.so: undefined reference to `MPL_TrSetMaxMem'
-/usr/lib/libmpi.so: undefined reference to `MPL_trlevel'
-/usr/lib/libmpi.so: undefined reference to `MPL_trmalloc'
-/usr/lib/libmpi.so: undefined reference to `MPL_putenv'
-/usr/lib/libmpi.so: undefined reference to `MPL_env2bool'
-/usr/lib/libmpi.so: undefined reference to `MPL_env2range'
-/usr/lib/libmpi.so: undefined reference to `MPL_trcalloc'
-/usr/lib/libmpi.so: undefined reference to `MPL_trfree'
-/usr/lib/libmpi.so: undefined reference to `MPL_env2str'
-/usr/lib/libmpi.so: undefined reference to `MPL_trstrdup'
-/usr/lib/libmpi.so: undefined reference to `MPL_trdump'
-/usr/lib/libmpi.so: undefined reference to `MPL_trinit'
-collect2: ld returned 1 exit status
-warning: build_exe: building extension "python2.7-mpi" failed
-
-warning: build_exe: command '/usr/bin/mpicc.openmpi' failed with exit status 1
-
+/usr/bin/mpicc.openmpi -Wl,-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-2.7/src/python.o -L/usr/lib/python2.7/config 
-lpython2.7 -o build/exe.linux-x86_64-2.7/python2.7-mpi -Wl,-z,relro -lpthread 
-ldl -lutil -lm
 : # Build for Python 3
 set -e; for v in 3.2; do \
python$v setup.py build \
@@ -319,13 +275,7 @@
 building 'python3.2-mpi' executable
 /usr/bin/mpicc.openmpi -fPIC -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes 
-I/usr/include/python3.2mu -c src/python.c -o 
build/temp.linux-x86_64-3.2/src/python.o
 creating build/exe.linux-x86_64-3.2
-/usr/bin/mpicc.openmpi -Wl,-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-3.2/src/python.o -L/usr/lib/python3.2/config-3.2mu 
-lpython3.2 -o build/exe.linux-x86_64-3.2/python3.2-mpi -Wl,-z,relro -lpthread 
-ldl -lutil -lssl -lcrypto -lssl -lcrypto -lffi -L/usr/lib -lz -lexpat -lm
-/usr/bin/ld: cannot find -lffi
-collect2: ld returned 1 exit status
-warning: build_exe: building extension "python3.2-mpi" failed
-
-warning: build_exe: command '/usr/bin/mpicc.openmpi' failed with exit status 1
-
+/usr/bin/mpicc.openmpi -Wl,-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 
build/temp.linux-x86_64-3.2/src/python.o -L/usr/lib/python3.2/config-3.2mu 
-lpython3.2 -o build/exe.linux-x86_64-3.2/python3.2-mpi -Wl,-z,relro -lpthr

Re: python3.2 'MODLIBS' includes -lffi (but not in Ubuntu)

2012-05-28 Thread Jakub Wilk

* Yaroslav Halchenko , 2012-05-22, 22:42:
Bradley M. Froehle is helping out with python3-mpi4py and we ran into 
an interesting effect that clean chroot fails to build under Debian sid 
due to -lffi (while libffi-dev is nohow pulled in through 
build-depends)



python3.2 -c "from distutils.sysconfig import get_config_var; 
print(get_config_var('MODLIBS'))"

-lssl -lcrypto   -lssl -lcrypto-lffi  -L/usr/lib -lz  -lexpat

while with python2 and python3.2 under Ubuntu 12.04 does not include 
-lffi .


Are you sure?

$ dpkg-deb -x python3.2-minimal_3.2.3-0ubuntu1_i386.deb .
$ grep LOCALMODLIBS.*ffi usr/lib/python3.2/config/Makefile
LOCALMODLIBS= -lssl -lcrypto   -lssl -lcrypto-lffi  
-L$(exec_prefix)/lib -lz  -lexpat


Maybe some one has a ready answer?


Does "do not use (LOCAL)MODLIBS" count as an answer? :)

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120528181826.ga2...@jwilk.net



python3.2 'MODLIBS' includes -lffi (but not in Ubuntu)

2012-05-22 Thread Yaroslav Halchenko
Since it is getting late I decided to just ask

Bradley M. Froehle is helping out with python3-mpi4py and we ran into an
interesting effect that clean chroot fails to build under Debian sid due
to -lffi (while libffi-dev is nohow pulled in through build-depends)

> python3.2 -c "from distutils.sysconfig import get_config_var; 
> print(get_config_var('MODLIBS'))"
-lssl -lcrypto   -lssl -lcrypto-lffi  -L/usr/lib -lz  -lexpat

while with python2 and python3.2 under Ubuntu 12.04 does not include
-lffi .  Those are defined in

> grep LOCALMODLIBS=  "/usr/lib/python3.2/config-3.2mu/Makefile"
LOCALMODLIBS= -lssl -lcrypto   -lssl -lcrypto-lffi  -L$(exec_prefix)/lib 
-lz  -lexpat  

which is

>  head  "/usr/lib/python3.2/config-3.2mu/Makefile"
# Generated automatically from Makefile.pre by makesetup.
# Top-level Makefile for Python
...

but I haven't checked where it gets those libraries listing from and why
it picks up ffi exclusively in Debian sid.  Maybe some one has a ready answer?

-- 
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120523024209.gb11...@onerussian.com