-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes in CMake configuration (#14)
- Loading branch information
Showing
4 changed files
with
129 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
rm -rf build || true | ||
|
||
CMAKE_FLAGS=" -DCMAKE_INSTALL_PREFIX=${PREFIX}" | ||
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Release" | ||
|
||
CMAKE_FLAGS+=" -DOPENMM_DIR=${PREFIX}" | ||
CMAKE_FLAGS+=" -DPLUGIN_LIBRARY_DIR=${PREFIX}/lib" | ||
|
||
# OpenCL | ||
CMAKE_FLAGS+=" -DPLUGIN_BUILD_OPENCL_LIB=ON" | ||
CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=${PREFIX}/include" | ||
CMAKE_FLAGS+=" -DOPENCL_LIBRARY=${PREFIX}/lib/libOpenCL${SHLIB_EXT}" | ||
|
||
# if CUDA_HOME is defined and not empty, we enable CUDA | ||
if [[ -n ${CUDA_HOME-} ]]; then | ||
CMAKE_FLAGS+=" -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME}" | ||
CMAKE_FLAGS+=" -DCMAKE_LIBRARY_PATH=${CUDA_HOME}/lib64/stubs" | ||
CMAKE_FLAGS+=" -DPLUGIN_BUILD_CUDA_LIB=ON" | ||
fi | ||
|
||
if [[ "$target_platform" == osx* ]]; then | ||
CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT}" | ||
CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" | ||
fi | ||
|
||
# Build in subdirectory and install. | ||
mkdir -p build | ||
cd build | ||
cmake ${CMAKE_FLAGS} ${SRC_DIR} | ||
make -j$CPU_COUNT install | ||
make -j$CPU_COUNT PythonInstall | ||
|
||
# Include test executables too | ||
mkdir -p ${PREFIX}/share/openmm-nonbonded-slicing/tests | ||
if [[ "$target_platform" == osx* ]]; then | ||
find . -name "Test*" -perm +0111 -type f \ | ||
-exec python $RECIPE_DIR/patch_osx_tests.py "{}" \; \ | ||
-exec cp "{}" $PREFIX/share/openmm-nonbonded-slicing/tests/ \; | ||
else | ||
find . -name "Test*" -executable -type f -exec cp "{}" $PREFIX/share/openmm-nonbonded-slicing/tests/ \; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{% set version = environ['PLUGIN_VERSION'][1:] %} | ||
|
||
package: | ||
name: openmm-nonbonded-slicing | ||
version: {{ version }} | ||
|
||
source: | ||
git_url: ../../../ | ||
|
||
build: | ||
number: 0 | ||
script: build.sh | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
- {{ compiler('cuda') }} # [linux and cuda_compiler_version != 'None'] | ||
- {{ cdt('mesa-libgl-devel') }} # [linux] | ||
- cmake | ||
- make | ||
- conda-build | ||
|
||
host: | ||
- python | ||
- pip | ||
- openmm | ||
- swig <4.1 | ||
- ocl-icd # [linux] | ||
- khronos-opencl-icd-loader # [osx] | ||
run: | ||
- python | ||
- {{ pin_compatible('openmm', lower_bound='7.7') }} | ||
- ocl-icd # [linux] | ||
- ocl-icd-system # [linux] | ||
- khronos-opencl-icd-loader # [osx] | ||
- ocl_icd_wrapper_apple # [osx] | ||
|
||
test: | ||
imports: | ||
- nonbondedslicing | ||
commands: | | ||
cd ${PREFIX}/share/openmm-nonbonded-slicing/tests | ||
set +e | ||
for f in Test*; do | ||
if [[ $f == *Cuda* || $f == *OpenCL* ]]; then | ||
continue | ||
fi | ||
./${f} | ||
((exitcode+=$?)) | ||
done | ||
exit $exitcode | ||
about: | ||
home: https://github.com/craabreu/openmm-nonbonded-slicing | ||
summary: 'An OpenMM plugin for slicing nonbonded interactions' | ||
description: | | ||
This plugin contains the SlicedNonbondedForce class, a variant of | ||
OpenMM's NonbondedForce. By partitioning all particles among disjoint | ||
subsets, the total potential energy becomes a linear combination of | ||
contributions from pairs of subsets. | ||
license: MIT | ||
license_family: MIT | ||
license_file: LICENSE.md | ||
doc_url: https://craabreu.github.io/openmm-nonbonded-slicing | ||
dev_url: https://github.com/craabreu/openmm-nonbonded-slicing | ||
|
||
extra: | ||
recipe-maintainers: | ||
- craabreu | ||
- jananzhu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters