[Pythonmac-SIG] setup.py for Numeric/Numarray (original) (raw)
Chris Barker Chris.Barker at noaa.gov
Mon Nov 22 21:08:22 CET 2004
- Previous message: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc?
- Next message: [Pythonmac-SIG] setup.py for Numeric/Numarray
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
Bob's patch to the Numeric setup.py made it's way to the numaray CVS, and there is a little discussion about improvements. I really don't know what to say but if some if the OS-X experts (Bob and Jack, anyway!) on this list could weigh in, the would be great. Here is a consolidation of the thread:
Andrea Riciputi wrote:
I've noticed your patch for MacOS X, and I think that a better solution should use sys.platform instead of a path search, since Apple could always change its framework location. I've also removed the VECLIBPATH/Headers from the include path because AFAIK Apple gcc already knows where to search for the vecLib framework. Here it is a diff output between my addons.py and the CVS one.
! if sys.platform == "darwin": ! lapackincludedirs = ["Packages/LinearAlgebra2/Src",'Include/numarray']
- lapacklinkargs = ['-framework', 'vecLib']
! VECLIBPATH = '/System/Library/Frameworks/vecLib.framework' ! if os.path.exists(VECLIBPATH): ! lapacklinkargs = ['-framework', 'vecLib'] ! lapackincludedirs.append( os.path.join(VECLIBPATH, 'Headers')) lapacklibs = [] lapackdirs = []
Todd Miller wrote:
Not to look a patch-horse in the mouth, but IMHO, the sys.platform idea is good but the VECLIBPATH elimination maybe less so. The reason I question the VECLIBPATH change is that we're removing explicit and generally harmless extra information in exchange for two assumptions: (1) gcc knows the path already (2) the numarray Mac user is using gcc. Other opinions? Mac users please speak up if you think the VECLIBPATH change is a good one or it won't get done.
Andrea Riciputi wrote:
I see your point but AFAIK the links option "-framework vecLib" will work only with Apple gcc (ld) and Apple gcc (ld) does know where frameworks are. From Apple ld man page:
-framework name[,suffix] Specifies a framework to link against. Frameworks are dynamic shared libraries, but they are stored in different locations, and therefore must be searched for differently. When this option is specified, ld searches for framework `name.framework/name' first in any directories specified with the -F option, then in the standard framework directories /Library/Frameworks, /Net- work/Library/Frameworks, and /System/Library/Frameworks. The placement of the -framework option is significant, as it deter- mines when and how the framework is searched. If the optional suffix is specified the framework is first searched for the name with the suffix and then without.
-Fdir In Apple's version of GCC only, add the directory dir to the head of the list of directories to be searched for frameworks. The framework search algorithm is, for an inclusion of <Fmwk/Header.h>, to look for files named path/Fmwk.framework/Head- ers/Header.h or path/Fmwk.framework/PrivateHeaders/Header.h where path includes /System/Library/Frameworks/ /Library/Frameworks/, and /Local/Library/Frameworks/, plus any additional paths specified by -F.
Robert Kern wrote:
IBM's xlc will also find the appropriate framework, but as you can see this is only a link-time option and has nothing to do with finding headers.
Using #include <vecLib/vecLib.h> will find the appropriate header without any command-line options. Using #include <clapack.h> will not. Fortunately, neither one is used nor needed by lapacklitemodule.c, so for this case, no include-path needs to be specified.
If you don't want to post tot he NumPy list directly, I'd be glad to forward comments on.
-Chris
-- Christopher Barker, Ph.D. Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
- Previous message: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc?
- Next message: [Pythonmac-SIG] setup.py for Numeric/Numarray
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]