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 }} diff --git a/.gitignore b/.gitignore index c449b92..682140e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,11 @@ venv/ # IDE files .idea/ -.vscode/ \ No newline at end of file +.vscode/ + +# outputs from tests +*.png +loads +.coverage +spack.lock +.spack-env/ 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 diff --git a/spack.yaml b/spack.yaml new file mode 100644 index 0000000..8eff1fe --- /dev/null +++ b/spack.yaml @@ -0,0 +1,17 @@ +# 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 + view: true + concretizer: + unify: true +