Skip to content

Commit 9ef733c

Browse files
authored
Changes for PyPI wheels (#161)
* Changes needed for wheels * Remove version pin * Update version number * Set version number in CMake * Store version number in CMake cache * Fixed typo
1 parent 53e8786 commit 9ef733c

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# OpenMM PyTorch Plugin
33
#----------------------------------------------------
44

5+
# The version number is set here and copied to anywhere it is needed.
6+
SET(OPENMM_TORCH_VERSION 1.5 CACHE STRING "The version of OpenMM-Torch that will be built." FORCE)
7+
58
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
69

710
# We need to know where OpenMM is installed so we can access the headers and libraries.

platforms/cuda/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,5 @@ IF (APPLE)
7070
ENDIF (APPLE)
7171

7272
INSTALL(TARGETS ${SHARED_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/plugins)
73-
# Ensure that links to the main library will be resolved.
74-
IF (APPLE)
75-
INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -add_rpath @loader_path/.. ${CMAKE_INSTALL_PREFIX}/lib/plugins/lib${SHARED_TARGET}.dylib)")
76-
ENDIF (APPLE)
7773

7874
SUBDIRS (tests)

platforms/opencl/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES
6161
LINK_FLAGS "${EXTRA_COMPILE_FLAGS}")
6262

6363
INSTALL(TARGETS ${SHARED_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/plugins)
64-
# Ensure that links to the main library will be resolved.
65-
IF (APPLE)
66-
INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -add_rpath @loader_path/.. ${CMAKE_INSTALL_PREFIX}/lib/plugins/lib${SHARED_TARGET}.dylib)")
67-
ENDIF (APPLE)
6864

6965
SUBDIRS (tests)
7066

platforms/reference/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,5 @@ SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES
4747
LINK_FLAGS "${EXTRA_COMPILE_FLAGS}")
4848

4949
INSTALL(TARGETS ${SHARED_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/plugins)
50-
# Ensure that links to the main library will be resolved.
51-
IF (APPLE)
52-
INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -add_rpath @loader_path/.. ${CMAKE_INSTALL_PREFIX}/lib/plugins/lib${SHARED_TARGET}.dylib)")
53-
ENDIF (APPLE)
5450

5551
SUBDIRS (tests)

python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ add_custom_command(
1212
-python -c++
1313
-o "${WRAP_FILE}"
1414
"-I${OPENMM_DIR}/include"
15-
${torchincs}
15+
${torchincs}
1616
"${CMAKE_CURRENT_SOURCE_DIR}/openmmtorch.i"
1717
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/openmmtorch.i"
1818
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"

python/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import platform
44

5+
version = '@OPENMM_TORCH_VERSION@'
56
openmm_dir = '@OPENMM_DIR@'
67
torch_include_dirs = '@TORCH_INCLUDE_DIRS@'.split(';')
78
nn_plugin_header_dir = '@NN_PLUGIN_HEADER_DIR@'
@@ -27,7 +28,8 @@
2728
)
2829

2930
setup(name='openmmtorch',
30-
version='1.0',
31+
version=version,
3132
py_modules=['openmmtorch'],
3233
ext_modules=[extension],
34+
install_requires=['openmm', 'torch']
3335
)

0 commit comments

Comments
 (0)