Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding psi4 and dkh #22328

Merged
merged 88 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
0282c93
dkh recipe
loriab Mar 18, 2023
526f444
iter 2
loriab Mar 19, 2023
c567a38
iter 3
loriab Mar 19, 2023
408fdce
iter 4
loriab Mar 19, 2023
5ecbba6
initialize psi4 recipe
loriab Mar 20, 2023
2380ca6
take 2
loriab Mar 20, 2023
5bcdfbb
take 3
loriab Mar 20, 2023
4d0625b
take 4
loriab Mar 20, 2023
0d9af60
take 5
loriab Mar 20, 2023
978610d
take 6
loriab Mar 20, 2023
fb74ed0
take 7
loriab Mar 20, 2023
e87b657
take 8
loriab Mar 20, 2023
c30fcf5
take 9
loriab Mar 20, 2023
cdc9bd0
take 10
loriab Mar 20, 2023
b7c7164
take 11
loriab Mar 20, 2023
599318a
take 12
loriab Mar 21, 2023
f7a1aa9
take 13
loriab Mar 21, 2023
f91e70f
take 14
loriab Mar 21, 2023
a7168c5
take 15
loriab Mar 21, 2023
6f2d136
take 16
loriab Mar 21, 2023
0599204
take 17
loriab Mar 21, 2023
54a2e09
take 18
loriab Mar 21, 2023
8c3695f
take 19
loriab Mar 21, 2023
790672c
take 20
loriab Mar 21, 2023
a796b80
take 21
loriab Mar 21, 2023
d0854fb
take 22
loriab Mar 22, 2023
fc4f35b
take 23
loriab Mar 22, 2023
6a189be
take 24
loriab Mar 22, 2023
fb3d309
take 25
loriab Mar 22, 2023
2e4acfc
take 26
loriab Mar 22, 2023
5c18996
take 27
loriab Mar 22, 2023
92f7961
take 27
loriab Mar 22, 2023
7b011c8
take 28
loriab Mar 22, 2023
fa1a5df
take 29
loriab Mar 22, 2023
26fff87
clean dkh
loriab Mar 22, 2023
5ab8a19
take 30
loriab Mar 22, 2023
b9b56e3
take 31
loriab Mar 22, 2023
b7613ad
take 32
loriab Mar 22, 2023
290f93f
take 33
loriab Mar 23, 2023
1c68f7e
take 34
loriab Mar 23, 2023
3de8c48
take 35
loriab Mar 23, 2023
8b67040
take 36
loriab Mar 23, 2023
58fe17c
take 37
loriab Mar 23, 2023
1b66879
add back dkh
loriab Mar 23, 2023
a8e8c1e
take 38
loriab Mar 23, 2023
bab2bd4
take 39
loriab Mar 23, 2023
fc58731
take 40
loriab Mar 23, 2023
b9e119f
take 41
loriab Mar 23, 2023
7c46e0a
take 42
loriab Mar 24, 2023
d76dc06
take 43
loriab Mar 24, 2023
d2f7158
take 44
loriab Mar 24, 2023
04722b5
take 45
loriab Mar 24, 2023
d350c13
take 46
loriab Mar 24, 2023
2e3e49f
take 47
loriab Mar 24, 2023
f0bc074
take 48
loriab Mar 24, 2023
b2de5ee
take 49
loriab Mar 24, 2023
b4db512
take 50
loriab Mar 24, 2023
d0618af
take 51
loriab Mar 25, 2023
d459b00
iter 52
loriab Mar 25, 2023
f226997
iter 53
loriab Mar 25, 2023
44fdd00
iter 54
loriab Mar 25, 2023
faf589a
iter 55
loriab Mar 25, 2023
6b4f29c
iter 56
loriab Mar 25, 2023
8d29ad9
iter 57
loriab Mar 26, 2023
e5f0114
iter 58
loriab Mar 26, 2023
eee33d6
iter 59
loriab Mar 26, 2023
847e35a
iter 60
loriab Mar 26, 2023
c9defe8
iter 61
loriab Mar 27, 2023
2b25f59
iter 62
loriab Mar 27, 2023
f4bb200
iter 63
loriab Mar 27, 2023
61618e1
iter 64
loriab Mar 27, 2023
f0c172a
iter 65
loriab Mar 27, 2023
c175f98
iter 66
loriab Mar 27, 2023
134a628
iter 67
loriab Mar 27, 2023
3896129
iter 68 all py
loriab Mar 27, 2023
43f7fe1
iter 69 all py
loriab Mar 28, 2023
f0651a7
iter 70 all py
loriab Mar 28, 2023
14ca5d7
iter 71
loriab Mar 28, 2023
584072c
iter 72
loriab Mar 28, 2023
5c60ec2
iter 73
loriab Apr 5, 2023
614c97a
iter 74
loriab Apr 5, 2023
673331b
iter 75
loriab Apr 5, 2023
88c042a
iter 76 -- review
loriab Apr 14, 2023
5e6ee18
Update recipes/psi4/meta.yaml
loriab Apr 18, 2023
9a528d5
Update recipes/psi4/meta.yaml
loriab Apr 18, 2023
a2440bb
iter 77 -- review
loriab Apr 19, 2023
0298779
iter 78 -- review
loriab Apr 19, 2023
2fb6419
Use conservative pinnings
carterbox Apr 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions recipes/dkh/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@ECHO ON

