Skip to content

Commit

Permalink
update installation (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishjojo authored Sep 13, 2023
1 parent 8a7159b commit f85c4ba
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04]
python-version: ["3.8", "3.9", "3.10", "3.11"]
environment: ci
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/install_pyscf.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env bash
python -m pip install --upgrade pip
pip install wheel
pip install numpy scipy h5py
pip install numpy
pip install 'scipy<1.11'
pip install h5py
pip install typing_extensions
pip install jaxlib jax jaxopt
pip install pytest pytest-cov

#pyscf
git clone https://github.com/fishjojo/pyscf.git
cd pyscf; git checkout ad; cd ..
cd pyscf; git checkout v2.1.1-ad; cd ..

if [ "$RUNNER_OS" == "Linux" ]; then
os='linux'
Expand Down
45 changes: 13 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,8 @@ Installation
------------

---
* To install the latest release, use the following commands:
* To install the latest release, run:
```
# install cmake
pip install cmake
# install OpenMP runtime used with clang
# On Linux:
sudo apt update
sudo apt install libomp-dev
# On OSX:
brew install libomp
# install pyscf
pip install 'pyscf @ git+https://github.com/fishjojo/pyscf.git@ad#egg=pyscf'
pip install 'pyscf-properties @ git+https://github.com/fishjojo/properties.git@ad'
# install pyscfad
pip install pyscfad
```

Expand All @@ -35,25 +19,21 @@ pip install pyscfad
```
pip install git+https://github.com/fishjojo/pyscfad.git
```

* The dependencies can be installed via a predefined conda environment
This should also install all the dependencies.
Alternatively, the dependencies can be installed via a predefined conda environment:
```
conda env create -f environment.yml
conda activate pyscfad_env
```

* Alternatively, the dependencies can be installed from source
OpenMP is not required, but is recommended:
```
pip install numpy scipy h5py
pip install jax jaxlib jaxopt
# install pyscf
cd $HOME; git clone https://github.com/fishjojo/pyscf.git
cd pyscf; git checkout ad
cd pyscf/lib; mkdir build
cd build; cmake ..; make
# install OpenMP runtime used with clang
# On Linux:
sudo apt update
sudo apt install libomp-dev
export PYTHONPATH=$HOME/pyscf:$PYTHONPATH
# On OSX:
brew install libomp
```

---
Expand All @@ -68,13 +48,14 @@ Running examples

* In order to perform AD calculations,
the following lines need to be added to
the PySCF configure file($HOME/.pyscf\_conf.py)
the PySCF configure file ($HOME/.pyscf\_conf.py)
```
pyscfad = True
pyscf_numpy_backend = 'jax'
pyscf_scipy_linalg_backend = 'pyscfad'
pyscf_scipy_backend = 'jax'
# The followings are optional
# The followings turn on implicit differentiations
# for SCF and CC amplitude solvers
pyscfad_scf_implicit_diff = True
pyscfad_ccsd_implicit_diff = True
```
10 changes: 6 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ dependencies:
- python=3.9
- pip=23.0
- pip:
- cmake>=3.18
- numpy>=1.17
- scipy
- jax>=0.1.65,<0.3.14
- jaxlib>=0.1.65,<0.3.14
- scipy<1.11
- jax>=0.3.25
- jaxlib>=0.3.25
- typing_extensions
- jaxopt>=0.2
- -e git+https://github.com/fishjojo/pyscf.git@ad#egg=pyscf
- -e git+https://github.com/fishjojo/pyscf.git@v2.1.1-ad#egg=pyscf
- -e git+https://github.com/fishjojo/properties.git@ad#egg=pyscf-properties
2 changes: 1 addition & 1 deletion pyscfad/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.2"
__version__ = "0.1.3"
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ def run(self):
#cmdclass={'build_py': BuildExtFirst,
# 'build_ext': CMakeBuildExt},
install_requires=[
'cmake>=3.18',
'numpy>=1.17',
'scipy',
'scipy<1.11',
'jax>=0.3.25',
'jaxlib>=0.3.25',
'typing_extensions',
'jaxopt>=0.2',
'pyscf @ git+https://github.com/fishjojo/pyscf.git@ad#egg=pyscf',
'pyscf @ git+https://github.com/fishjojo/pyscf.git@v2.1.1-ad#egg=pyscf',
'pyscf-properties @ git+https://github.com/fishjojo/properties.git@ad',
],
url='https://github.com/fishjojo/pyscfad',
Expand All @@ -80,8 +81,6 @@ def run(self):
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down

0 comments on commit f85c4ba

Please sign in to comment.