2 """qpOASES python distutils setup script.""" 36 from distutils.core
import setup
37 from distutils.extension
import Extension
38 from Cython.Distutils
import build_ext
39 from Cython.Build
import cythonize
41 BASEDIR = os.path.dirname(os.path.abspath(__file__))
42 BASEDIR = os.path.dirname(BASEDIR)
43 BASEDIR = os.path.dirname(BASEDIR)
46 extra_params[
'include_dirs'] = [
48 os.path.join(BASEDIR,
'include'),
49 os.path.join(BASEDIR,
'include',
'qpOASES'),
51 extra_params[
'extra_compile_args'] = [
"-O2",
"-Wno-unused-variable"]
52 extra_params[
'extra_link_args'] = [
"-Wl,-O1",
"-Wl,--as-needed"]
54 extra_params = extra_params.copy()
55 extra_params[
'libraries'] = [
'qpOASES']
57 extra_params[
'library_dirs'] = [
'/usr/lib', os.path.join(BASEDIR,
'bin')]
58 extra_params[
'language'] =
'c++' 60 if os.name ==
'posix':
61 extra_params[
'runtime_library_dirs'] = extra_params[
'library_dirs']
64 Extension(
"qpoases", [
"qpoases.pyx",
"qpoases.pxd"], **extra_params),
68 name=
'qpOASES interface',
69 cmdclass={
'build_ext': build_ext},
70 ext_modules=cythonize(ext_modules),