From 19d9e13251a546e6e8db09e0bfd9f93325eff15f Mon Sep 17 00:00:00 2001 From: "Craig M. Hamel" Date: Thu, 12 Oct 2023 23:02:57 -0400 Subject: [PATCH 1/5] adding a simple spack build that hopefully once I fix some things will bring exodus along with suitesparse with no troubles. --- spack.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spack.yaml diff --git a/spack.yaml b/spack.yaml new file mode 100644 index 0000000..5f3bf5a --- /dev/null +++ b/spack.yaml @@ -0,0 +1,18 @@ +# This is a Spack Environment file. +# +# It describes a set of packages to be installed, along with +# configuration settings. +spack: + # add package specs to the `specs` list + specs: + - python + - py-pip + - py-pytest + - py-pytest-cov + - py-pytest-xdist + - py-scikit-sparse + - exodusii + view: true + concretizer: + unify: true + From 656ff91b0901314f812c428eb8dfa8917903dafb Mon Sep 17 00:00:00 2001 From: "Craig M. Hamel" Date: Fri, 13 Oct 2023 10:18:59 -0400 Subject: [PATCH 2/5] updating spack to a build for exodus that works on ubuntu 22 with gcc 11. --- .gitignore | 7 ++++++- spack.yaml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c449b92..dbb5dcc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,9 @@ venv/ # IDE files .idea/ -.vscode/ \ No newline at end of file +.vscode/ + +# outputs from tests +*.png +loads +.coverage diff --git a/spack.yaml b/spack.yaml index 5f3bf5a..29b4842 100644 --- a/spack.yaml +++ b/spack.yaml @@ -11,7 +11,7 @@ spack: - py-pytest-cov - py-pytest-xdist - py-scikit-sparse - - exodusii + - exodusii+fortran view: true concretizer: unify: true From 98edffbb805eb0a3d0f83b51888f3f56243deb6a Mon Sep 17 00:00:00 2001 From: "Craig M. Hamel" Date: Fri, 13 Oct 2023 13:10:02 -0400 Subject: [PATCH 3/5] removing exodus and giving up with that on this attempt. That python library is a real nightmare and not shipped properly. --- .gitignore | 2 ++ spack.yaml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index dbb5dcc..682140e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ venv/ *.png loads .coverage +spack.lock +.spack-env/ diff --git a/spack.yaml b/spack.yaml index 29b4842..8eff1fe 100644 --- a/spack.yaml +++ b/spack.yaml @@ -11,7 +11,6 @@ spack: - py-pytest-cov - py-pytest-xdist - py-scikit-sparse - - exodusii+fortran view: true concretizer: unify: true From 80e1db1a309e7dd82372c97788c0c1f08e28552a Mon Sep 17 00:00:00 2001 From: "Craig M. Hamel" Date: Fri, 13 Oct 2023 13:15:36 -0400 Subject: [PATCH 4/5] adding instruction for a spack build to README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index bdb5f32..cf5b1fe 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,31 @@ pip=/usr/local/opt/python/bin/pip3 SUITESPARSE_INCLUDE_DIR=$INC SUITESPARSE_LIBRARY_DIR=$LIB $pip install -e . sparse ``` +## Installation using spack +Utilizing spack can alleviate some of the steps and headaches encountered in build described above to use spack to build optimism in a development environment, use the following instructions. + +If you don't already have spack, you can clone the git repo using the following command +``` +git clone https://github.com/spack/spack.git +``` + +Once you have spack you can do the following in the optimism directory +``` +source /path/to/spack/share/spack/setup-env.sh +spack env activate . +spack concretize -f +spack install +``` + +The above will install all dependencies needed for optimism (including suite sparse and testing dependencies). + +Finally, you can install optimism via pip with +``` +pip install -e .[sparse,test] +``` + +Note that in each new terminal you will need to source the ```setup-env.sh``` script from spack and activate the env in the optimism folder. + ## Citing OptimiSM If you use OptimiSM in your research, please cite From 7c296e880081f7191bb44156cde5b3f853e8c42a Mon Sep 17 00:00:00 2001 From: cmhamel <31457225+cmhamel@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:35:01 -0400 Subject: [PATCH 5/5] Update ci-build.yml Removing 3.7 and adding 3.10 --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index d277bfa..3504ebf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }}