Skip to content

Instantly share code, notes, and snippets.

@vogdb
Last active August 19, 2019 08:50
Show Gist options
  • Save vogdb/e76f2d346865371a6287e7085afd2e25 to your computer and use it in GitHub Desktop.
Save vogdb/e76f2d346865371a6287e7085afd2e25 to your computer and use it in GitHub Desktop.

Revisions

  1. vogdb revised this gist Aug 17, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install neuron + iv script
    Original file line number Diff line number Diff line change
    @@ -37,8 +37,8 @@ then
    echo "Installing NEURON ..."
    make -j4 install >install.log 2>&1

    export PATH="${INSTALL_DIR}/x86_64/bin":${PATH}
    export PYTHONPATH="${INSTALL_DIR}/lib/python":${PYTHONPATH}
    export PATH="${INSTALL_DIR}/nrn/x86_64/bin":${PATH}
    export PYTHONPATH="${INSTALL_DIR}/nrn/lib/python":${PYTHONPATH}

    cd src/nrnpython
    python setup.py install
  2. vogdb created this gist Aug 14, 2019.
    55 changes: 55 additions & 0 deletions install neuron + iv script
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    #!/bin/sh
    echo "IMPORTANT! INSTALL_DIR arg must be an absolute path!"
    set -e

    SRC_DIR=$1
    INSTALL_DIR=$2

    if [ ! -e ${INSTALL_DIR}/.install_finished ]
    then
    echo 'Neuron was not fully installed in previous build, installing ...'
    mkdir -p ${SRC_DIR}
    cd ${SRC_DIR}
    echo "Downloading IV ..."
    rm -rf iv
    git clone --depth 1 https://github.com/neuronsimulator/iv.git >download.log 2>&1
    cd iv
    echo "Preparing IV ..."
    ./build.sh >prepare.log 2>&1
    echo "Configuring IV ..."
    ./configure --prefix=${INSTALL_DIR}/iv >configure.log 2>&1
    echo "Building IV ..."
    make -j4 >make.log 2>&1
    echo "Installing IV ..."
    make -j4 install >install.log 2>&1
    cd ..

    echo "Downloading NEURON ..."
    rm -rf nrn
    git clone --depth 1 https://github.com/neuronsimulator/nrn.git >download.log 2>&1
    cd nrn
    echo "Preparing NEURON ..."
    ./build.sh >prepare.log 2>&1
    echo "Configuring NEURON ..."
    ./configure --prefix=${INSTALL_DIR}/nrn --with-iv=${INSTALL_DIR}/iv --with-nrnpython=python --disable-rx3d >configure.log 2>&1
    echo "Building NEURON ..."
    make -j4 >make.log 2>&1
    echo "Installing NEURON ..."
    make -j4 install >install.log 2>&1

    export PATH="${INSTALL_DIR}/x86_64/bin":${PATH}
    export PYTHONPATH="${INSTALL_DIR}/lib/python":${PYTHONPATH}

    cd src/nrnpython
    python setup.py install
    cd ../../

    echo "Testing NEURON import ...."
    python -c 'import neuron' >testimport.log 2>&1

    touch -f ${INSTALL_DIR}/.install_finished
    echo "NEURON successfully installed"
    else
    echo 'Neuron was successfully installed in previous build, not rebuilding'
    fi