

set -ex



export PYLIB_EXT=`$PYTHON -c 'import sysconfig as s; print(s.get_config_var("EXT_SUFFIX"))'`
test -f $PREFIX/bin/psi4
test -f $SP_DIR/psi4/core$PYLIB_EXT
$PREFIX/bin/psi4 --version
ldd -r -u $SP_DIR/psi4/core$PYLIB_EXT
ldd -v $SP_DIR/psi4/core$PYLIB_EXT
conda inspect linkages --show-files --groupby=dependency ambit chemps2 dkh gau2grid gdma libint pcmsolver simint libxc psi4
grep -r theoryfs2 $PREFIX/share/cmake/ || true
conda list
python -c "import psi4, sys, os; sys.exit(psi4.test('long', extras=['--durations=50', '-n', os.environ.get('CPU_COUNT')]))"
python -c "import psi4; print('*** Psi4 {} built successfully. Buy psinet a beer!'.format(psi4.__version__))"
PASSFAIL=""
python $PREFIX/share/psi4/scripts/test_threading.py --passfail --ldd
python $PREFIX/share/psi4/scripts/test_threading.py ${PASSFAIL} --psiapi -n${CPU_COUNT}
python $PREFIX/share/psi4/scripts/test_threading.py ${PASSFAIL} --psithon -n${CPU_COUNT}
exit 0
