From 7cdb2e52f5aa157cd3eee40307da9bf13c7b2d9a Mon Sep 17 00:00:00 2001 From: droemer7 Date: Mon, 23 Nov 2020 00:17:00 -0800 Subject: [PATCH] Update for python 3 --- pywrapper/RangeLibc.pyx | 4 +++- pywrapper/setup.py | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pywrapper/RangeLibc.pyx b/pywrapper/RangeLibc.pyx index 9979730..43b2508 100644 --- a/pywrapper/RangeLibc.pyx +++ b/pywrapper/RangeLibc.pyx @@ -1,3 +1,5 @@ +# cython: language_level=2 + from libcpp cimport bool from libcpp.string cimport string from libcpp.vector cimport vector @@ -349,4 +351,4 @@ cdef class PyNull: cpdef void calc_range_many(self,np.ndarray[float, ndim=2, mode="c"] ins, np.ndarray[float, ndim=1, mode="c"] outs): a = ins[0,0] b = outs[0] - c = outs.shape[0] \ No newline at end of file + c = outs.shape[0] diff --git a/pywrapper/setup.py b/pywrapper/setup.py index 852f596..2d92ab8 100644 --- a/pywrapper/setup.py +++ b/pywrapper/setup.py @@ -18,10 +18,10 @@ def check_for_flag(flag_str, truemsg=False, falsemsg=False): enabled = False if enabled and not truemsg == False: - print truemsg + print(truemsg) elif not enabled and not falsemsg == False: - print falsemsg - print " $ sudo "+flag_str+"=ON python setup.py install" + print(falsemsg) + print(" $ sudo "+flag_str+"=ON python setup.py install") return enabled use_cuda = check_for_flag("WITH_CUDA", \ @@ -29,11 +29,11 @@ def check_for_flag(flag_str, truemsg=False, falsemsg=False): "Compiling without CUDA support. To enable CUDA use:") trace = check_for_flag("TRACE", \ "Compiling with trace enabled for Bresenham's Line", \ - "Compiling without trace enabled for Bresenham's Line") + "Compiling without trace enabled for Bresenham's Line. To enable trace use:") -print -print "--------------" -print +print("") +print("--------------") +print("") # support for compiling in clang if platform.system().lower() == "darwin": @@ -59,13 +59,13 @@ def locate_cuda(): Starts by looking for the CUDAHOME env variable. If not found, everything is based on finding 'nvcc' in the PATH. """ - # print os.environ + # print(os.environ) # first check if the CUDAHOME env variable is in use if os.path.isdir("/usr/local/cuda-7.5"): - home = "/usr/local/cuda-7.5" + home = "/usr/local/cuda-7.5" nvcc = pjoin(home, 'bin', 'nvcc') elif os.path.isdir("/usr/local/cuda"): - home = "/usr/local/cuda" + home = "/usr/local/cuda" nvcc = pjoin(home, 'bin', 'nvcc') elif 'CUDAHOME' in os.environ: home = os.environ['CUDAHOME']