提交 c138b770 authored 作者: notoraptor's avatar notoraptor

Move configuration of libgpuarray folder for Windows into GpuArrayType.

上级 e10d5c5a
......@@ -1584,12 +1584,7 @@ def std_include_dirs():
python_inc_dirs = ([py_inc] if py_inc == py_plat_spec_inc
else [py_inc, py_plat_spec_inc])
gof_inc_dir = os.path.abspath(os.path.dirname(__file__))
other_dirs = []
if sys.platform == 'win32':
alt_inc_dir = os.path.abspath(os.path.normpath(sys.exec_prefix + '\Library\include'))
if os.path.exists(alt_inc_dir) and os.path.isdir(alt_inc_dir):
other_dirs.append(alt_inc_dir)
return numpy_inc_dirs + python_inc_dirs + [gof_inc_dir] + other_dirs
return numpy_inc_dirs + python_inc_dirs + [gof_inc_dir]
def std_lib_dirs_and_libs():
......@@ -1607,9 +1602,6 @@ def std_lib_dirs_and_libs():
# Also add directory containing the Python library to the library
# directories.
python_lib_dirs = [os.path.join(os.path.dirname(python_inc), 'libs')]
alt_inc_dir = os.path.abspath(os.path.normpath(sys.exec_prefix + '\Library\lib'))
if os.path.exists(alt_inc_dir) and os.path.isdir(alt_inc_dir):
python_lib_dirs.append(alt_inc_dir)
if "Canopy" in python_lib_dirs[0]:
# Canopy stores libpython27.a and libmsccr90.a in this directory.
# For some reason, these files are needed when compiling Python
......
from __future__ import absolute_import, print_function, division
import sys, os
import numpy as np
import six.moves.copyreg as copyreg
from six import iteritems
......@@ -470,7 +471,19 @@ class GpuArrayType(Type):
'<gpuarray_api.h>']
def c_header_dirs(self):
return [pygpu.get_include(), np.get_include()]
other_dirs = []
if sys.platform == 'win32':
alt_inc_dir = os.path.abspath(os.path.normpath(sys.exec_prefix + '\Library\include'))
if os.path.exists(alt_inc_dir) and os.path.isdir(alt_inc_dir):
other_dirs.append(alt_inc_dir)
return [pygpu.get_include(), numpy.get_include()] + other_dirs
def c_lib_dirs(self):
if sys.platform == 'win32':
alt_lib_dir = os.path.abspath(os.path.normpath(sys.exec_prefix + '\Library\lib'))
if os.path.exists(alt_lib_dir) and os.path.isdir(alt_lib_dir):
return [alt_lib_dir]
return []
def c_libraries(self):
return ['gpuarray']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论