Opened 15 years ago

Closed 14 years ago

#21444 closed defect (fixed)

boost with +python26 links against wrong python on Snow Leopard

Reported by: stromnov (Andrey Stromnov) Owned by: adfernandes (Andrew Fernandes)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: bgrupe27, dbsgeo@…, muchatel@…, faisal.moledina@…, adfernandes (Andrew Fernandes), arobson73@…
Port: boost

Description

--->  Installing boost @1.40.0_1+python26
--->  Activating boost @1.40.0_1+python26
stromnov@localhost:~$ otool -L /opt/local/lib/libboost_python-mt.dylib 
/opt/local/lib/libboost_python-mt.dylib:
	/opt/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)

so all python bindings, that depends on boost_python, crashing on start:

stromnov@localhost:~$ python2.6
Python 2.6.2 (r262:71600, Sep 11 2009, 12:30:14) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyopencl
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap

this problem similar to #17975 and #17998

currently it can be relinked by hand:

sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/lib/libboost_python-mt.dylib

Attachments (2)

ticket-21444.txt.gz (493.6 KB) - added by stromnov (Andrey Stromnov) 15 years ago.
Portfile.diff (458 bytes) - added by stromnov (Andrey Stromnov) 15 years ago.

Download all attachments as: .zip

Change History (50)

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to nox@…

comment:2 Changed 15 years ago by bgrupe27

Cc: bgrupe@… added

Cc Me!

comment:3 Changed 15 years ago by dbsgeo@…

Cc: dbsgeo@… added

Cc Me!

comment:4 Changed 15 years ago by dbsgeo@…

Boost tends to link to the first python in the users path, so this may be happening to users that install boost +python26 before using python_select to change their default python over to the macports py26.

I just installed boost +python26 on a trunk checkout of macports and an upgraded snow leopard and did not run into this issue, but it surely has been a chronic one in the past and likely going to crop up more frequently now that there is both system py25/py26 and macports py25/py26 available.

Note, that #21169 is resulting from this problem.

comment:5 Changed 15 years ago by Veence (Vincent)

Please can you tell me what exactly is the content of your ${framework_dir}/Python.framework folder? Thanks

comment:6 Changed 15 years ago by dbsgeo@…

Cc: dbsgeo@… removed

Cc Me!

comment:7 Changed 15 years ago by dbsgeo@…

Cc: dbsgeo@… added

Cc Me!

comment:8 Changed 15 years ago by nox@…

I can't reproduce this:

$ otool -L work/boost_1_40_0/bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/libboost_python-mt.dylib
work/boost_1_40_0/bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/libboost_python-mt.dylib:
	/opt/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)

comment:9 Changed 15 years ago by nox@…

If you can reproduce this bug, please attach the full output of sudo port -v build boost +python26

comment:10 Changed 15 years ago by nox@…

Resolution: worksforme
Status: newclosed

Changed 15 years ago by stromnov (Andrey Stromnov)

Attachment: ticket-21444.txt.gz added

comment:11 in reply to:  9 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to nox@…:

If you can reproduce this bug, please attach the full output of sudo port -v build boost +python26

Please, look at attachment:ticket-21444.txt.gz

boost +python26 installed with dependencies on fresh installation of SL with latest macports.

Result:

Andrew-Stromnovs-MacBook-Pro:~ stromnov$ otool -L /opt/local/lib/libboost_python-mt.dylib 
/opt/local/lib/libboost_python-mt.dylib:
	/opt/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)

comment:12 Changed 15 years ago by nox@…

You just attached the ticket to itself, so I can read the ticket while I'm reading the ticket.

comment:13 Changed 15 years ago by stromnov (Andrey Stromnov)

I'd attached log file to ticket, not ticket to ticket.

comment:14 Changed 15 years ago by nox@…

I see, Safari is failing so hard I thought it was you. Instead of showing me the page with the attachment download link, it downloads the page -_-.

comment:15 Changed 15 years ago by nox@…

I've read config.log, I still can't determine from where the bug is coming. It does not reference "/System" a single time during the boost build process, and magically pops from your otool command.

What does otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python say?

comment:16 in reply to:  15 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to nox@…:

What does otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python say?

stromnov@stromnov:~$ otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python:
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
stromnov@stromnov:~$

comment:17 Changed 15 years ago by dbsgeo@…

I'd be curious to also know the output of:

echo $PATH

and:

ls -l `which python`

comment:18 Changed 15 years ago by stromnov (Andrey Stromnov)

