So, I created a C ++ class with class class.cpp, class.h. class.cpp uses some functions from gsl (it has #include <gsl/gsl_blas.h>
) I have no problem linking this to another C ++ file main.cpp, and I can compile it with
g++ -o main main.o class.o -I/home/gsl/include -lm -L/home/gsl/lib -lgsl -lgslcblas
Also, without including gsl libary in class.cpp, I was able to create a cython file that uses my class in class.cpp and it works.
However, when I try to combine the two (that is, using the C ++ class in cython, where the C ++ class uses gsl functions), I don't know what to do. I think I should turn on
I/home/gsl/include -lm -L/home/gsl/lib -lgsl -lgslcblas
somewhere in the setup file, but I donβt know where and how. My setup.py looks like
from distutils.core import setup from Cython.Build import cythonize import os os.environ["CC"] = "g++" os.environ["CXX"] = "g++" setup( name = "cy", ext_modules = cythonize('cy.pyx'), )
and I
# distutils: language = c++
at the beginning of my .pyx file.
Thanks for any help!
source share