-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build support for Linux (Ubuntu) (#1181)
* Add ant build target for linux * Add CMake rule for linux * update opensim.conf for Linux; add logo and .desktop file * Fix file permissions in tar * Add version to opensim.conf * Add Ubuntu builds to GitHub Action CI * Add INSTALL script; set jdkhome properly * Fix INSTALL script * Add Linux build instructions to README * Run GitHub Actions CI on PRs * Fix typo in opensim-core download * Fix netbeans/harness location for cmake; try caching netbeans installer * Try again... * Change back to ~ for opensim-core * Change netbeans install to verbose (will still fail, help with debug) * Revert to silent netbeans install, ls home contents to verify install/location * (Hopefully) Final GH actions CI update - Cache the entire netbeans install directory * Improve INSTALL script; tweak build instructions on README * Revert GitHub CI to only run on push * Update README, CHANGELOG, and CONTRIBUTING * De-duplicate private properties file creation * Use more reasonable OS conditionals * Change INSTALL language to reflect beta status * Update description in .desktop * Remove extraneous line
- Loading branch information
1 parent
d344713
commit f123696
Showing
10 changed files
with
364 additions
and
15 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
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
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 |
---|---|---|
|
@@ -40,4 +40,5 @@ List of contributors | |
- Darryl Thelen | ||
- Carmichael Ong | ||
- Sebastian Skejo | ||
- Allen Hill | ||
|
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
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
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,140 @@ | ||
#!/bin/bash | ||
|
||
function err_unsupported_env { | ||
printf "\r [\033[0;31mERROR:\033[0m] Your distro/release is not supported by this script\n" | ||
printf " Ubuntu 18.04 LTS is currently the only Linux distribution that is tested \ | ||
against, however the OpenSim GUI will likely run on other distributions and/or \ | ||
releases. See the https://github.com/opensim-org/opensim-gui for more \ | ||
information.\n" | ||
exit 1 | ||
} | ||
|
||
function usage { | ||
echo -n "INSTALL [OPTIONS]... | ||
|
||
Install the OpenSim GUI. Ubuntu 18.04 LTS is the only tested Linux. Manual \ | ||
installation on other systems may be possible; see \ | ||
https://github.com/opensim-org/opensim-gui for more information. | ||
|
||
Options: | ||
-p, --prefix Install prefix; defaults to /opt/opensim-gui | ||
-v, --verbose Be verbose | ||
-h, --help Display this help and exit | ||
" | ||
} | ||
|
||
# From https://stackoverflow.com/a/246128 | ||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
## From https://stackoverflow.com/a/29754866 | ||
# saner programming env: these switches turn some bugs into errors | ||
set -o errexit -o pipefail -o noclobber -o nounset | ||
|
||
# -allow a command to fail with !’s side effect on errexit | ||
# -use return value from ${PIPESTATUS[0]}, because ! hosed $? | ||
! getopt --test > /dev/null | ||
if [[ ${PIPESTATUS[0]} -ne 4 ]]; then | ||
echo 'I’m sorry, `getopt --test` failed in this environment.' | ||
exit 1 | ||
fi | ||
|
||
OPTIONS=hp:v | ||
LONGOPTS=help,prefix:,verbose | ||
|
||
# -regarding ! and PIPESTATUS see above | ||
# -temporarily store output to be able to check for errors | ||
# -activate quoting/enhanced mode (e.g. by writing out “--options”) | ||
# -pass arguments only via -- "$@" to separate them correctly | ||
! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") | ||
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then | ||
# e.g. return value is 1 | ||
# then getopt has complained about wrong arguments to stdout | ||
exit 2 | ||
fi | ||
# read getopt’s output this way to handle the quoting right: | ||
eval set -- "$PARSED" | ||
|
||
v=0 installPrefix=/opt/opensim-gui | ||
# now enjoy the options in order and nicely split until we see -- | ||
while true; do | ||
case "$1" in | ||
-h|--help) | ||
usage | ||
exit 0 | ||
;; | ||
-v|--verbose) | ||
v=1 | ||
shift | ||
;; | ||
-p|--prefix) | ||
installPrefix="$2" | ||
shift 2 | ||
;; | ||
--) | ||
shift | ||
break | ||
;; | ||
*) | ||
echo "Bad argument: $1 is not a valid argument" | ||
exit 3 | ||
;; | ||
esac | ||
done | ||
## End from https://stackoverflow.com/a/29754866 | ||
|
||
if [[ -e /etc/os-release ]]; then | ||
. /etc/os-release | ||
OS=$NAME | ||
VER=$VERSION_ID | ||
else | ||
err_unsupported_env | ||
fi | ||
|
||
if [[ $OS == "Ubuntu" ]] && [[ $VER == "18.04" ]]; then | ||
|
||
[[ $v == 1 ]] && echo "Installing Java..." | ||
sudo apt install -qqqq -y openjdk-8-jre | ||
|
||
[[ $v == 1 ]] && echo "Testing for system LAPACK/BLAS..." | ||
if ! (ldconfig -p | grep -q "libblas|liblapack"); then | ||
[[ $v == 1 ]] && echo " Installing liblapack3..." | ||
sudo apt install -qqqq -y liblapack3 | ||
fi | ||
|
||
[[ $v == 1 ]] && echo "Testing for libgconf..." | ||
if ! (ldconfig -p | grep -q "libgconf"); then | ||
[[ $v == 1 ]] && echo " Installing libgconf..." | ||
sudo apt install -qqqq -y libgconf-2-4 | ||
fi | ||
|
||
[[ $v == 1 ]] && echo "Installing OpenSim GUI to $installPrefix, owned by $USER..." | ||
sudo mkdir -p $installPrefix | ||
sudo chown -R $USER:$USER $installPrefix | ||
cp -R $SCRIPTDIR/* $installPrefix | ||
|
||
[[ $v == 1 ]] && echo "Adding OpenSim to list of desktop applications..." | ||
echo "[Desktop Entry] | ||
Version=1.0 | ||
Type=Application | ||
Name=OpenSim | ||
Comment=OpenSim is an open source software for neuromusculoskeletal modeling, simulation \ | ||
and analysis. | ||
Path=$installPrefix | ||
Exec=$installPrefix/bin/OpenSim | ||
Icon=opensim | ||
Terminal=false | ||
Categories=Science;Education" | sudo tee /usr/share/applications/opensim.desktop > /dev/null | ||
sudo cp OpenSimLogoWhiteNoText.png /usr/share/pixmaps/opensim.png | ||
|
||
[[ $v == 1 ]] && echo "Installing opensim-core commands..." | ||
cd $installPrefix/bin | ||
if [[ $v == 1 ]]; then | ||
./opensim-install-command-line.sh | ||
else | ||
./opensim-install-command-line.sh > /dev/null | ||
fi | ||
else | ||
err_unsupported_env | ||
fi | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.