Skip to content

Commit 24b7059

Browse files
authored
Merge pull request #45 from gpilab/develop
Restore gpi_make functionality on Windows
2 parents ea40766 + e7afbcf commit 24b7059

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

include/PyFI/PyFIArray.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using namespace std;
3737

3838
#include <stdio.h>
3939
#include <stdlib.h>
40+
#define _USE_MATH_DEFINES // Windows needs this to get M_PI and other constants
4041
#include <math.h> /* fabs */
4142

4243
#include "PyFI/PyFIMacros.h"

include/PyFI/PyFIArray_WrappedFFTW.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
#include "PyFI/PyFunctionIF.cpp"
115115
#include "PyFI/PyFIArray.cpp"
116116

117+
#define _USE_MATH_DEFINES // Windows needs this to get M_PI and other constants
117118
#include <math.h>
118119
#include <fftw3.h>
119120
#include <string.h>

launch/gpi.command

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ elif [ "$(uname)" == "Linux" ]; then
5252
$PYTHON $GPI_LAUNCH -style cleanlooks $@
5353
# Windows
5454
else
55-
python -u gpi_launch -style Windows $@
55+
GPI_LAUNCH=${ANACONDA}/Scripts/gpi_launch
56+
PYTHON=${ANACONDA}/python
57+
${PYTHON} -u ${GPI_LAUNCH} -style Windows $@
5658
fi
5759

5860

lib/gpi/make.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ def make(GPI_PREFIX=None):
244244
print("Adding GPI include directory")
245245
if GPI_PREFIX is not None:
246246
include_dirs.append(os.path.join(GPI_PREFIX, 'include'))
247+
if platform.system() == 'Windows':
248+
include_dirs.append(os.path.join(GPI_PREFIX, 'Library/include'))
247249

248250
parser = optparse.OptionParser()
249251
parser.add_option('--preprocess', dest='preprocess', default=False,
@@ -328,8 +330,10 @@ def make(GPI_PREFIX=None):
328330
# Anaconda environment includes
329331
# includes FFTW and eigen
330332
print("Adding Anaconda lib and inc dirs...")
331-
# include_dirs += [os.path.join(GPI_PREFIX, 'include')] - this is duplicated above
332-
library_dirs += [os.path.join(GPI_PREFIX, 'lib')]
333+
if platform.system() == 'Windows':
334+
library_dirs += [os.path.join(GPI_PREFIX, 'Library/lib')]
335+
else:
336+
library_dirs += [os.path.join(GPI_PREFIX, 'lib')]
333337
include_dirs += [numpy.get_include()]
334338

335339
# GPI library dirs

0 commit comments

Comments
 (0)