I'm looking into releasing a python package which includes an existing fortran or C program. The fortran/C program is compiled by running
./configure
make
The python code calls the resulting binary through subprocess calls (i.e. the code is not really wrapped as such). What I would like is that when the user types
python setup.py install
the fortran/C program is first compiled using the ./configure
and make
commands, then I want the python module to be installed, and the binary to be installed in the python bin/
directory alongside executables that are usually installed via the scripts=
option in distutils.core.setup
.
First, are there any problems with doing this? And if not, what is the best way to do it via setup.py
? Are there existing functions to automate the ./configure
and make
, since this is pretty standard? Or should I just use os.system
calls? And either way, where should those commands go in setup.py
? Then should I have make
output the binary to e.g. scripts/
and then have scripts=['scripts/mybinary']
in the setup()
function?