

set -ex



test -f $SP_DIR/psi4/core*.so
test -f $SP_DIR/psi4/driver/driver.py
test -f $PREFIX/bin/psi4
psi4 --version
psi4 --module
python -c "import psi4;print(psi4.executable)"
test -f $PREFIX/include/psi4/psi4-dec.h
test -f $PREFIX/share/cmake/psi4/psi4Config.cmake
test -f $PREFIX/share/cmake/TargetLAPACK/TargetLAPACKConfig.cmake
test -f $PREFIX/share/psi4/basis/cc-pvdz.gbs
ldd -v $SP_DIR/psi4/core*.so
pip check
python -c "import psi4;assert psi4.__version__ == '1.9', f'{psi4.__version__=} differs from recipe=\'1.9\''"
python -c "from psi4 import core; core.set_num_threads(42); assert core.get_num_threads() == 42"
python -c "import psi4;print(psi4.addons())"
MKL_CBWR=AVX pytest -rws -v --durations=100 --durations-min 60.0 --color yes -n auto $SP_DIR/psi4 -k "not (large and freq)"
PLUG=plugdfmp2
psi4 --plugin-name $PLUG --plugin-template dfmp2
cd $PLUG && `psi4 --plugin-compile` && make && cd ..
PYTHONPATH=. python $PREFIX/share/psi4/scripts/test_threading.py --plugin-dfmp2 --module="$PLUG" -n2
PYTHONPATH=. python $PREFIX/share/psi4/scripts/test_threading.py --passfail --ldd --module="$PLUG/$PLUG"
grep -r theoryfs2 $PREFIX/share/cmake/ || true
grep -r psilocaluser $PREFIX/share/cmake/ || true
python $PREFIX/share/psi4/scripts/test_threading.py --passfail --ldd
python $PREFIX/share/psi4/scripts/test_threading.py --passfail --psiapi -n6
python $PREFIX/share/psi4/scripts/test_threading.py --passfail --psithon -n6
exit 0
