setup.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """qpOASES python distutils setup script."""
3 
4 #
5 # This file is part of qpOASES.
6 #
7 # qpOASES -- An Implementation of the Online Active Set Strategy.
8 # Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka,
9 # Christian Kirches et al. All rights reserved.
10 #
11 # qpOASES is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU Lesser General Public
13 # License as published by the Free Software Foundation; either
14 # version 2.1 of the License, or (at your option) any later version.
15 #
16 # qpOASES is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 # See the GNU Lesser General Public License for more details.
20 #
21 # You should have received a copy of the GNU Lesser General Public
22 # License along with qpOASES; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #
25 
26 #
27 # Filename: setup.py
28 # Author: Sebastian F. Walter, Manuel Kudruss
29 # Version: 3.2
30 # Date: 2013-2015
31 #
32 
33 import os
34 import numpy as np
35 
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
40 
41 BASEDIR = os.path.dirname(os.path.abspath(__file__))
42 BASEDIR = os.path.dirname(BASEDIR)
43 BASEDIR = os.path.dirname(BASEDIR)
44 
45 extra_params = {}
46 extra_params['include_dirs'] = [
47  '/usr/include',
48  os.path.join(BASEDIR, 'include'),
49  os.path.join(BASEDIR, 'include', 'qpOASES'),
50  np.get_include()]
51 extra_params['extra_compile_args'] = ["-O2", "-Wno-unused-variable"]
52 extra_params['extra_link_args'] = ["-Wl,-O1", "-Wl,--as-needed"]
53 
54 extra_params = extra_params.copy()
55 extra_params['libraries'] = ['qpOASES']
56 
57 extra_params['library_dirs'] = ['/usr/lib', os.path.join(BASEDIR, 'bin')]
58 extra_params['language'] = 'c++'
59 
60 if os.name == 'posix':
61  extra_params['runtime_library_dirs'] = extra_params['library_dirs']
62 
63 ext_modules = [
64  Extension("qpoases", ["qpoases.pyx", "qpoases.pxd"], **extra_params),
65 ]
66 
67 setup(
68  name='qpOASES interface',
69  cmdclass={'build_ext': build_ext},
70  ext_modules=cythonize(ext_modules),
71 )


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:04