vecLib Framework on the Mac and distutils
I am hoping someone will be able to shed some light on this strange problem I'm having. I am trying to develop a C++ extension to python that must link with LAPACK. I am doing my development on the Mac, so I want to link with -framework veclib. OS: Mac OS X 10.2.8 python: 2.3 (via fink) gcc: 3.1 I am using distutils to build the extension, and assign ["-framework veclib -lSystem"] to the extra_link_args argument of the setup() command in setup.py. However, the resulting extension library built by distutils does not recognize the LAPACK routines. What is weird is that if I take the exact same link command generated by distutils and execute it on the command line, I get an extension library that DOES recognize the LAPACK routines and in fact passes its regression tests. On the mac, if you set the following environment variables: RC_TRACE_ARCHIVES and RC_TRACE_DYLIBS, you'll get a trace from ld specifying which static and dynamic libraries are loaded. Sure enough, when executed from distutils, the link step doesn't load in the vecLib framework, but it does when issued from the command line. All the other libraries are loaded the same, although the order is somewhat different between the two cases. For what it is worth, this is the generated link command: c++ -L/sw/lib -bundle -flat_namespace -undefined suppress build/temp.darwin-6.8-PowerMacintosh-2.3/Epetra_wrap.o -LCommon -L/usr/local/lib -L/usr/local/lib -L/sw/lib/python2.3/config -lcommon -lepetra -lswigpy -lpython2.3 -o build/lib.darwin-6.8-PowerMacintosh-2.3/_Epetra.so -framework veclib -lSystem Any help will be appreciated. ** Bill Spotz ** ** Sandia National Laboratories Voice: (505)845-0170 ** ** P.O. Box 5800 Fax: (505)284-5451 ** ** Albuquerque, NM 87185-0316 Email: wfspotz@sandia.gov **
On 17-dec-03, at 19:16, Bill Spotz wrote:
I am hoping someone will be able to shed some light on this strange problem I'm having.
I am trying to develop a C++ extension to python that must link with LAPACK. I am doing my development on the Mac, so I want to link with -framework veclib.
OS: Mac OS X 10.2.8 python: 2.3 (via fink) gcc: 3.1
I am using distutils to build the extension, and assign ["-framework veclib -lSystem"] to the extra_link_args argument of the setup() command in setup.py. However, the resulting extension library built by distutils does not recognize the LAPACK routines.
I always use constructs like ["-framework", "veclib", "-lSystem"]. Could it be that by passing it as a single string it is somehow passed to the linker as a single argument? -- Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman
Wow, that did it. That never would have occurred to me. Thanks. On Wednesday, December 17, 2003, at 01:30 PM, Jack Jansen wrote:
On 17-dec-03, at 19:16, Bill Spotz wrote:
I am hoping someone will be able to shed some light on this strange problem I'm having.
I am trying to develop a C++ extension to python that must link with LAPACK. I am doing my development on the Mac, so I want to link with -framework veclib.
OS: Mac OS X 10.2.8 python: 2.3 (via fink) gcc: 3.1
I am using distutils to build the extension, and assign ["-framework veclib -lSystem"] to the extra_link_args argument of the setup() command in setup.py. However, the resulting extension library built by distutils does not recognize the LAPACK routines.
I always use constructs like ["-framework", "veclib", "-lSystem"]. Could it be that by passing it as a single string it is somehow passed to the linker as a single argument? -- Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman
** Bill Spotz ** ** Sandia National Laboratories Voice: (505)845-0170 ** ** P.O. Box 5800 Fax: (505)284-5451 ** ** Albuquerque, NM 87185-0316 Email: wfspotz@sandia.gov **
participants (2)
-
Bill Spotz
-
Jack Jansen