forked from xuy/pyipopt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
41 lines (35 loc) · 1.12 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Originally contributed by Lorne McIntosh.
# Modified by Eric Xu
# ========= Edit The Line Below ==============
IPOPT_DIR='/home/Grads/2008/ebogart/Ipopt-3.10.1/build/'
# ========= Edit The Line Above ==============
# ========= Don't touch things below this ====
import os
from distutils.core import setup
from distutils.extension import Extension
if os.path.isdir(IPOPT_DIR + 'lib'):
IPOPT_LIB=IPOPT_DIR+"lib"
else:
IPOPT_LIB=IPOPT_DIR+"lib64"
IPOPT_INC=IPOPT_DIR+"include/coin/"
#find the numpy headers automatically
numpy_include = ""
try:
import numpy
numpy_include = numpy.get_include()
except: pass
FILES = ["src/callback.c", "src/pyipopt.c"]
setup(name="pyipopt",
version="0.8",
description="An IPOPT connector for Python",
author="Eric Xu",
author_email="[email protected]",
url="https://github.com/xuy/pyipopt",
ext_modules=[
Extension("pyipopt",FILES,
extra_link_args=['-Wl,--rpath','-Wl,'+ IPOPT_LIB],
library_dirs=[IPOPT_LIB],
libraries=['ipopt','blas','coinhsl','lapack','coinmetis','dl','m'],
include_dirs=[numpy_include,IPOPT_INC]),
]
)