-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
75 lines (49 loc) · 1.79 KB
/
Dockerfile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# A Docker image for running neuronal network simulations
#
FROM neuralensemble/base
MAINTAINER [email protected]
RUN ln -s /usr/bin/2to3-3.5 $VENV/bin/2to3
#### Set versions
ENV NEST_VER=3.3
ENV NRN_VER=8.1.0
ENV BRIAN2_VER=2.5.1
ENV PYNN_VER=0.10.1
#### Install NEST
ENV NEST=nest-simulator-$NEST_VER
WORKDIR $HOME/packages
RUN wget https://github.com/nest/nest-simulator/archive/v$NEST_VER.tar.gz -O $HOME/packages/$NEST.tar.gz;
RUN tar xzf $NEST.tar.gz; rm $NEST.tar.gz
RUN git clone https://github.com/INCF/libneurosim.git
RUN cd libneurosim; git checkout 03646747c8fe64fa3439ac2d282623b659f60c22; ./autogen.sh
RUN mkdir $VENV/build
WORKDIR $VENV/build
RUN mkdir libneurosim; \
cd libneurosim; \
PYTHON=$VENV/bin/python $HOME/packages/libneurosim/configure --prefix=$VENV; \
make; make install; ls $VENV/lib $VENV/include
RUN mkdir $NEST; \
cd $NEST; \
ln -s /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so $VENV/lib/; \
cmake -DCMAKE_INSTALL_PREFIX=$VENV \
-Dwith-mpi=ON \
###-Dwith-music=ON \
-Dwith-libneurosim=ON \
-DPYTHON_EXECUTABLE:FILEPATH=$VENV/bin/python \
-DPYTHON_LIBRARY=$VENV/lib/libpython3.8.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
$HOME/packages/$NEST; \
make -j7; make install
#### Install NEURON
RUN $VENV/bin/pip install neuron==$NRN_VER
#### Install Brian2
# Note: Brian 1.4.1 not Python 3 compatible
RUN $VENV/bin/pip install brian2==$BRIAN2_VER
#### Set paths
ENV PATH=$PATH:$VENV/bin
#### Install PyNN
RUN $VENV/bin/pip install PyNN==$PYNN_VER
RUN cd /home/docker/env/neurosci/lib/python3.8/site-packages/pyNN/neuron/nmodl; nrnivmodl; cd -
#### Activate Python environment
WORKDIR /home/docker/
RUN echo "source $VENV/bin/activate" >> .bashrc