Created
November 20, 2014 13:05
-
-
Save bjodah/7f3c9725e2fad7c41eb1 to your computer and use it in GitHub Desktop.
Compiler crash when gdb_debug=True and multiple tempate typenames are used.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# distutils: language = c++ | |
from func cimport func as _func | |
def func(double inp): | |
cdef double out | |
_func[double, double](&inp, &out); | |
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace myfunc { | |
template<typename T, typename U> | |
void func(const T * const in, U * const out){ | |
*out = 2*(*in); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cdef extern from "func.h" namespace "myfunc": | |
cdef void func[T, U](const T * const, U * const) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from _func import func | |
if __name__ == '__main__': | |
print(func(3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from Cython.Build import cythonize | |
ext_mod = cythonize("_func.pyx", gdb_debug=True) | |
setup( | |
ext_modules = ext_mod | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment