Skip to content

Commit

Permalink
Updated setup.py to use STIR 5.2 directly. No need for the custom ver…
Browse files Browse the repository at this point in the history
…sion at the moment
  • Loading branch information
txusser committed Dec 21, 2023
1 parent c8272c7 commit f25a080
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ def install_stir(stir_dir, simset_dir, log_file):
os.makedirs(install_dir)
os.chdir(stir_dir)
print("Cloning the SimSET input branch from STIR repo...")
icom = 'git clone --single-branch --branch simset_input https://github.com/txusser/STIR.git'
icom = 'wget https://github.com/UCL/STIR/archive/refs/tags/rel_5.2.0.zip'
rsystem(icom)
icom = 'unzip rel_5.2.0.zip'
rsystem(icom)

os.chdir(build_dir)
rsystem('cmake ../STIR/')
rsystem('cmake ../STIR-rel_5.2.0/')

makefile = join(build_dir, 'CMakeCache.txt')
newmakefile = join(stir_dir, 'build', 'new_CMakeCache.txt')
Expand All @@ -131,9 +133,9 @@ def install_stir(stir_dir, simset_dir, log_file):
f_new.close()

shutil.move(newmakefile, makefile)
rsystem('cmake ../STIR/')
rsystem('cmake ../STIR-rel_5.2.0/')

print('Building STIR....')
print('Building STIR with %s cores....' % cpu_count())
icom = 'make -s -j%s & make install' % str(cpu_count())
rsystem(icom)

Expand Down Expand Up @@ -266,7 +268,7 @@ def verify_test_simulation(simpet_dir):

import simpet

test = simpet.SimPET('Params_test.yml')
test = simpet.wholebody_simulation('Params_test.yml')
test.run()

verify_test_simulation(simpet_dir)
Expand Down
16 changes: 11 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#! /usr/bin/bash

export PATH=$PWD/include/fruitcake/bin:$PATH
export LD_LIBRARY_PATH=$PWD/include/fruitcake/book/lib:$LD_LIBRARY_PATH
export PATH=$PWD/include/format_converters:$PATH

sudo apt update -y && sudo apt upgrade -y -q

sudo apt install unzip libboost-dev libboost-all-dev libpcre3 libpcre3-dev libncurses-dev cmake swig -y -q
sudo apt install gcc g++ make cmake cmake-curses-gui libx11-dev libpng-dev tcsh -y -q

sudo apt install python python-dev python-numpy ipython python-matplotlib mayavi2 -y -q

sudo apt install mpi-default-dev mpi-default-bin libinsighttoolkit4-dev libtiff5-dev -y -q

sudo apt install unzip libboost-dev libboost-all-dev libpcre3 libpcre3-dev libncurses-dev swig -y -q

sudo apt install python3 python3-pip python3-ipython python3-numpy python3-scipy python3-nibabel python3-matplotlib python3-pandas -y -q

pip3 install -U PyYAML nilearn nipype

export PATH=$PWD/include/fruitcake/bin:$PATH
export LD_LIBRARY_PATH=$PWD/include/fruitcake/book/lib:$LD_LIBRARY_PATH
export PATH=$PWD/include/format_converters:$PATH

python3 setup.py

0 comments on commit f25a080

Please sign in to comment.