Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 install? #17

Open
CoryWeber opened this issue Feb 26, 2017 · 10 comments
Open

Windows 10 install? #17

CoryWeber opened this issue Feb 26, 2017 · 10 comments

Comments

@CoryWeber
Copy link

I love this package and use it on Linux workstations at work, but would really like to get it working on my Windows laptop. Has anyone successfully installed this on Windows 10? If so, what Python, Numpy, and Scipy did you use?

I've tried it on Anaconda and with just Python 2.7.x with Numpy and Scipy packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and both times it fails when calling Microsoft compilers. I have the Microsoft compiler for pythong installed.

@cgohlke
Copy link

cgohlke commented Feb 26, 2017

Just uploaded wheels at http://www.lfd.uci.edu/~gohlke/pythonlibs/#fdint

@scott-maddox
Copy link
Owner

Trying to compile right now on Windows 10. It looks like it might be a Windows vs. Unix path (i.e. '\' vs '/') issue.

@cgohlke Did you have to make any changes to the setup.py or source code to get it to compile?

@cgohlke
Copy link

cgohlke commented Feb 26, 2017

Did you have to make any changes to the setup.py

Yes, the names of the extensions should use . instead of /, e.g. "fdint._fdint" instead of "fdint/_fdint".

@scott-maddox
Copy link
Owner

scott-maddox commented Feb 26, 2017

@cgohlke Did you run into the following error when trying to test the package, and if so how did you fix it? Clearly my packaging experience on Windows is limited (i.e. nonexistent)...

ImportError: DLL load failed: %1 is not a valid Win32 application.

Edit: Nevermind, it seems to work fine through powershell. Should have a new version out with the appropriate fixes soon.

@scott-maddox
Copy link
Owner

Fixed in v2.0.2

@cgohlke
Copy link

cgohlke commented Feb 26, 2017

Too late for 2.0.2, but may I also suggest two other changes:

  1. use ssize_t type for indices and lengths. This fixes many compiler warnings of type conversion from 'npy_intp' to 'int', possible loss of data on 64-bit.:
diff --git a/scripts/gen__vdfd_pyx.py b/scripts/gen__vdfd_pyx.py
index 0851608..bf45cf2 100644
--- a/scripts/gen__vdfd_pyx.py
+++ b/scripts/gen__vdfd_pyx.py
@@ -16,9 +16,9 @@ cpdef void vdfd{a}h(np.ndarray[double] phi, np.ndarray[double] out):
     \'\'\'
     Vectorized form of dfd{a}h.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = dfd{a}h(phi[i])
 '''.format(a=a))
diff --git a/scripts/gen__vdgfd_pyx.py b/scripts/gen__vdgfd_pyx.py
index 10913ce..ea3160e 100644
--- a/scripts/gen__vdgfd_pyx.py
+++ b/scripts/gen__vdgfd_pyx.py
@@ -17,10 +17,10 @@ cpdef void vdgfd{a}h(np.ndarray[double] phi, np.ndarray[double] beta,
     \'\'\'
     Vectorized form of dgfd{a}h.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == beta.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = dgfd{a}h(phi[i], beta[i])
 '''.format(a=a))
diff --git a/scripts/gen__vdnonparabolic_pyx.py b/scripts/gen__vdnonparabolic_pyx.py
index 4c06283..9f35273 100644
--- a/scripts/gen__vdnonparabolic_pyx.py
+++ b/scripts/gen__vdnonparabolic_pyx.py
@@ -15,10 +15,10 @@ cpdef void vdnonparabolic(np.ndarray[double] phi, np.ndarray[double] alpha,
     \'\'\'
     Vectorized form of dnonparabolic.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == alpha.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = dnonparabolic(phi[i], alpha[i])
 ''')
\ No newline at end of file
diff --git a/scripts/gen__vfd_pyx.py b/scripts/gen__vfd_pyx.py
index a355bac..679404e 100644
--- a/scripts/gen__vfd_pyx.py
+++ b/scripts/gen__vfd_pyx.py
@@ -16,9 +16,9 @@ cpdef void vfd{a}h(np.ndarray[double] phi, np.ndarray[double] out):
     \'\'\'
     Vectorized form of fd{a}h.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = fd{a}h(phi[i])
 '''.format(a=a))
