[Numpy-discussion] Is there a known problem compiling numpy with VC7? Success

Tim Hochberg tim.hochberg at cox.net
Thu Feb 9 10:34:03 CST 2006


Travis Oliphant wrote:

> Tim Hochberg wrote:
>
>>>
>>>
>>> I'm trying to incorporate your changes.
>>
>>
>>
>>
>> Great.
>>
>>
>> OK, we'll have to work out something that works for both. The issue 
>> here on windows is that compiling the testcode requires python.lib, 
>> and it doesn't get found unless that directory is specified. The 
>> problem is perhaps related to the following comment in system_info.py
>>
>> if sys.platform == 'win32': # line 116
>>    default_lib_dirs = ['C:\\'] # probably not very helpful...
>
>
>
> I added the change you made in setup.py to default_lib_dirs, here.  
> See if this fixes it.
>
>>>
>>> 3) For the setup.py file in random you are using Advapi for all 
>>> win32 platforms.  But, this seems to be a windows NT file
>>
>>
>>
>> I'm compiling on XP FWIW.
>>
>>> or at least only needed when compiling with certain compilers.  
>>> Mingw32 built just fine without it.   So, I'm not sure how to handle 
>>> this.
>>
>>
> I see now.  On _WIN32 platforms it's using the registry instead of the 
> file system to store things.  I modified the random/setup.py script to 
> test for _WIN32 in the compiler and add the dll to the list of 
> libraries if it is found.   I'm also reading the configuration file to 
> determine MATHLIB.
>
> Can you try out the new SVN and see if it builds for you without 
> modification.



There's a shallow error in system_info.py

  File "C:\Documents and 
Settings\End-user\Desktop\numpy\svn\numpy\numpy\distutils\system_info.py",
line 118, in ?
    default_lib_dirs = ['C:\\',
NameError: name 'join' is not defined

Just replacing join with os.path.join fixed that. However, it didn't 
help. I had this fantasy that default_lib_dirs would get picked up 
automagically; however that does not happen. I still ended up putting:

            from  numpy.distutils import system_info
            library_dirs = system_info.default_lib_dirs
            result = 
config_cmd.try_run(tc,include_dirs=[python_include], 
library_dirs=library_dirs)

into setup.py. Is that acceptable? It's not very elegant.

The changes to setup.py in random and the M_PI, seem to have worked 
since with the changes above it compiles and passes all of the tests 
except for the previously mentioned test_minrelpath.

-tim






More information about the Numpy-discussion mailing list