On 7/14/2011 6:56 PM, Chris Barker wrote:
Hi folks,

I'm trying to build numpy HEAD on Windows in preparation for the SciPy
sprints tomorrow. I've never built numpy on Windows, and I'm new to git,
so I could be doing any number of things wrong.

I think I have the latest code:

C:\Documents and Settings\Chris\My Documents\SciPy\numpy_git\numpy>git
log -1
commit 6fdfd9c070ce943415d75780702a22f4bbd8f837
Author: Ben Walsh<[email protected]>
Date:   Tue Jul 12 14:52:01 2011 +0100

I tried to build it with a simple:

python setup.py build_ext --inplace

and got:

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL
/nologo /INCRE
MENTAL:NO /LIBPATH:c:\python27\libs /LIBPATH:c:\python27\PCbuild
/LIBPATH:build\
temp.win32-2.7 /EXPORT:init_dummy
build\temp.win32-2.7\Release\numpy\core\src\du
mmymodule.obj /OUT:numpy\core\_dummy.pyd
/IMPLIB:build\temp.win32-2.7\Release\nu
mpy\core\src\_dummy.lib
/MANIFESTFILE:build\temp.win32-2.7\Release\numpy\core\sr
c\_dummy.pyd.manifest
LINK : error LNK2001: unresolved external symbol init_dummy
build\temp.win32-2.7\Release\numpy\core\src\_dummy.lib : fatal error
LNK1120: 1
unresolved externals
error: Command "C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN\link.exe /DL
L /nologo /INCREMENTAL:NO /LIBPATH:c:\python27\libs
/LIBPATH:c:\python27\PCbuild
   /LIBPATH:build\temp.win32-2.7 /EXPORT:init_dummy
build\temp.win32-2.7\Release\n
umpy\core\src\dummymodule.obj /OUT:numpy\core\_dummy.pyd
/IMPLIB:build\temp.win3
2-2.7\Release\numpy\core\src\_dummy.lib
/MANIFESTFILE:build\temp.win32-2.7\Relea
se\numpy\core\src\_dummy.pyd.manifest" failed with exit status 1120

Python 2.7.2, python.org build (32 bit)
Visual Studio express 2008

That should work, yes?

Thanks for any hints.

-Chris


Hi Chris,

the build should work but it is probably better to install numpy in the site-packages directory (and be prepared for crashes and test failures). A patch for the build issues is attached. Remove the build directory before rebuilding.

Christoph
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index d5f2edc..b7f6670 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -349,7 +349,7 @@ def check_types(config_cmd, ext, build_dir):
 def check_mathlib(config_cmd):
     # Testing the C math library
     mathlibs = []
-    mathlibs_choices = [[],['m'],['cpml']]
+    mathlibs_choices = [[],['cpml']]
     mathlib = os.environ.get('MATHLIB')
     if mathlib:
         mathlibs_choices.insert(0,mathlib.split(','))
diff --git a/numpy/core/src/dummymodule.c b/numpy/core/src/dummymodule.c
index 595f84d..8aa4f2f 100644
--- a/numpy/core/src/dummymodule.c
+++ b/numpy/core/src/dummymodule.c
@@ -42,7 +42,7 @@ PyObject *PyInit__dummy(void) {
 }
 #else
 PyMODINIT_FUNC
-init_sort(void) {
+init_dummy(void) {
     Py_InitModule("_dummy", methods);
 }
 #endif
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index e85b24c..0d1841b 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -1169,7 +1169,7 @@ TIMEDELTA_md_m_multiply(char **args, npy_intp 
*dimensions, npy_intp *steps, void
     BINARY_LOOP {
         const npy_timedelta in1 = *(npy_timedelta *)ip1;
         const double in2 = *(double *)ip2;
-        if (in1 == NPY_DATETIME_NAT || isnan(in2)) {
+        if (in1 == NPY_DATETIME_NAT || npy_isnan(in2)) {
             *((npy_timedelta *)op1) = NPY_DATETIME_NAT;
         }
         else {
@@ -1184,7 +1184,7 @@ TIMEDELTA_dm_m_multiply(char **args, npy_intp 
*dimensions, npy_intp *steps, void
     BINARY_LOOP {
         const double in1 = *(double *)ip1;
         const npy_timedelta in2 = *(npy_timedelta *)ip2;
-        if (isnan(in1) || in2 == NPY_DATETIME_NAT) {
+        if (npy_isnan(in1) || in2 == NPY_DATETIME_NAT) {
             *((npy_timedelta *)op1) = NPY_DATETIME_NAT;
         }
         else {
@@ -1220,7 +1220,7 @@ TIMEDELTA_md_m_divide(char **args, npy_intp *dimensions, 
npy_intp *steps, void *
         }
         else {
             double result = in1 / in2;
-            if (isnan(result)) {
+            if (npy_isnan(result)) {
                 *((npy_timedelta *)op1) = NPY_DATETIME_NAT;
             }
             else {
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to