diff --git a/scripts/gen__vgfd_pyx.py b/scripts/gen__vgfd_pyx.py
index 6455a96..194a395 100644
--- a/scripts/gen__vgfd_pyx.py
+++ b/scripts/gen__vgfd_pyx.py
@@ -17,10 +17,10 @@ cpdef void vgfd{a}h(np.ndarray[double] phi, np.ndarray[double] beta,
     \'\'\'
     Vectorized form of gfd{a}h.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == beta.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = gfd{a}h(phi[i], beta[i])
 '''.format(a=a))
diff --git a/scripts/gen__vifd_pyx.py b/scripts/gen__vifd_pyx.py
index 802984c..9200056 100644
--- a/scripts/gen__vifd_pyx.py
+++ b/scripts/gen__vifd_pyx.py
@@ -15,9 +15,9 @@ cpdef void vifd{a}h(np.ndarray[double] phi, np.ndarray[double] out):
     \'\'\'
     Vectorized form of ifd{a}h.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = ifd{a}h(phi[i])
 '''.format(a=a))
diff --git a/scripts/gen__vnonparabolic_pyx.py b/scripts/gen__vnonparabolic_pyx.py
index aa0e0ab..09d603d 100644
--- a/scripts/gen__vnonparabolic_pyx.py
+++ b/scripts/gen__vnonparabolic_pyx.py
@@ -15,10 +15,10 @@ cpdef void vnonparabolic(np.ndarray[double] phi, np.ndarray[double] alpha,
     \'\'\'
     Vectorized form of nonparabolic.
     \'\'\'
-    cdef int imax = phi.shape[0]
+    cdef ssize_t imax = phi.shape[0]
     assert imax == alpha.shape[0]
     assert imax == out.shape[0]
-    cdef int i
+    cdef ssize_t i
     for i in range(imax):
         out[i] = nonparabolic(phi[i], alpha[i])
 ''')
\ No newline at end of file
  1. Python 3 fix for the example:
diff --git a/fdint/examples/plot.py b/fdint/examples/plot.py
index 639f54b..5d1c0d6 100644
--- a/fdint/examples/plot.py
+++ b/fdint/examples/plot.py
@@ -49,7 +49,7 @@ def plot_fd_and_dfd():
     fig, ax1 = plt.subplots()
     prefix='fd'
     ax1.set_title(prefix)
-    for k2 in xrange(-9,22,2):
+    for k2 in range(-9,22,2):
         k = k2/2.
         k2s = str(k2).replace('-','m')

@@ -71,7 +71,7 @@ def plot_gfd_and_dgfd(beta):
     fig, ax1 = plt.subplots()
     prefix='gfd'
     ax1.set_title(prefix+' beta='+str(beta))
-    for k2 in xrange(-1,6,2):
+    for k2 in range(-1,6,2):
         k = k2/2.
         k2s = str(k2).replace('-','m')

@CoryWeber
Copy link
Author

Thanks. I'll try it out tomorrow.

@CoryWeber
Copy link
Author

CoryWeber commented Mar 1, 2017 via email

@scott-maddox
Copy link
Owner

I need to investigate the numpy+MKL issue. It worked for me on a fresh install, so it's not clear why MKL was required. Is it reasonable to require MKL?

I'll open a separate issue for the issues brought up by cgohlke.

@scott-maddox scott-maddox reopened this Mar 7, 2017
@cgohlke
Copy link

cgohlke commented Mar 7, 2017

Is it reasonable to require MKL?

No, I don't see why fdint would require numpy+MKL. Official numpy should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants