Skip to content

Commit

Permalink
Changes for PyPI wheels (#161)
Browse files Browse the repository at this point in the history
* Changes needed for wheels

* Remove version pin

* Update version number

* Set version number in CMake

* Store version number in CMake cache

* Fixed typo
  • Loading branch information
peastman authored Nov 11, 2024
1 parent 53e8786 commit 9ef733c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# OpenMM PyTorch Plugin
#----------------------------------------------------

# The version number is set here and copied to anywhere it is needed.
SET(OPENMM_TORCH_VERSION 1.5 CACHE STRING "The version of OpenMM-Torch that will be built." FORCE)

CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

# We need to know where OpenMM is installed so we can access the headers and libraries.
Expand Down
4 changes: 0 additions & 4 deletions platforms/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,5 @@ IF (APPLE)
ENDIF (APPLE)

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

SUBDIRS (tests)
4 changes: 0 additions & 4 deletions platforms/opencl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES
LINK_FLAGS "${EXTRA_COMPILE_FLAGS}")

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

SUBDIRS (tests)

4 changes: 0 additions & 4 deletions platforms/reference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,5 @@ SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES
LINK_FLAGS "${EXTRA_COMPILE_FLAGS}")

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

SUBDIRS (tests)
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_custom_command(
-python -c++
-o "${WRAP_FILE}"
"-I${OPENMM_DIR}/include"
${torchincs}
${torchincs}
"${CMAKE_CURRENT_SOURCE_DIR}/openmmtorch.i"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/openmmtorch.i"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
Expand Down
4 changes: 3 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import platform

version = '@OPENMM_TORCH_VERSION@'
openmm_dir = '@OPENMM_DIR@'
torch_include_dirs = '@TORCH_INCLUDE_DIRS@'.split(';')
nn_plugin_header_dir = '@NN_PLUGIN_HEADER_DIR@'
Expand All @@ -27,7 +28,8 @@
)

setup(name='openmmtorch',
version='1.0',
version=version,
py_modules=['openmmtorch'],
ext_modules=[extension],
install_requires=['openmm', 'torch']
)

0 comments on commit 9ef733c

Please sign in to comment.