Skip to content

Commit 5dc41d5

Browse files
committed
The new makefile
1 parent 4e40e48 commit 5dc41d5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
CC = gcc
2+
CFLAGS = -g -fpic -shared
3+
LDFLAGS = -lipopt -lg2c -lm
4+
PY_DIR = /usr/lib/python2.5
5+
6+
# Change this to your ipopt include path that includes IpStdCInterface.h
7+
IPOPT_INCLUDE = /Project/ThirdParty/ipopt/Ipopt-3.3.3/include/ipopt/
8+
9+
# Change this to your python dir which includes Python.h
10+
# You might need to download the python source code or install python-dev to get
11+
# this header file. Note that Pyipopt needs this as an extend python module.
12+
PYTHON_INCLUDE = /usr/local/include/python2.5
13+
14+
# Change this to your numpy include path which contains numpy/arrayobject.h
15+
# If you don't want this and would like to use list. I have a nasty (and unmaintained version) in the package called pyipopt-list.c. You can compile it and use it without numpy.
16+
# However, numpy is strongly suggested.
17+
18+
NUMPY_INCLUDE = /usr/lib/python2.5/site-packages/numpy/core/include
19+
20+
pyipopt: callback.c pyipopt.c
21+
$(CC) -o pyipopt.o -I$(PYTHON_INCLUDE) -I$(IPOPT_INCLUDE) -I$(NUMPY_INCLUDE) $(CFLAGS) $(LDFLAGS) pyipopt.c callback.c
22+
23+
install: pyipopt
24+
cp ./pyipopt.so $(PY_DIR)
25+
clean:
26+
rm pyipopt.o

0 commit comments

Comments
 (0)