stromnov@stromnov:~$ echo ${PATH}
/opt/local/libexec/ccache:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
stromnov@stromnov:~$ ls -l `which python`
-rwxr-xr-x  2 root  wheel  86000 Jul  8 10:57 /usr/bin/python
stromnov@stromnov:~$ ls -l `which python2.6`
lrwxr-xr-x  1 root  wheel  73 Oct  3 19:48 /opt/local/bin/python2.6 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6

comment:19 Changed 15 years ago by stromnov (Andrey Stromnov)

Interesting fact:

stromnov@stromnov:~$ cat test.c 
#include <Python.h>

int main(const int argc, const char *argv[]) {
    Py_Initialize();
    Py_Finalize();
    return 0;
}
stromnov@stromnov:~$ python2.6-config --includes ; python2.6-config --libs
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
-ldl -lpython2.6
stromnov@stromnov:~$ gcc -dynamic `python2.6-config --includes` test.c `python2.6-config --libs`
stromnov@stromnov:~$ otool -L a.out 
a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
stromnov@stromnov:~$

JFYI: Fresh Snow Leopard installation + latest XCode + latest macports. No customizations.

comment:20 Changed 15 years ago by nox@…

It seems like a -L flag is missing.

comment:21 Changed 15 years ago by dbsgeo@…

Replying to stromnov@…:

stromnov@stromnov:~$ ls -l which python -rwxr-xr-x 2 root wheel 86000 Jul 8 10:57 /usr/bin/python

That worries me. Nothing but a hunch here because I'm no expert in linking, but I've noticed that the bjam/gcc linking is really fragile and may be failing it may falling back to the system python. When compiling boost from source I've seen this with more regularity when the above command returns the system python (which I assume that does).

Anyway, most importantly I think that this type of linking syntax is brittle (taken from your logs):

    "/usr/bin/g++-4.2" -dynamiclib -Wl,-single_module -install_name "/opt/local/lib/libboost_python-mt.dylib" -L"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib" -L"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" [...snip...]  -lpython2.6    -headerpad_max_install_names -Wl,-dead_strip -no_dead_strip_inits_and_terms 

and this unresolved bug: http://lists.boost.org/boost-users/2008/08/39302.php

could likely be fixed if bjam were patched to issue a linker command like:

'-F/opt/local/Library/Frameworks -framework Python'

This is a change I had to make upstream to mapnik for the py26-mapnik port to consistently link to the macports python (https://trac.mapnik.org/changeset/967 and https://trac.mapnik.org/changeset/1187/trunk/bindings/python/SConscript)

instead of this (which I think is failing unpredictably, for reasons I wish I understood more)

L"/opt/local/Library/Frameworks....." -lpython2.6

comment:22 in reply to:  20 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to nox@…:

It seems like a -L flag is missing.

stromnov@stromnov:~$ python2.6-config --cflags
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
stromnov@stromnov:~$ python2.6-config --ldflags
-L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -ldl -lpython2.6
stromnov@stromnov:~$ gcc `python2.6-config --cflags` `python2.6-config --ldflags` test.c
stromnov@stromnov:~$ otool -L a.out 
a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)

comment:23 Changed 15 years ago by nox@…

dbsgeo: Nope, the problem does not come from /usr/bin/python, as which python outputs the path of the MacPorts python31 executable here, and it still links correctly against python26. stromnov: Thanks for the quick reply with --ldflags!

comment:24 Changed 15 years ago by stromnov (Andrey Stromnov)

Probably, problem goes from hardcoded ld paths (man ld):

Search paths
  ld maintains a list of directories to search for a library or framework to use.  The default library search path
  is /usr/lib then /usr/local/lib.  The -L option will add a new library search path.  The default framework
  search path is /Library/Frameworks then /System/Library/Frameworks.  (Note: previously, /Network/Library/Frame-
  works was at the end of the default path.  If you need that functionality, you need to explicitly add -F/Net-
  work/Library/Frameworks).  The -F option will a new framework search path.  The -Z option will remove the stan-
  dard search paths.  The -syslibroot option will prepend a prefix to all search paths.

Let's check it:

