Building the Python module only

Author

Christoph Schmidt-Hieber

Date

19 August, 2021

Building only the standalone Python file i/o module is fairly straightforward. First, you need a couple of libraries:

$ sudo apt-get install build-essential git libboost-dev python-dev python-numpy libhdf5-serial-dev swig

Then, you need the Stimfit source code:

$ cd $HOME
$ git clone https://github.com/neurodroid/stimfit.git

It will download the code to a directory called stimfit.

Next, you need to generate the build system:

$ cd $HOME/stimfit
$ ./autogen.sh

Now you can configure. I strongly recommend building in a separate directory.

$ cd $HOME/stimfit
$ mkdir build
$ cd build
$ mkdir module
$ cd module
$ ../../configure --enable-module

We recommend to use BioSig to read extra biomedical fileformats (see Building Stimfit with BioSig import filter) :

$ ../../configure --enable-module --with-biosiglite

Building stfio for non-default Python distributions

To install the stfio module in distributions such as Anaconda Python, use the argument –prefix= to specify the path where the Python distribution is installed. For example, to install stfio for Anaconda Python 2.7 use:

$ ../../configure --enable-module --prefix=$HOME/anaconda/

If using virtual environment, try something like this:

$ ../../configure --enable-module --prefix=$HOME/anaconda/envs/py36

Other Python versions are also possible. For example, to install the module in your local Python version, you could use:

$ ../../configure --enable-module --prefix=$HOME/.local/lib/python2.7

Then, build and install:

$ make -j 4 # where 4 refers to the number of parallel build processes
$ sudo make install

Finally, run python to test the module, as described in The stfio module.