Skip to content

Commit

Permalink
Try to fix install_shapeworks.sh for mac pkg version (read only /Appl…
Browse files Browse the repository at this point in the history
…ications/ShapeWorks)
  • Loading branch information
akenmorris committed May 6, 2023
1 parent 485855e commit a596c73
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Installation/install_python_module.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
REM Installs the shapeworks python module.
REM NOTE: assumes all library dependencies are in this directory\bin

REM install pip module
call pip install Python\shapeworks.tar.gz

set CONDA_INSTALL_DIR=%CONDA_PREFIX%\lib\site-packages\shapeworks

:: format windows path to use forward slashes
Expand Down
2 changes: 0 additions & 2 deletions Installation/install_python_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Installs shapeworks Python module
# Ensures conda Python module is able to locate correct shapeworks_py binary module.

# install pip module
if ! pip install Python/shapeworks; then exit -1; fi

CONDA_INSTALL_DIR=`pip show shapeworks | grep Location | awk '{print $2}'`/shapeworks

Expand Down
2 changes: 1 addition & 1 deletion Python/shapeworks/shapeworks/setup_path.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
def setup_binary_path():
import sys
sys.path.append("placeholder_string")
sys.path.append("/Users/amorris/sci/shapeworks/code/bin")
8 changes: 8 additions & 0 deletions Support/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ rm -rf "package/$VERSION"

mkdir -p "package/$VERSION"

# Build python package tarballs
# Pip can't install these otherwise from a read-only area like /Applications
for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do
cd Python
tar czvf ${package}.tar.gz $package
cd ..
done

BASE_LIB=${INSTALL_DEP_DIR}/lib
cp -a $INSTALL_DIR/* "package/${VERSION}"
cp -a Examples "package/${VERSION}"
Expand Down
3 changes: 2 additions & 1 deletion Support/package_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ cp -r $BUILD/bin/Release bin
rm bin/*Tests.pdb bin/Recon*.pdb bin/Mesh*.pdb
rm -rf Post

# Build python packages
# Build python package tarballs
# Pip can't install these otherwise from a read-only area like C:\Program Files\ShapeWorks
for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do
cd Python
tar czvf ${package}.tar.gz $package
Expand Down
2 changes: 2 additions & 0 deletions install_shapeworks.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ call pip install Python/DocumentationUtilsPackage.tar.gz
call pip install Python/DataAugmentationUtilsPackage.tar.gz
call pip install Python/DeepSSMUtilsPackage.tar.gz
call pip install Python/ShapeCohortGenPackage.tar.gz
call pip install Python/shapeworks.tar.gz


REM install the shapeworks python module and conda [de]activate scripts
call .\Installation\install_python_module.bat
Expand Down
13 changes: 7 additions & 6 deletions install_shapeworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ function install_conda() {
if ! pip install seaborn==0.11.2; then return 1; fi
if ! pip install swcc==1.0.5; then return 1; fi
if ! pip install scikit-learn==1.1.1; then return 1; fi
if ! pip install Python/DatasetUtilsPackage; then return 1; fi # install the local GirderConnector code as a package
if ! pip install Python/DocumentationUtilsPackage; then return 1; fi # install shapeworks auto-documentation as a package
if ! pip install Python/DataAugmentationUtilsPackage; then return 1; fi # install data augmentation code as a package
if ! pip install Python/DeepSSMUtilsPackage; then return 1; fi # install DeepSSM code as a package
if ! pip install Python/ShapeCohortGenPackage; then return 1; fi # install shape cohort generation code as a package


for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do
if [[ -e Python/${package}.tar.gz ]] ; then
if ! pip install Python/${package}.tar.gz; then return 1; fi
else
if ! pip install Python/${package}; then return 1; fi
fi
done

./Installation/install_python_module.sh # install python module
./Installation/conda_env_setup.sh # install conda [de]activate scripts
Expand Down

0 comments on commit a596c73

Please sign in to comment.