File tree Expand file tree Collapse file tree 18 files changed +178
-64
lines changed
devtools/conda-recipes/anaconda Expand file tree Collapse file tree 18 files changed +178
-64
lines changed Original file line number Diff line number Diff line change 66
66
run : |
67
67
cd build
68
68
make -j2 install
69
- make -j2 PythonInstall
69
+ make -j2 PythonWrapper
70
+ pip install --no-deps -e python/
70
71
71
72
- name : " List plugins"
72
73
shell : bash -l {0}
82
83
- name : " Run Python test"
83
84
shell : bash -l {0}
84
85
run : |
85
- cd build/python/tests
86
- pytest --verbose Test*
86
+ cd build/python
87
+ pytest
Original file line number Diff line number Diff line change 64
64
run : |
65
65
cd build
66
66
make -j2 install
67
- make -j2 PythonInstall
67
+ make -j2 PythonWrapper
68
+ pip install --no-deps -e python/
68
69
69
70
- name : " List plugins"
70
71
shell : bash -l {0}
80
81
- name : " Run Python test"
81
82
shell : bash -l {0}
82
83
run : |
83
- cd build/python/tests
84
- pytest --verbose Test*
84
+ cd build/python
85
+ pytest
Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ INSTALL_TARGETS(/lib RUNTIME_DIRECTORY /lib ${SHARED_CUSTOM_CPP_FORCES_TARGET})
77
77
# install headers
78
78
FILE (GLOB API_ONLY_INCLUDE_FILES "customcppforces/include/*.h" )
79
79
INSTALL (FILES ${API_ONLY_INCLUDE_FILES} DESTINATION include )
80
- FILE (GLOB API_ONLY_INCLUDE_FILES_INTERNAL "customcppforces/include/internal/*.h" )
81
- INSTALL (FILES ${API_ONLY_INCLUDE_FILES_INTERNAL} DESTINATION include /internal )
82
80
83
81
# Enable testing
84
82
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -euxo pipefail
4
+
5
+ rm -rf build || true
6
+
7
+ CMAKE_FLAGS=" -DOPENMM_DIR=${PREFIX} "
8
+ if [[ " $target_platform " == osx* ]]; then
9
+ CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT} "
10
+ CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} "
11
+ fi
12
+
13
+ # Build in subdirectory and install.
14
+ mkdir -p build
15
+ cd build
16
+ cmake ${CMAKE_ARGS} ${CMAKE_FLAGS} ${SRC_DIR}
17
+ make -j$CPU_COUNT install
18
+ make -j$CPU_COUNT PythonWrapper
19
+ ${PREFIX} /bin/python -m pip install --no-deps --ignore-installed python/
Original file line number Diff line number Diff line change
1
+ python :
2
+ - 3.9
3
+ - 3.10
4
+ - 3.11
5
+ - 3.12
Original file line number Diff line number Diff line change
1
+ {% set plugin_version = environ['PLUGIN_VERSION'].lstrip('v') %}
2
+
3
+ package :
4
+ name : customcppforces
5
+ version : {{ plugin_version }}
6
+
7
+ source :
8
+ git_url : ../../..
9
+
10
+ build :
11
+ number : 0
12
+
13
+ requirements :
14
+ build :
15
+ - python
16
+ - swig <4.1
17
+ - doxygen
18
+ - openmm >=8.1
19
+ - {{ compiler('cxx') }}
20
+ - cmake
21
+ - make
22
+ - setuptools
23
+ - pip
24
+ host :
25
+ - python
26
+ - openmm >=8.1
27
+ run :
28
+ - python
29
+ - {{ pin_compatible('openmm', max_pin='x.x') }}
30
+
31
+ test :
32
+ imports :
33
+ - customcppforces
34
+
35
+ about :
36
+ home : https://github.com/craabreu/customcppforces
37
+ summary : Platform-agnostic OpenMM Forces
38
+ license : MIT
39
+ license_file : LICENSE.md
40
+ doc_url : https://craabreu.github.io/customcppforces
41
+ dev_url : https://github.com/craabreu/customcppforces
42
+
43
+ extra :
44
+ recipe-maintainers :
45
+ - craabreu
Original file line number Diff line number Diff line change 1
- set (WRAP_FILE CustomCPPForcesWrapper.cpp )
2
1
set (MODULE_NAME customcppforces )
3
- configure_file (customcppforces.i ${CMAKE_CURRENT_BINARY_DIR} )
4
-
5
- # Execute SWIG to generate source code for the Python module.
6
-
7
- add_custom_command (
8
- OUTPUT "${WRAP_FILE} "
9
- COMMAND "${SWIG_EXECUTABLE} "
10
- -python -c++
11
- -doxygen
12
- -o "${WRAP_FILE} "
13
- "-I${OPENMM_DIR} /include"
14
- "customcppforces.i"
15
- DEPENDS "customcppforces.i"
16
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} "
17
- )
2
+ set (WRAP_FILE CustomCPPForcesWrapper.cpp )
18
3
19
4
# Compile the Python module.
20
5
21
- add_custom_target (PythonInstall DEPENDS " ${WRAP_FILE} " )
6
+ add_custom_target (PythonInstall DEPENDS ${SHARED_CUSTOM_CPP_FORCES_TARGET} PythonWrapper )
22
7
set (PLUGIN_HEADER_DIR "${CMAKE_SOURCE_DIR} /customcppforces/include" )
23
8
set (PLUGIN_LIBRARY_DIR "${CMAKE_BINARY_DIR} " )
24
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /setup.py ${CMAKE_CURRENT_BINARY_DIR} /setup.py )
9
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /pyproject.toml ${CMAKE_CURRENT_BINARY_DIR} )
10
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /setup.py ${CMAKE_CURRENT_BINARY_DIR} )
11
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /MANIFEST.in ${CMAKE_CURRENT_BINARY_DIR} )
25
12
add_custom_command (TARGET PythonInstall
26
- COMMAND "${PYTHON_EXECUTABLE} " -m pip install .
13
+ COMMAND "${PYTHON_EXECUTABLE} " -m pip install --no-deps --ignore-installed .
27
14
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} "
28
15
)
29
16
30
- subdirs ( tests )
17
+ subdirs ( customcppforces )
Original file line number Diff line number Diff line change
1
+ global-exclude *.py[cod] __pycache__
Original file line number Diff line number Diff line change
1
+ # Execute SWIG to generate source code for the Python module.
2
+
3
+ add_custom_target (PythonWrapper DEPENDS "${MODULE_NAME} .i" )
4
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /${MODULE_NAME}.i ${CMAKE_CURRENT_BINARY_DIR} )
5
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /__init__.py ${CMAKE_CURRENT_BINARY_DIR} )
6
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /py.typed ${CMAKE_CURRENT_BINARY_DIR} COPYONLY )
7
+
8
+ file (GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR} /tests/*.py )
9
+ file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /tests/ )
10
+ foreach (file ${TEST_FILES} )
11
+ configure_file (${file} ${CMAKE_CURRENT_BINARY_DIR} /tests COPYONLY )
12
+ endforeach (file ${TEST_FILES} )
13
+
14
+ add_custom_command (
15
+ TARGET PythonWrapper
16
+ COMMAND "${SWIG_EXECUTABLE} "
17
+ -python -c++
18
+ -doxygen
19
+ -o "${WRAP_FILE} "
20
+ "-I${OPENMM_DIR} /include"
21
+ "${MODULE_NAME} .i"
22
+ DEPENDS ${MODULE_NAME} .i ${TEST_FILES}
23
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
24
+ )
Original file line number Diff line number Diff line change
1
+ from @MODULE_NAME @.@MODULE_NAME @ import *
2
+
3
+ __version__ = "@PROJECT_VERSION@"
You can’t perform that action at this time.
0 commit comments