stromnov@stromnov:~$ ls -la /usr/lib | grep python2.6
lrwxr-xr-x    1 root  wheel        18 Oct  2 23:57 libpython.dylib -> libpython2.6.dylib
lrwxr-xr-x    1 root  wheel        68 Oct  2 23:57 libpython2.6.dylib -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/Python
lrwxr-xr-x    1 root  wheel        75 Oct  2 23:58 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
stromnov@stromnov:~$ gcc -F/opt/local/Library/Frameworks `python2.6-config --cflags` `python2.6-config --ldflags` test.c
stromnov@stromnov:~$ otool -L a.out 
a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
stromnov@stromnov:~$ sudo mv /usr/lib/libpython2.6.dylib /usr/lib/libpython2.6.dylib_sys
stromnov@stromnov:~$ sudo ln -s /opt/local/lib/libpython2.6.dylib /usr/lib/libpython2.6.dylib
stromnov@stromnov:~$ ls -la /usr/lib | grep python2.6
lrwxr-xr-x    1 root  wheel        18 Oct  2 23:57 libpython.dylib -> libpython2.6.dylib
lrwxr-xr-x    1 root  wheel        33 Oct  4 21:35 libpython2.6.dylib -> /opt/local/lib/libpython2.6.dylib
lrwxr-xr-x    1 root  wheel        68 Oct  2 23:57 libpython2.6.dylib_sys -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/Python
lrwxr-xr-x    1 root  wheel        75 Oct  2 23:58 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
stromnov@stromnov:~$ gcc -F/opt/local/Library/Frameworks `python2.6-config --cflags` `python2.6-config --ldflags` test.c
stromnov@stromnov:~$ otool -L a.out 
a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)
stromnov@stromnov:~$ 

comment:25 Changed 15 years ago by stromnov (Andrey Stromnov)

  1. python2.6 framework broken in macports (please, read #21824)
  2. we need explicitly pass -F${prefix}/Library/Frameworks to compiler for proper linking with macport frameworks (as mentioned earlier by dbsgeo@)
  3. linking must be done against framework or library, but (preferably) not against both at the same time:

Compiling:

stromnov@stromnov:~$ gcc -Z -F/opt/local/Library/Frameworks `python2.6-config --cflags` `python2.6-config --ldflags` -framework Python test.c
stromnov@stromnov:~$ otool -L a.out a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)

Double link (to system and macports pythons) caused by -lpython2.6 in python2.6-config --ldflags and absence of -L/opt/local/lib in args.

stromnov@stromnov:~$ gcc -Z -F/opt/local/Library/Frameworks -L/opt/local/lib `python2.6-config --cflags` `python2.6-config --ldflags` -framework Python test.c
stromnov@stromnov:~$ otool -L a.out a.out:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 124.1.1)
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)

comment:26 in reply to:  4 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to dbsgeo@…:

Boost tends to link to the first python in the users path, so this may be happening to users that install boost +python26 before using python_select to change their default python over to the macports py26.

Last statement in python_select python26 execution routine is:

ln -snf /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python \
        /opt/local/Library/Frameworks/Python.framework/Python

Replying to dbsgeo@…:

could likely be fixed if bjam were patched to issue a linker command like: '-F/opt/local/Library/Frameworks -framework Python'

Probably it's completely bad idea to link port against framework in current macports scheme (see http://trac.macports.org/ticket/21824#comment:4).

It is better to link against specific libraries via -L and -l args.

Currently I'm using system python26, macports python25 and macports python26, so I can't use python_select against one of them.

comment:27 in reply to:  21 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to dbsgeo@…:

instead of this (which I think is failing unpredictably, for reasons I wish I understood more) L"/opt/local/Library/Frameworks....." -lpython2.6

This is debug output (via -v flag to ld), when linking libboost_python-mt.dylib:

