Skip to content

Commit a7a0515

Browse files
committed
Using spikeinterface's matlab files. compile script v1
1 parent 7290fe5 commit a7a0515

6 files changed

Lines changed: 39 additions & 145 deletions

File tree

kilosort_no_license/kilosort-compiled/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ks-matlab-base
22

3-
RUN chmod 755 /usr/bin/mlrtapp/ks_compiled
3+
RUN chmod 755 /usr/bin/mlrtapp/kilosort_master
44
ENV PATH="/usr/bin/mlrtapp:${PATH}"
55

66
RUN apt-get update -y
@@ -13,4 +13,3 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
1313
RUN apt-get install python3-pip -y
1414
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
1515
RUN pip install -U pip
16-

kilosort_no_license/kilosort-compiled/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generating Compiled Kilosort Docker Image
22

3-
## 1. Kilosort Setup
3+
## 1. Kilosort Setup
44
- Git clone or Download Kilosort [source code](https://github.com/cortex-lab/KiloSort)
55
- Open Matlab
66
- Compile Kilosort mexfiles:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
if [ $# == 0 ]; then
4+
echo "Usage: $0 param1 param2"
5+
echo "* param1: KiloSort path"
6+
echo "* param2: spikeinterface path"
7+
exit
8+
fi
9+
10+
if [ $# -ne 2 ]; then
11+
echo "spikeinterface and kilosort path must be given"
12+
exit 1
13+
fi
14+
15+
ROOT_PATH=$(pwd)
16+
echo "Creating tmp folder in: ${ROOT_PATH}"
17+
mkdir -p tmp
18+
TMP_DIR=$ROOT_PATH/tmp
19+
KS_PATH=$1
20+
SI_PATH=$2
21+
echo "Kilosort path: ${KS_PATH}"
22+
echo "spike-interface path: ${SI_PATH}"
23+
24+
echo "Compiling CUDA files"
25+
cd ${KS_PATH}/CUDA
26+
matlab -batch "mexGPUall"
27+
28+
cd $TMP_DIR
29+
30+
echo "Compiling kilosort_master from spikeinterface repository..."
31+
matlab -batch "mcc -m ${SI_PATH}/spikeinterface/sorters/kilosort/kilosort_master.m -a ${SI_PATH}/spikeinterface/sorters/utils -a ${KS_PATH}"
32+
33+
echo "Creating base docker image..."
34+
matlab -batch "compiler.package.docker('kilosort_master', 'requiredMCRProducts.txt', 'ImageName', 'ks-matlab-base')"
35+
36+
cd $ROOT_PATH
37+
rm -r $TMP_DIR

kilosort_no_license/kilosort-compiled/ks_compiled.m

Lines changed: 0 additions & 31 deletions
This file was deleted.

kilosort_no_license/utils/constructNPYheader.m

Lines changed: 0 additions & 88 deletions
This file was deleted.

kilosort_no_license/utils/writeNPY.m

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)