Conda Binary Distribution¶
Warning
As of v1.2rc1, new (conda build 3; updated compilers) conda packages are available for Linux but not Mac). Psi4conda installers are not ready for either platform.
PSI4 is available as a pre-compiled binary for Mac and Linux (and Windows, through the Ubuntu shell) and native Windows architectures through Anaconda (formerly Continuum Analytics, the company that produces Anaconda Python (a full-fledged scientific python environment with package manager conda) and, more particularly, Miniconda (a lightweight Python distribution with same package manager conda). Some nice features for us:
cross-platform
no root, administrator, or sudo access required
built with high-performance math libraries
lightweight software stack (<100 MB w/o PSI4; ~1 GB including PSI4, numpy, and MKL)
updated nightly so new features accessible
standardizes python distribution so no need to find/install libpython packages
add-ons (plugins, extra features requiring Fortran compiler, etc.) can be made available as conda packages
develop PSI4 through plugins without a pre-existing development environment, see Creating a New Plugin Using a Conda Pre-compiled Binary.
The PSI4 binary repository is at Anaconda (formerly Binstar).
For commands to get a default installation, go to How to install a Psi4 binary with the Psi4conda installer, command-line or the psicode downloads page . Users proficient with conda may prefer to consult What do the conda packages psi4 & psi4-dev and the installer psi4conda contain. For more flexibility and a detailed explanation, go to Detailed Installation of Miniconda and Detailed Installation of .
How to install a Psi4 binary with the Psi4conda installer, download site¶
Download one of the nine installers (Linux/Mac/Windows; Py38/39/310).
bash
it. Follow the prompts and do make the adjustments to
PATH
and PSI_SCRATCH
that it suggests at the end. Test
with psi4 --test
(green and yellow good; red bad). Done. Explicit commands at How to install a Psi4 binary with the Psi4conda installer, command-line.
How to install a Psi4 binary with the Psi4conda installer, command-line¶
Sequence of commands to get you to a working PSI4 on Linux,
Mac, Windows (Ubuntu shell for Windows accepts Linux installers), or native Windows.
Installs Miniconda+Psi4+AddOns into $HOME/psi4conda
and
the PSI4 executable into the main conda environment at
$HOME/psi4conda/bin/psi4
.
# Linux or WSL (Windows Subsystem for Linux)
# py38|py39|py310 for alternate python versions
>>> curl "http://vergil.chemistry.gatech.edu/psicode-download/Psi4conda-1.4rc1-py38-Linux-x86_64.sh" -o Psi4conda-latest-py38-Linux-x86_64.sh --keepalive-time 2
>>> bash Psi4conda-latest-py38-Linux-x86_64.sh -b -p $HOME/psi4conda # agrees to license terms
>>> (bash) echo $'. $HOME/psi4conda/etc/profile.d/conda.sh\nconda activate' >> ~/.bashrc
>>> (tcsh) echo "source $HOME/psi4conda/etc/profile.d/conda.csh\nconda activate" >> ~/.tcshrc
# log out, log back in so conda and psi4 in path
>>> psi4 --test
# Mac
# py38|py39|py310 for alternate python versions
>>> curl -O "http://vergil.chemistry.gatech.edu/download/Psi4conda-latest-py35-MacOSX-x86_64.sh" --keepalive-time 2
>>> curl "http://vergil.chemistry.gatech.edu/psicode-download/Psi4conda-1.4rc1-py38-MacOSX-x86_64.sh" -o Psi4conda-latest-py38-MacOSX-x86_64.sh --keepalive-time 2
>>> bash Psi4conda-latest-py38-MacOSX-x86_64.sh -b -p $HOME/psi4conda # agrees to license terms
>>> (bash) echo $'. $HOME/psi4conda/etc/profile.d/conda.sh\nconda activate' >> ~/.bash_profile
>>> (tcsh) echo "source $HOME/psi4conda/etc/profile.d/conda.csh\nconda activate" >> ~/.tcshrc
# log out, log back in so conda and psi4 in path
>>> psi4 --test
# Windows
# py38 only python version
# download via button at https://psicode.netlify.app/installs/latest with "Windows", "Installer", and "Stable Release" selected
>>> # install via GUI by double-clicking downloaded `.exe` file analogous to https://conda.io/projects/conda/en/latest/user-guide/install/windows.html
>>> # -OR- install via following line
>>> start /wait "" Psi4conda-1.4rc1-py38-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\psi4conda
>>> psi4 --test
That last command tested that psi4
is in your path, and it’s finding
all the libraries it needs. It works because PSI_SCRATCH
defaults to /tmp
. Now you need only specify a permanent scratch
directory (see Scratch Files) by replacing the placeholder in the
following:
>>> echo "export PSI_SCRATCH=/path/to/existing/writable/local-not-network/directory/for/scratch/files" >> ~/.bashrc
# log out, log back in so variable takes effect
All done!
Configuration for this set-up is summarized at How to run Psi4 as executable or Python module from conda installation.
Note
PSI4 installs a Python distribution alongside, so you should choose an installer based on the Python version you want, irrespective of any Python version you have.
How to install a Psi4 binary into an Ana/Miniconda distribution¶
Conda command to install the latest nightly build of PSI4 + compiled add-ons + runtime add-ons into an existing Anaconda or Miniconda distribution.
# Linux or Mac or Windows
# substitute x.x by 3.6|3.7|3.8|3.9 for alternate python versions
# remove `-c psi4/label/dev` to get stable releases instead of nightly builds
>>> conda create -n p4env python=x.x psi4 -c psi4/label/dev
Activate environment and make the adjustments to PATH
and
PSI_SCRATCH
that it suggests at the end. Test with psi4
--test
. Configuration for this set-up is summarized at
How to run Psi4 as executable or Python module from conda installation.
Details:
It is advised to place PSI4 into a conda environment where its libraries can’t interfere with other programs rather than the main Anaconda or Miniconda environment. Hence the creation of the environment above, but the environment name (
p4env
above) can be substituted.The
psi4-rt
package can be added to the package list to get the QC runtime add-ons; could say any combination ofv2rdm_casscf snsmp2 resp
etc. instead ofpsi4-rt
. As of PSI4 v1.7, thepsi4-rt
package is being slowly retired due to more optional dependencies being on conda-forge. Similar collections of dependencies can be obtained from environment spec files like psi4/devtools/conda-envs .Grab a Miniconda through one of the below, selecting OS.
>>> curl -O "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh" >>> curl -O "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-MacOSX-x86_64.sh" >>> curl -O "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Windows-x86_64.exe"
How to update a Psi4 binary¶
A. Conda command to update an existing PSI4 conda installation to the newest stable release (roughly annually). It’s often a better idea to create a new environment rather than updating the old one.
>>> # Linux/MacOS
>>> conda update psi4 -c psi4
>>> # Windows
>>> conda update psi4 -c psi4 -c conda-forge
# if psi4 channel in defaults (true for Psi4conda installers)
>>> conda update psi4
B. Conda command to update an existing PSI4 conda installation to the latest development head (roughly nightly).
>>> # Linux/MacOS
>>> conda update psi4 -c psi4/label/dev
>>> # Windows
>>> conda update psi4 -c psi4/label/dev -c conda-forge
C. Conda command to install a very specific package, including version, build string, and subchannel. The final -c psi4 represents any additional channels or subchannels needed to locate all dependencies.
>>> conda install psi4=1.2a1.dev249+623ad64=py36_sse41_0 -c psi4/label/subchannel -c psi4
How to use conda to compile Psi4 faster and easier¶
# Linux # c. v1.2rc1 ###or Mac or Windows
# substitute x.x by 3.5|3.6|3.7 for alternate python versions
>>> conda create -n p4dev python=x.x psi4-dev -c psi4/label/dev -c psi4
>>> conda activate p4dev
>>> cd {top-level-psi4-dir}
>>> psi4-path-advisor --help
usage: psi4-path-advisor [-h] [--psi4-compile] [--disable-addons]
[--disable-mkl] [--intel | --intel-multiarch | --gcc]
Build and Run path advisor for Psi4
optional arguments:
-h, --help show this help message and exit
--psi4-compile (Command Default) Generates a minimal CMake command for building Psi4 against
this psi4-dev conda metapackage.
>>> git clone https://github.com/psi4/psi4.git
>>> cd {top-level-psi4-dir}
>>> conda create -n p4dev python={3.6} psi4-dev [-c psi4/label/dev] -c psi4
>>> conda activate p4dev
>>> psi4-path-advisor
# execute or adapt `cmake` commands above; DepsCache handles python & addons;
# DepsMKLCache handles math; further psi4-path-advisor options handle compilers.
>>> cd objdir && make -j`getconf _NPROCESSORS_ONLN`
>>> make install
--disable-addons Disengage building against the psi4-dev-provided _optional_ link-time Add-Ons like CheMPS2.
--disable-mkl Disengage building against the psi4-dev-provided MKL libraries (`libmkl_rt`).
--intel Engage self-provided icc/icpc/ifort compilers backed by conda's psi4-dev-provided gcc/g++.
--intel-multiarch Engage self-provided icc/icpc/ifort compilers backed by conda's psi4-dev-provided gcc/g++ PLUS compile for multiple architectures (useful for cluster deployments).
--gcc Engage conda's psi4-dev-provided gcc/g++/gfortran compilers.
# execute or adapt `cmake` commands above; DepsCache handles python & addons;
# DepsMKLCache handles math; further psi4-path-advisor options handle compilers.
>>> `psi4-path-advisor [your args]` -Dany_addl_cmake_vals=ON
>>> cd objdir && make -j`getconf _NPROCESSORS_ONLN`
>>> make install
Same for Linux/Mac/WSL. Substitute desired python version: 3.6, 3.7, 3.8, 3.9. Fine
to choose your own env name. Include -c psi4/label/dev
to get dependencies to
build current master, as opposed to latest release.
Activate environment, conda activate
p4dev
. Go to where you’ve cloned psi4. Execute psi4-path-advisor
.
It gives you a basic cmake command covering python, sphinx, link-time qc
addons, and run-time qc addons. There’s a help menu -h that gives more
info. There’s other options that will also pre-configure compilers. For
example, at GaTech psi4-path-advisor --intel
works. On Macs with
XCode, psi4-path-advisor --clang
works. Just read the help. For users
who want a minimal build, there’s a --disable-addons
, but it is generally not
encouraged. It gives you a fully
functional cmake command, but those are just setting up CMake cache
— like the plugins you can always add your own CMake variables to
the command.
For run-time, you may also wish to install the optional runtime add-ons (e.g., adcc)
>>> conda install psi4-rt
What do the conda packages psi4 & psi4-dev and the installer psi4conda contain¶
psi4
- has full-featured psi4 itself and necessarily all the link-time qc
addons (e.g., chemps2). It has python, pytest, numpy, and a few more python
modules for specialized functions. Of gcc-ness, it has minimal, run-time
libraries (e.g., libgcc-ng) not compilers.
It doesn’t have the run-time qc addons psi4-rt
(e.g., snsmp2) or build tools (e.g., g++, sphinx, cmake).
psi4-dev
- does not have psi4 itself or the run-time addons psi4-rt
or numpy (though fine to install them
alongside). Does have all the link-time addons. Does have
cmake and sphinx (and python). Of gcc-ness, has full packages, that is,
compilers as well as runtime packages.
Psi4conda installer - has full-featured psi4
itself, all link-time qc addons, all
run-time qc addons, and minimal gcc runtime libraries. Developers should additionally install psi4-dev
for build tools.
The How to install a Psi4 binary with the Psi4conda installer, command-line uses a conda constructor to package up Miniconda,
the PSI4 conda package, the PSI4 add-on conda packages, dependencies
thereof (possibly from particular channels), and the psi4 channel
as a default. This is very convenient for novice users and robust
against differing channel settings in ~/.condarc
. But proficient
conda users may prefer to treat psi4
as a normal conda package and
not have another large Miniconda installation (including the hefty MKL)
lying around just for PSI4. Installing just the psi4
package
itself will get you PSI4, whatever add-ons require linking in to
PSI4 (e.g., CheMPS2 and PCMSolver), and the correct versions of
packages. However, just the psi4
package won’t get you add-ons that
don’t need linking (e.g., adcc and v2rdm_casscf).
Quick Installation¶
Sequence of commands to get you to a working PSI4. Installs
Miniconda into $HOME/miniconda
and the PSI4 executable into the
main conda environment at $HOME/miniconda/bin/psi4
.
# Linux or Mac, Py2 or Py3 for main environment (immaterial to Py for Psi4): select between four lines
# Windows: in Ubuntu shell, select either Linux line
>>> curl -o Miniconda-latest.sh "https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh"
>>> curl -o Miniconda-latest.sh "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
>>> curl -o Miniconda-latest.sh "https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh"
>>> curl -o Miniconda-latest.sh "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
>>> bash
>>> bash Miniconda-latest.sh -b -p $HOME/miniconda # agrees to conda's license terms
>>> echo "export PATH=$HOME/miniconda/bin:\$PATH" >> ~/.bashrc # Mac: use ~/.bash_profile
# log out, log back in so conda in path
>>> conda update --yes --all
>>> conda config --add channels http://conda.anaconda.org/psi4
>>> conda install --yes psi4
>>> psi4 "$(dirname $(which psi4))"/../share/psi4/samples/sapt1/test.in # test installation. works b/c PSI_SCRATCH defaults to /tmp
That last command tested that psi4
is in your path, and it’s finding
all the libraries it needs. Now you need only specify a scratch directory
(see Scratch Files) by replacing the placeholder in the following:
>>> echo "export PSI_SCRATCH=/path/to/existing/writable/local-not-network/directory/for/scratch/files" >> ~/.bashrc
# log out, log back in so variable takes effect
All done!
Note
Above commands use bash for installation and set up your environment for bash at runtime. To use csh at runtime, follow the on-screen directions at the end of the installation or consult step 7 below.
Detailed Installation of Miniconda¶
Detailed Installation of PSI4¶
Subscribe to PSI4. Subscribe to our channel at https://anaconda.org/psi4 that contains the PSI4 package and several dependency packages. Make sure this shows up in your
~/.condarc
file.
>>> conda config --add channels http://conda.anaconda.org/psi4
# check
>>> cat ~/.condarc
channels:
- http://conda.anaconda.org/psi4
- defaults
Install PSI4. You can install into the main conda environment so that whenever commands
conda
or (Ana/Miniconda’s)python
are available, thenpsi4
is available, too.
>>> conda install psi4
# check
>>> which psi4
/path/to/miniconda/bin/psi4
Or, you can install into a conda environment that places PSI4 and its dependencies (including python) into a sandbox unaffected by any other software installed in Ana/Miniconda. This is recommended for developers to avoid interference between multiple versions (including github/conda versions) or to test python versions, etc.. In practical terms, installing into a conda environment means you can turn PSI4‘s availability on/off by switching conda environments without turning on/off the whole Ana/Miniconda installation. Below, PSI4 is installed into an environment called p4env
. Then the environment is activated, removing the main Ana/Miniconda bin
and adding envs/p4env/bin
to PATH
. The conda activate
command (conda >=4.4; December 2017) works in all shells, but if you’re using old source activate
that only works for bash
; adjust as needed for csh
/tcsh
.
>>> conda create -n p4env psi4
>>> conda activate p4env
# check
>>> which psi4
/path/to/miniconda/envs/p4env/bin/psi4
Configure environment. Preceding steps have placed
conda
andpsi4
in yourPATH
, either permanently through rc-files or temporarily in this terminal session. You can keep or undo these changes. For general psi4 use, you must enable thepsi4
executable to be found through any of:
prepending to
PATH
in shell,~/.bashrc
,~/.tcshrc
, or PBScmd
fileactivating the conda environment (p4env above) in shell,
~/.bashrc
, or PBScmd
filesupplying full path to executable (shell or PBS
cmd
file)
Similarly, the scratch directory (see Scratch Files) must be specified through:
defining
PSI_SCRATCH
in shell,~/.bashrc
,~/.tcshrc
, or PBScmd
file
Useful Commands¶
Initially install PSI4 stable release
# equivalent
>>> conda install psi4 -c psi4
>>> conda install psi4 --channel psi4
Initially install PSI4 stable release with non-current python
>>> conda install psi4 python=3.8 -c psi4
Update to latest PSI4 stable release
>>> conda update psi4 -c psi4
Initially install stable release into a conda environment “p4env” instead of “root”. This creates a sandbox with PSI4 and python (loaded as dependency).
>>> conda create -y -n p4env psi4 -c psi4
>>> conda activate p4env
Install a particular PSI4 version
>>> conda install psi4=1.4 -c psi4
Uninstall PSI4 from current environment
>>> conda remove psi4
Initially install PSI4 nightly build
# equivalent
>>> conda install psi4 -c psi4/label/dev
>>> conda install psi4 --channel psi4/label/dev
Initially install PSI4 nightly build with non-current python
>>> conda install psi4 python=3.8 -c psi4/label/dev
Update to latest PSI4 nightly build
>>> conda update psi4 -c psi4/label/dev
Initially install nightly build into a conda environment “p4env” instead of “root”. This creates a sandbox with PSI4 and python (loaded as dependency).
>>> conda create -y -n p4env psi4 -c psi4/label/dev
>>> conda activate p4env
Install a particular PSI4 version
>>> conda install psi4=1.4 -c psi4/label/dev