-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
209 additions
and
286 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -1,28 +1,66 @@ | ||
# FORCE One-Step Installer Creation | ||
FORCE one-step installers are created using the `cx_Freeze` python package after creating a python environment using either `venv` or `conda`. | ||
A computer with the same operating system and architecture as the target operating system must be used to generate an installer, i.e. use a Windows machine to generate a Windows installer, a Mac (Intel) to generate a Mac installer, etc. | ||
Note that installers generated with Apple computers with M-series chips will not be backwards compatible with Intel-based Apple computers. | ||
|
||
Creating package way 1: | ||
Windows and macOS are the only operating systems currently supported. | ||
Linux users are encouraged to use pip-installed or source built versions of the RAVEN, HERON, and TEAL software packages. | ||
|
||
python3.10 -m venv test310 | ||
source test310/bin/activate | ||
pip install cx_Freeze | ||
pip install raven-framework teal-ravenframework heron-ravenframework | ||
## 1. Build FORCE executables | ||
Create a conda environment `force_build_310`, install the RAVEN, HERON, and TEAL pip packages, and build the FORCE executables using the script | ||
```console | ||
./build_force.sh | ||
``` | ||
|
||
## 2. Add IPOPT to build directory (Windows only) | ||
Download the IPOPT Windows binary: | ||
https://github.com/coin-or/Ipopt/releases | ||
|
||
python setup.py install_exe --install-dir raven_install | ||
Extract the downloaded zip directory and copy its contents to the raven_install directory, ensuring to replace the version numbers of IPOPT as needed. | ||
```console | ||
cd force_install | ||
unzip ~/Downloads/Ipopt-3.14.12-win64-msvs2019-md.zip | ||
mv Ipopt-3.14.12-win64-msvs2019-md local | ||
cd .. | ||
``` | ||
|
||
## 3. Copy examples and build/copy the RAVEN, HERON, and TEAL documentation | ||
Adding examples and documentation to the one-step installer requires having the source installation present on the build machine, with the `raven_libraries` conda environment already created. | ||
```console | ||
conda activate raven_libraries | ||
./copy_examples.sh --raven-dir /path/to/raven --heron-dir /path/to/HERON | ||
cp -R examples force_install/examples | ||
./make_docs.sh --raven-dir /path/to/raven --heron-dir /path/to/HERON --teal-dir /path/to/TEAL | ||
cp -R docs force_install/docs | ||
``` | ||
When running the `make_docs.sh` script, the optional `--no-build` flag may be added if the desired documentation PDFs have already been built, and you do not wish to rebuild the documents. | ||
|
||
Way 2: | ||
## 4. Get NEAMS Workbench installer | ||
The installers for the NEAMS Workbench software can be found here: | ||
https://code.ornl.gov/neams-workbench/downloads/-/tree/5.4.1?ref_type=heads | ||
|
||
conda create -n test39 python=3.9 | ||
conda activate test39 | ||
Download `Workbench-5.4.1.exe` for Windows and `Workbench-5.4.1.dmg` for macOS. | ||
Place this file in the current directory. | ||
|
||
pip install cx_Freeze | ||
pip install raven-framework teal-ravenframework heron-ravenframework | ||
Windows: | ||
```console | ||
cp ~/Downloads/Workbench-5.4.1.exe . | ||
``` | ||
|
||
python setup.py install_exe --install-dir raven_install | ||
macOS: | ||
```console | ||
cp ~/Downloads/Workbench-5.4.1.dmg . | ||
``` | ||
|
||
ipopt work: | ||
|
||
cd raven_install | ||
unzip ~/Downloads/Ipopt-3.14.12-win64-msvs2019-md.zip | ||
mv Ipopt-3.14.12-win64-msvs2019-md local | ||
## 5. Create the installer | ||
### Windows | ||
The Windows installer is created using Inno Setup. | ||
Run the `inno_package.iss` script from the Inno Setup application. | ||
The resulting .exe installer file can be found in the `inno_output` directory. | ||
|
||
### macOS | ||
Run the macOS build script | ||
```console | ||
./build_mac_app.sh | ||
``` | ||
The disk image `FORCE.dmg` contains applications for both FORCE and Workbench. |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
#!/bin/bash | ||
|
||
# Have users point to the location of their conda installation so we can properly activate the | ||
# conda environment that is being made. Use the "--conda-defs" option to specify this path. | ||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
case $key in | ||
--conda-defs) | ||
CONDA_DEFS="$2" | ||
shift | ||
shift | ||
;; | ||
*) | ||
echo "Unknown option: $1" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Establish conda environment | ||
conda create -n force_build_310 python=3.10 -y | ||
source $CONDA_DEFS | ||
conda activate force_build_310 | ||
|
||
# Check that the conda environment is active. If not, exit. | ||
if [[ $CONDA_DEFAULT_ENV != "force_build_310" ]]; then | ||
echo "Conda environment not activated. Maybe the path to the conda installation is incorrect?" | ||
echo "Provided conda path: $CONDA_DEFS" | ||
exit 1 | ||
fi | ||
|
||
pip install cx_Freeze | ||
pip install raven-framework heron-ravenframework teal-ravenframework | ||
# If on macOS, use conda to install ipopt | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Note: The PyPI version of ipopt is not maintained and is severl major version | ||
# behind the conda-forge distribution. | ||
conda install -c conda-forge ipopt -y | ||
fi | ||
|
||
# Build the FORCE executables | ||
python setup.py install_exe --install-dir force_install |
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
Oops, something went wrong.