set "CC=gcc.exe"
set "FC=gfortran.exe"

cmake %CMAKE_ARGS% ^
-G "MinGW Makefiles" ^
-S %SRC_DIR% ^
-B build ^
-D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-D CMAKE_BUILD_TYPE=Release ^
-D CMAKE_C_FLAGS="%CFLAGS%" ^
-D CMAKE_Fortran_FLAGS="%FFLAGS%" ^
-D CMAKE_INSTALL_LIBDIR="lib" ^
-D CMAKE_INSTALL_INCLUDEDIR="include" ^
-D CMAKE_INSTALL_BINDIR="bin" ^
-D CMAKE_INSTALL_DATADIR="share" ^
-D BUILD_SHARED_LIBS=ON ^
-D CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ^
-D CMAKE_GNUtoMS=ON ^
-D ENABLE_OPENMP=OFF ^
-D ENABLE_XHOST=OFF
if errorlevel 1 exit 1

cmake --build build ^
--config Release ^
--target install ^
-- -j %CPU_COUNT%
if errorlevel 1 exit 1

:: no independent tests
20 changes: 20 additions & 0 deletions recipes/dkh/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

${BUILD_PREFIX}/bin/cmake ${CMAKE_ARGS} \
-S ${SRC_DIR} \
-B build \
-G "Ninja" \
-D CMAKE_INSTALL_PREFIX=${PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER=${CC} \
-D CMAKE_C_FLAGS="${CFLAGS}" \
-D CMAKE_Fortran_COMPILER=${FC} \
-D CMAKE_Fortran_FLAGS="${FFLAGS}" \
-D CMAKE_INSTALL_LIBDIR=lib \
-D BUILD_SHARED_LIBS=ON \
-D LAPACK_LIBRARIES="${PREFIX}/lib/libblas${SHLIB_EXT}" \
-D ENABLE_OPENMP=OFF \
-D ENABLE_XHOST=OFF

cmake --build build --target install -j${CPU_COUNT}

# no independent tests
6 changes: 6 additions & 0 deletions recipes/dkh/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channel_sources:
- conda-forge/label/libint_dev,conda-forge

# Note: this file serves no purpose but to suppress:
# f'Detected different channel_sources in the recipes: {channel_urls} vs. {new_channel_urls}. Consider submitting them in separate PRs'
# file will be deleted when dkh in its own feedstock
71 changes: 71 additions & 0 deletions recipes/dkh/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% set name = "dkh" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DKH looks good in both recipe and logs; good job!

{% set version = "1.2" %}
{% set sha256 = "37a31ce3fe211b62793db6a569c39142bbce37b8b418ca243c41db4329c1711a" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/psi4/{{ name|lower }}/archive/319b320.tar.gz
sha256: {{ sha256 }}

build:
number: 0
run_exports:
- {{ pin_subpackage('dkh', max_pin='x.x') }}

requirements:
build:
- {{ compiler('c') }} # [unix]
- {{ compiler('fortran') }} # [unix]
- {{ compiler('m2w64_c') }} # [win]
- {{ compiler('m2w64_fortran') }} # [win]
- cmake
- ninja
host:
- libblas
run:
# I'm surprised the m2w64 compilers run_exports aren't imposing this: https://github.com/conda-forge/toolchain-feedstock/blob/main/recipe/meta.yaml#L15
- m2w64-gcc-libgfortran # [win]

test:
requires:
- m2w64-binutils # [win] # provides objdump.exe
commands:
- ls -l $PREFIX/lib # [unix]
- ls -l $PREFIX/share/cmake/dkh # [unix]
- dir %PREFIX%\\Library\\lib # [win]
- dir %PREFIX%\\Library\\share\\cmake\\dkh # [win]
# Verify library
- test -f $PREFIX/lib/libdkh$SHLIB_EXT # [unix]
- test ! -f $PREFIX/lib/libdkh.a # [unix]
- if not exist %PREFIX%\\Library\\lib\\libdkh.dll.a exit 1 # [win]
- if not exist %PREFIX%\\Library\\lib\\libdkh.lib exit 1 # [win]
- if not exist %PREFIX%\\Library\\bin\\libdkh.dll exit 1 # [win]
- if exist %PREFIX%\\Library\\lib\\libdkh.a exit 1 # [win]
# Verify accessories
- test -e $PREFIX/include/DKH/DKH_MANGLE.h # [unix]
- test -e $PREFIX/share/cmake/dkh/dkhConfig.cmake # [unix]
- if not exist %PREFIX%\\Library\\include\\DKH\\DKH_MANGLE.h exit 1 # [win]
- if not exist %PREFIX%\\Library\\share\\cmake\\dkh\\dkhConfig.cmake exit 1 # [win]
# Inspect linkage
- ldd -v $PREFIX/lib/libdkh$SHLIB_EXT # [linux and build_platform == target_platform]
- otool -L $PREFIX/lib/libdkh$SHLIB_EXT # [osx]
- objdump.exe -p %PREFIX%\\Library\\bin\\libdkh.dll | findstr /i "dll" # [win]

about:
home: http://www.reiher.ethz.ch/software/dkh-x2c.html
dev_url: https://github.com/psi4/dkh
license: LGPL-3.0-only
license_url: https://opensource.org/license/lgpl-3-0/
license_file:
- COPYING
- COPYING.LESSER
license_family: LGPL
summary: "Wolf, Reiher, and Hess's Douglas-Kroll-Hess (DKH) relativistic correction"

extra:
recipe-maintainers:
- loriab
- jturney
68 changes: 68 additions & 0 deletions recipes/psi4/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

echo __version_long = '%PSI4_PRETEND_VERSIONLONG%' > psi4\metadata.py

cmake %CMAKE_ARGS% ^
-G "Ninja" ^
-S %SRC_DIR% ^
-B build ^
-D CMAKE_BUILD_TYPE=Release ^
-D CMAKE_INSTALL_PREFIX="%PREFIX%" ^
-D CMAKE_C_COMPILER=clang-cl ^
-D CMAKE_C_FLAGS="%CFLAGS%" ^
-D CMAKE_CXX_COMPILER=clang-cl ^
-D CMAKE_CXX_FLAGS="%CXXFLAGS%" ^
-D CMAKE_INSTALL_LIBDIR="Library\lib" ^
-D CMAKE_INSTALL_INCLUDEDIR="Library\include" ^
-D CMAKE_INSTALL_BINDIR="Scripts" ^
-D CMAKE_INSTALL_DATADIR="Library\share" ^
-D PYMOD_INSTALL_LIBDIR="/../../Lib/site-packages" ^
-D psi4_INSTALL_CMAKEDIR="Library\share\cmake\psi4" ^
-D TargetLAPACK_INSTALL_CMAKEDIR="Library\share\cmake\TargetLAPACK" ^
-D TargetHDF5_INSTALL_CMAKEDIR="Library\share\cmake\TargetHDF5" ^
-D Python_EXECUTABLE="%PYTHON%" ^
-D LAPACK_LIBRARIES="%PREFIX%\\Library\\lib\\mkl_rt.lib" ^
-D OpenMP_LIBRARY_DIRS="%SRC_DIR%\\external_src\\conda\\win\\2019.1" ^
-D BUILD_SHARED_LIBS=OFF ^
-D ENABLE_OPENMP=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_gau2grid=ON ^
-D MAX_AM_ERI=5 ^
-D CMAKE_INSIST_FIND_PACKAGE_Libint2=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_pybind11=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_Libxc=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_qcelemental=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_qcengine=ON ^
-D psi4_SKIP_ENABLE_Fortran=ON ^
-D ENABLE_dkh=ON ^
-D CMAKE_INSIST_FIND_PACKAGE_dkh=ON ^
-D ENABLE_XHOST=OFF ^
-D CMAKE_VERBOSE_MAKEFILE=OFF ^
-D CMAKE_PREFIX_PATH="%LIBRARY_PREFIX%"
if errorlevel 1 exit 1

cmake --build build ^
--config Release ^
--target install ^
-- -j %CPU_COUNT%
if errorlevel 1 exit 1

:: pytest in conda testing stage


:: Relocate python module to expected location (if positioning through PYMOD_INSTALL_LIBDIR="/" and CMAKE_INSTALL_BINDIR="Library\bin")
::copy /y "%PREFIX%\Library\bin\psi4" "%PREFIX%\Scripts"
::if errorlevel 1 exit 1
:: xcopy /f /i /s /y "%PREFIX%\Library\lib\psi4" "%SP_DIR%\psi4"
:: if errorlevel 1 exit 1
:: del /S /Q "%PREFIX%\Library\lib\psi4"
:: if errorlevel 1 exit 1

:: Probe linking - only available with m2w64-binutils package - add dep in meta.yaml or defer to test stage
:: objdump.exe -p %PREFIX%\Lib\site-packages\psi4\core.*.pyd | findstr /i "dll"
:: objdump.exe -p %PREFIX%\Library\bin\mkl_rt.*.dll | findstr /i "dll"

:: Probe import libraries
:: echo Intel
:: lib /list %SRC_DIR%\external_src\conda\win\2019.1\libiomp5md.lib
:: echo LLVM
:: lib /list "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/Llvm/x64/lib/libiomp5md.lib"
:: echo end
68 changes: 68 additions & 0 deletions recipes/psi4/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
if [ "$(uname)" == "Darwin" ]; then
ARCH_ARGS=""

# c-f-provided CMAKE_ARGS handles CMAKE_OSX_DEPLOYMENT_TARGET, CMAKE_OSX_SYSROOT
fi
if [ "$(uname)" == "Linux" ]; then
ARCH_ARGS=""

# c-f/staged-recipes on Linux is inside a non-psi4 git repo, messing up psi4's version computation.
# The "staged-recipes" skip pattern now in psi4 may need readjusting for feedstock. Diagnostics below.
git rev-parse --is-inside-work-tree
git rev-parse --show-toplevel
fi

echo '__version_long = '"'$PSI4_PRETEND_VERSIONLONG'" > psi4/metadata.py

# Note: bizarrely, Linux (but not Mac) using `-G Ninja` hangs on [205/1223] at
# c-f/staged-recipes Azure CI --- thus the fallback to GNU Make.

${BUILD_PREFIX}/bin/cmake ${CMAKE_ARGS} ${ARCH_ARGS} \
-S ${SRC_DIR} \
-B build \
-D CMAKE_INSTALL_PREFIX=${PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER=${CC} \
-D CMAKE_CXX_COMPILER=${CXX} \
-D CMAKE_C_FLAGS="${CFLAGS}" \
-D CMAKE_CXX_FLAGS="${CXXFLAGS}" \
-D CMAKE_Fortran_COMPILER=${FC} \
-D CMAKE_Fortran_FLAGS="${FFLAGS}" \
-D CMAKE_INSTALL_LIBDIR=lib \
-D PYMOD_INSTALL_LIBDIR="/python${PY_VER}/site-packages" \
-D Python_EXECUTABLE=${PYTHON} \
-D CMAKE_INSIST_FIND_PACKAGE_gau2grid=ON \
-D MAX_AM_ERI=5 \
-D CMAKE_INSIST_FIND_PACKAGE_Libint2=ON \
-D CMAKE_INSIST_FIND_PACKAGE_pybind11=ON \
-D CMAKE_INSIST_FIND_PACKAGE_Libxc=ON \
-D CMAKE_INSIST_FIND_PACKAGE_qcelemental=ON \
-D CMAKE_INSIST_FIND_PACKAGE_qcengine=ON \
-D psi4_SKIP_ENABLE_Fortran=ON \
-D ENABLE_dkh=ON \
-D CMAKE_INSIST_FIND_PACKAGE_dkh=ON \
-D ENABLE_OPENMP=ON \
-D ENABLE_XHOST=OFF \
-D ENABLE_GENERIC=OFF \
-D LAPACK_LIBRARIES="${PREFIX}/lib/libmkl_rt${SHLIB_EXT}" \
-D CMAKE_VERBOSE_MAKEFILE=OFF \
-D CMAKE_PREFIX_PATH="${PREFIX}"

# addons when ready for c-f
# -D ENABLE_ambit=ON \
# -D CMAKE_INSIST_FIND_PACKAGE_ambit=ON \
# -D ENABLE_CheMPS2=ON \
# -D CMAKE_INSIST_FIND_PACKAGE_CheMPS2=ON \
# -D ENABLE_ecpint=ON \
# -D CMAKE_INSIST_FIND_PACKAGE_ecpint=ON \
# -D ENABLE_gdma=ON \
# -D CMAKE_INSIST_FIND_PACKAGE_gdma=ON \
# -D ENABLE_PCMSolver=ON \
# -D CMAKE_INSIST_FIND_PACKAGE_PCMSolver=ON \
# -D ENABLE_simint=ON \
# -D SIMINT_VECTOR=sse \
# -D CMAKE_INSIST_FIND_PACKAGE_simint=ON \

cmake --build build --target install -j${CPU_COUNT}

# pytest in conda testing stage
21 changes: 21 additions & 0 deletions recipes/psi4/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
channel_sources:
- conda-forge/label/libint_dev,conda-forge
channel_targets:
- conda-forge psi4_dev
carterbox marked this conversation as resolved.
Show resolved Hide resolved
mkl:
- 2022.1.0 # [win]
dftd4:
# provides b97-3c parameters
- 3.5.0
libint:
# provides rt-switchable ordering (src) and derivative integrals (build)
- 2.7.3dev1
pylibefp:
# 0.6.3 can detect py311
- 0.6.2
geometric:
# new API
- "1.0"
pymdi:
# breaking API change
- "1.2"
carterbox marked this conversation as resolved.
Show resolved Hide resolved
Loading