[Pythonmac-SIG] setup.py for Numeric/Numarray

Chris Barker Chris.Barker at noaa.gov
Mon Nov 22 21:08:22 CET 2004


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  
> VECLIB_PATH/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.

<trimmed by me: chb>

>> !     if sys.platform == "darwin":
>> !         lapack_include_dirs =   
>> ["Packages/LinearAlgebra2/Src",'Include/numarray']

>> -         lapack_link_args = ['-framework', 'vecLib']

>> !     VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework'
>> !     if os.path.exists(VECLIB_PATH):
>> !         lapack_link_args = ['-framework', 'vecLib']
>> !         lapack_include_dirs.append( os.path.join(VECLIB_PATH,  
>> 'Headers'))
>>           lapack_libs = []
>>           lapack_dirs = []

Todd Miller wrote:

> Not to look a patch-horse in the mouth, but IMHO,  the sys.platform idea
> is good but the VECLIB_PATH elimination maybe less so.  The reason I
> question the VECLIB_PATH 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  VECLIB_PATH
> 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 lapack_litemodule.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

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list