[snip]
@(#)PROGRAM:ld  PROJECT:ld64-95.2.12
Library search paths:
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib
	/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
	/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
	/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
	/usr/lib/i686-apple-darwin10/4.2.1
	/usr/lib/gcc/i686-apple-darwin10/4.2.1
	/usr/lib/gcc/i686-apple-darwin10/4.2.1
	/usr/lib/i686-apple-darwin10/4.2.1
	/usr/lib
	/usr/lib
	/usr/local/lib
Framework search paths:
	/Library/Frameworks/
	/System/Library/Frameworks/

But libpython2.6.dylib exist only at /opt/local/lib

stromnov@stromnov:/$ find /opt/local -name 'libpython*'
/opt/local/lib/libpython2.6.dylib
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/libpython2.6.a

So, ld takes libpython2.6.dylib from /usr/lib.

Changed 15 years ago by stromnov (Andrey Stromnov)

Attachment: Portfile.diff added

comment:28 Changed 15 years ago by stromnov (Andrey Stromnov)

After all, small oneline fix, that works for me - attachment:Portfile.diff

comment:29 Changed 15 years ago by nox@…

This is just a workaround, and won't work for framework-only Python installations. I think I've found how to really fix this.

comment:30 Changed 15 years ago by stromnov (Andrey Stromnov)

Another way, that will work with frameworks - create fake Python framework at configure phase (just like python_select does), and link against this framework.

comment:31 Changed 15 years ago by nox@…

In fact, Boost.Build is not doing anything wrong: it passes the following flags to GCC: -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -lpython2.6

And /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/libpython2.6.a links to ../../Python, which is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python.

Taken from ld manpage:

     -lx         This option tells the linker to search for libx.dylib or libx.a in the library search path.  If string x is of the form y.o, then that file is searched for in the
                 same places, but without prepending `lib' or appending `.a' or `.dylib' to the filename.

Could you paste the output of ls -l /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config?

comment:32 in reply to:  31 Changed 15 years ago by stromnov (Andrey Stromnov)

Replying to nox@…:

Could you paste the output of ls -l /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config?

stromnov@stromnov:~$ ls -l /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
total 208
-rw-r--r--  2 root  wheel  43519 Oct  3 19:47 Makefile
-rw-r--r--  2 root  wheel  18265 Oct  3 19:47 Setup
-rw-r--r--  2 root  wheel    368 Oct  3 19:47 Setup.config
-rw-r--r--  2 root  wheel     41 Oct  3 19:47 Setup.local
-rw-r--r--  2 root  wheel   2077 Oct  3 19:47 config.c
-rw-r--r--  2 root  wheel   1457 Oct  3 19:47 config.c.in
-rwxr-xr-x  2 root  wheel   7122 Oct  3 19:47 install-sh
lr-xr-xr-x  1 root  wheel     15 Oct  3 19:48 libpython2.6.a -> ../../../Python
-rwxr-xr-x  2 root  wheel   7431 Oct  3 19:47 makesetup
-rw-r--r--  2 root  wheel   3916 Oct  3 19:47 python.o
stromnov@stromnov:~$ ls -la /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/../../../
total 4144
drwxr-xr-x   9 root  wheel      306 Oct  3 19:48 .
drwxr-xr-x   4 root  wheel      136 Oct  6 18:05 ..
lrwxr-xr-x   1 root  wheel       17 Oct  3 19:48 Headers -> include/python2.6
-rwxr-xr-x   2 root  wheel  2116984 Oct  3 19:47 Python
drwxr-xr-x   4 root  wheel      136 Oct  3 19:48 Resources
drwxr-xr-x  41 root  wheel     1394 Oct  6 18:07 bin
drwxr-xr-x   3 root  wheel      102 Oct  3 19:48 include
drwxr-xr-x   4 root  wheel      136 Oct  4 14:41 lib
drwxr-xr-x   4 root  wheel      136 Oct  4 00:35 share

comment:33 Changed 15 years ago by stromnov (Andrey Stromnov)

http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/ld.1.html

-search_paths_first
                 By default the -lx and -weak-lx options first search for a file of the form `libx.dylib' in
                 each directory in the library search path, then a file of the form `libx.a' is searched for
                 in the library search paths.  This option changes it so that in each path `libx.dylib' is
                 searched for then `libx.a' before the next path in the library search path is searched.

comment:34 Changed 15 years ago by nox@…

Still does not explain why it has been reported to work, as Boost does not use this flag when linking libboost_python.

comment:35 Changed 15 years ago by muchatel@…

Cc: muchatel@… added

Cc Me!

comment:36 Changed 14 years ago by faisal.moledina@…

Cc: faisal.moledina@… added

Cc Me!

comment:37 Changed 14 years ago by dbsgeo@…

I get about a report a week of this problem still affecting the py26-mapnik port on snow leopard.

Many are by new users that have very little knowledge of how to debug and will just be confused by this and similar tickets, thus leading to a dead end if they don't find other help.

I also just rebuilt (sudo port install boost +python26) and I see the same behavior:

$ otool -L /opt/local/lib/libboost_python-mt.dylib 
/opt/local/lib/libboost_python-mt.dylib:
	/opt/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

which leads to (after installing the py26-mapnik port):

$ /opt/local/bin/python2.6
Python 2.6.4 (r264:75706, Nov 28 2009, 22:45:01) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap

Can we just automatically run install_name_tool as part of the boost port?

sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/lib/libboost_python-mt.dylib

comment:38 Changed 14 years ago by dbsgeo@…

fyi, regarding the failure of -L${prefix}/lib and -lpython2.6 to link to the proper python version:

http://mail.python.org/pipermail/pythonmac-sig/2009-December/021977.html

and

http://mail.python.org/pipermail/pythonmac-sig/2009-December/021978.html

comment:39 in reply to:  31 Changed 14 years ago by dpolyg@…

Replying to nox@…:

In fact, Boost.Build is not doing anything wrong:

it passes the following flags to GCC: -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -lpython2.6

And /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/libpython2.6.a

inks to ../../Python, which is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python.

I was succeed with building correct version of the /opt/local/lib/libboost_python-mt.dylib after doing this magic:

$ cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/

$ sudo ln -s ../../../Python libpython2.6.dylib

Examples from Boost.Python also work fine.

I have Snow Leopard, python26 and python31 installed.

python_select was used for selecting python26 before building boost.

$ ls -la /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/

total 216
drwxr-xr-x   13 root  wheel    442 Jan 15 23:24 ./
drwxr-xr-x  631 root  wheel  21454 Jan 13 19:39 ../
-rw-r--r--    2 root  wheel  43519 Jan 13 19:38 Makefile
-rw-r--r--    2 root  wheel  18265 Jan 13 19:38 Setup
-rw-r--r--    2 root  wheel    368 Jan 13 19:38 Setup.config
-rw-r--r--    2 root  wheel     41 Jan 13 19:38 Setup.local
-rw-r--r--    2 root  wheel   2077 Jan 13 19:38 config.c
-rw-r--r--    2 root  wheel   1457 Jan 13 19:38 config.c.in
-rwxr-xr-x    2 root  wheel   7122 Jan 13 19:38 install-sh*
lr-xr-xr-x    1 root  wheel     15 Jan 13 19:39 libpython2.6.a@ -> ../../../Python
lrwxr-xr-x    1 root  wheel     15 Jan 15 23:24 libpython2.6.dylib@ -> ../../../Python
-rwxr-xr-x    2 root  wheel   7431 Jan 13 19:38 makesetup*
-rw-r--r--    2 root  wheel   3916 Jan 13 19:38 python.o

comment:40 Changed 14 years ago by adfernandes (Andrew Fernandes)

Cc: adfernandes@… added

Cc Me!

comment:41 Changed 14 years ago by adfernandes (Andrew Fernandes)

Resolution: worksforme
Status: closedreopened

Hmm. Okay - I do not have python-select installed, was just bitten by this bug. It affects both the openmpi and python26 variants since the former can add support for the latter.

For the record, I have a vanilla python26 @2.6.4_0+darwin with no variants installed, and boost @1.42.0_1+icu+openmpi+python26 on 10.6. (I noticed that it also affected boost @1.41.0 but did not have time to track it down.)

I added the above Portfile.diff patchfile, and it resolved the problem. I further noticed that the python26 port does not have any variants with respect to being built only as a Framework... so does it make sense to worry about it?

My $0.02 is that on a vanilla config, boost was being built incorrectly (linking the wrong python library), and even though I personally think it is a Jamfile bug, this was painful for me to track down.

For me, the bug is definitely reproducible!

comment:42 Changed 14 years ago by nox@…

Version: 1.8.0

As I can't reproduce it and this patch is a workaround, I won't apply it; but I'll look into this bug again.

comment:43 in reply to:  42 Changed 14 years ago by adfernandes (Andrew Fernandes)

Replying to nox@…:

As I can't reproduce it and this patch is a workaround, I won't apply it; but I'll look into this bug again.

I agree with your decision - obviously something strange (some sort of unforseen interaction) is going on. I've tried to diagnose it as I've had a little experience working with jam, but can't figure out what's going wrong. At least, more so than all the previous discussion has indicated.

If you can think of any debug output, configuration, or tests I can perform, I'd be very happy to oblige and help.

comment:44 Changed 14 years ago by arobson73@…

Cc: arobson73@… added

Cc Me!

comment:45 Changed 14 years ago by nox@…

Owner: changed from nox@… to macports-tickets@…
Status: reopenednew

Maintainership relinquished in r69969.

comment:46 Changed 14 years ago by adfernandes (Andrew Fernandes)

Sorry to see you go, nox - I'm offering to take over ownership (unless people disagree) in r69971.

comment:47 Changed 14 years ago by adfernandes (Andrew Fernandes)

Owner: changed from macports-tickets@… to adfernandes@…

comment:48 Changed 14 years ago by adfernandes (Andrew Fernandes)

Resolution: fixed
Status: newclosed

Should (hopefully!) be fixed with r69974.

Note: See TracTickets for help on using tickets.