diff --git a/aksetup_helper.py b/aksetup_helper.py index 42ea8cd9caa63e03e8046b4fefd002b7eb1866a5..8a274909ab5b073925010f91b2fe43c36dfb6926 100644 --- a/aksetup_helper.py +++ b/aksetup_helper.py @@ -5,6 +5,19 @@ distribute_setup.use_setuptools() import setuptools from setuptools import Extension +def count_down_delay(delay): + from time import sleep + import sys + while delay: + sys.stdout.write("Continuing in %d seconds... \r" % delay) + sys.stdout.flush() + delay -= 1 + sleep(1) + print("") + + + + if not hasattr(setuptools, "_distribute"): print("-------------------------------------------------------------------------") print("Setuptools conflict detected.") @@ -20,15 +33,8 @@ if not hasattr(setuptools, "_distribute"): print("I will continue after a short while, fingers crossed.") print("-------------------------------------------------------------------------") - delay = 10 + count_down_delay(delay=10) - from time import sleep - import sys - while delay: - sys.stdout.write("Continuing in %d seconds... \r" % delay) - sys.stdout.flush() - delay -= 1 - sleep(1) def setup(*args, **kwargs): from setuptools import setup @@ -156,15 +162,7 @@ def get_config(schema=None, warn_about_no_config=True): print("*** HIT Ctrl-C NOW IF THIS IS NOT WHAT YOU WANT") print("*************************************************************") - delay = 10 - - from time import sleep - import sys - while delay: - sys.stdout.write("Continuing in %d seconds... \r" % delay) - sys.stdout.flush() - delay -= 1 - sleep(1) + count_down_delay(delay=10) return schema.read_config() @@ -540,15 +538,7 @@ def set_up_shipped_boost_if_requested(conf): print("------------------------------------------------------------------------") conf["USE_SHIPPED_BOOST"] = False - delay = 10 - - from time import sleep - import sys - while delay: - sys.stdout.write("Continuing in %d seconds... \r" % delay) - sys.stdout.flush() - delay -= 1 - sleep(1) + count_down_delay(delay=10) if conf["USE_SHIPPED_BOOST"]: conf["BOOST_INC_DIR"] = ["bpl-subset/bpl_subset"] diff --git a/setup.py b/setup.py index 1e43659bee4fc208be5d83be616d46a758f74d76..878953935c055e451462a8697166d5fb0681a866 100644 --- a/setup.py +++ b/setup.py @@ -100,16 +100,27 @@ def main(): print("[1] http://www.makotemplates.org/") print("-------------------------------------------------------------------------") - delay = 5 - - from time import sleep - import sys - while delay: - sys.stdout.write("Continuing in %d seconds... \r" % delay) - sys.stdout.flush() - delay -= 1 - sleep(1) - print("") + from aksetup_helper import count_down_delay + count_down_delay(delay=5) + + might_be_cuda = False + for inc_dir in conf["CL_INC_DIR"]: + inc_dir = inc_dir.lower() + if "nv" in inc_dir or "cuda" in inc_dir: + might_be_cuda = True + + if might_be_cuda and conf["CL_ENABLE_DEVICE_FISSION"]: + print("-------------------------------------------------------------------------") + print("You might be compiling against Nvidia CUDA with device fission enabled.") + print("-------------------------------------------------------------------------") + print("That is not a problem on CUDA 4.0 and newer. If you are using CUDA 3.2,") + print("your build will break, because Nvidia shipped a broken CL header in") + print("in your version. The fix is to set CL_ENABLE_DEVICE_FISSION to False") + print("in your PyOpenCL configuration.") + print("-------------------------------------------------------------------------") + + from aksetup_helper import count_down_delay + count_down_delay(delay=5) setup(name="pyopencl", # metadata