Skip to content
Snippets Groups Projects
Commit a12b3361 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Merge branch 'master' of tuck.ath.cx:src/pyopencl

parents 26640c90 dde1e34c
No related branches found
No related tags found
No related merge requests found
[submodule "bpl-subset"]
path = bpl-subset
url = http://git.tiker.net/trees/bpl-subset.git
......@@ -12,3 +12,5 @@ include configure.py
include Makefile.in
include aksetup_helper.py
include README_SETUP.txt
recursive-include bpl-subset
......@@ -479,6 +479,48 @@ class BoostLibraries(Libraries):
help="Library names for Boost C++ %s library (without lib or .so)"
% humanize(lib_base_name))
def set_up_shipped_boost_if_requested(conf):
"""Set up the package to use a shipped version of Boost.
Return a list of extra C files to build.
"""
if conf["USE_SHIPPED_BOOST"]:
from os.path import exists
if not exists("bpl-subset/bpl_subset/boost/version.hpp"):
raise RuntimeError("The shipped Boost library was not found.")
conf["BOOST_INC_DIR"] = ["bpl-subset/bpl_subset"]
conf["BOOST_LIB_DIR"] = []
conf["BOOST_PYTHON_LIBNAME"] = []
from glob import glob
source_files = (glob("bpl-subset/bpl_subset/libs/*/*/*/*.cpp")
+ glob("bpl-subset/bpl_subset/libs/*/*/*.cpp")
+ glob("bpl-subset/bpl_subset/libs/*/*.cpp"))
print len(source_files)
source_files = [f for f in source_files
if not f.startswith("bpl-subset/bpl_subset/libs/thread/src")]
print len(source_files)
import sys
if sys.platform == "nt":
print glob(
"bpl-subset/bpl_subset/libs/thread/src/win32/*.cpp")
source_files += glob(
"bpl-subset/bpl_subset/libs/thread/src/win32/*.cpp")
else:
print glob(
"bpl-subset/bpl_subset/libs/thread/src/pthread/*.cpp")
source_files += glob(
"bpl-subset/bpl_subset/libs/thread/src/pthread/*.cpp")
return (source_files,
{"BOOST_MULTI_INDEX_DISABLE_SERIALIZATION": 1}
)
else:
return [], {}
def make_boost_base_options():
return [
IncludeDir("BOOST", []),
......
bpl-subset @ eb21ae67
Subproject commit eb21ae675a7e5d9b7ca19303ce1bd2bf95444118
......@@ -22,6 +22,8 @@ def get_config_schema():
return ConfigSchema(make_boost_base_options() + [
BoostLibraries("python"),
Switch("USE_SHIPPED_BOOST", True, "Use included Boost library"),
Switch("CL_TRACE", False, "Enable OpenCL API tracing"),
Switch("CL_ENABLE_GL", False, "Enable OpenCL<->OpenGL interoperability"),
......@@ -40,18 +42,18 @@ def get_config_schema():
def main():
import glob
from aksetup_helper import hack_distutils, get_config, setup, \
NumpyExtension
from aksetup_helper import (hack_distutils, get_config, setup,
NumpyExtension, set_up_shipped_boost_if_requested)
hack_distutils()
conf = get_config(get_config_schema())
EXTRA_OBJECTS, EXTRA_DEFINES = set_up_shipped_boost_if_requested(conf)
LIBRARY_DIRS = conf["BOOST_LIB_DIR"]
LIBRARIES = conf["BOOST_PYTHON_LIBNAME"]
from os.path import dirname, join, normpath
EXTRA_DEFINES = { }
EXTRA_INCLUDE_DIRS = []
EXTRA_LIBRARY_DIRS = []
EXTRA_LIBRARIES = []
......@@ -137,7 +139,7 @@ def main():
NumpyExtension("_cl",
[
"src/wrapper/wrap_cl.cpp",
],
]+EXTRA_OBJECTS,
include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS,
library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"],
libraries=LIBRARIES + conf["CL_LIBNAME"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment