forked from NeuroJSON/BlenderPhotonics
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add installation script for Ubuntu Linux
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
#================================================================================================ | ||
# Bash shell script to install BlenderPhotonics and all dependencies | ||
#================================================================================================ | ||
# installing software and python modules and their dependencies | ||
# (replace "apt" in the line below by "yum" on Fedora Linux, or "port" on Mac OS) | ||
#================================================================================================ | ||
sudo apt install 'blender' 'octave' 'wget' 'unzip' # install software | ||
BPY=`blender -b --python-expr 'import sys;print(sys.executable)'|grep 'python'` #blender's python | ||
"$BPY" -m ensurepip # enable pip package | ||
"$BPY" -m pip install 'oct2py' 'jdata' 'bjdata' 'wheel' # install Python modules | ||
#================================================================================================ | ||
# download and install octave/matlab toolboxes (replace wget URLs by those of newer releases) | ||
#================================================================================================ | ||
mkdir -p "$HOME/blenderphotonics" && cd "$HOME/blenderphotonics" # create toolbox folder | ||
GH=https://github.com | ||
wget "$GH/fangq/iso2mesh/releases/download/v1.9.6/iso2mesh-1.9.6-allinone.zip" #iso2mesh toolbox | ||
wget "$GH/fangq/zmat/releases/download/v0.9.8/zmat-0.9.8-allinone.zip" #zmat toolbox | ||
wget http://mcx.space/nightly/release/v2020/mmclab-linux-x86_64-v2020.zip #mmclab toolbox | ||
find . -name "*.zip" -exec unzip '{}' \; # unzip toolboxes | ||
rm -rf "$HOME/blenderphotonics/*.zip" # remove downloaded files | ||
echo "addpath(genpath('$HOME/blenderphotonics'));">>"$HOME/.octaverc" # add path to toolboxes | ||
#================================================================================================ | ||
# donwload and install BlenderPhotonics add-on (replace wget URLs by those of newer releases) | ||
#================================================================================================ | ||
BLENDERVER=`blender -v | grep -oh '\b[0-9]\+\.[0-9]\+'` # obtain blender version | ||
BLENDERADDON="$HOME/.config/blender/$BLENDERVER/scripts/addons" # get blender addon folder | ||
mkdir -p "$BLENDERADDON" # create addon folder | ||
cd "$BLENDERADDON" | ||
wget "$GH/COTILab/BlenderPhotonics/releases/download/v2022pre/BlenderPhotonics-v2022preview.zip" | ||
unzip BlenderPhotonics-v2022preview.zip # install addon | ||
#================================================================================================ | ||
# verification | ||
#================================================================================================ | ||
blender -b --python-expr 'import oct2py;import jdata;import bjdata;' # should show no error | ||
octave-cli --eval "which s2m mmc zmat" # should print the paths |