diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fa4d43..5ee3d37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. diff --git a/platforms/cuda/CMakeLists.txt b/platforms/cuda/CMakeLists.txt index 475b250..41f2c07 100644 --- a/platforms/cuda/CMakeLists.txt +++ b/platforms/cuda/CMakeLists.txt @@ -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) diff --git a/platforms/opencl/CMakeLists.txt b/platforms/opencl/CMakeLists.txt index 4b6d5e1..506ae5c 100644 --- a/platforms/opencl/CMakeLists.txt +++ b/platforms/opencl/CMakeLists.txt @@ -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) diff --git a/platforms/reference/CMakeLists.txt b/platforms/reference/CMakeLists.txt index 7debc7f..124c82f 100644 --- a/platforms/reference/CMakeLists.txt +++ b/platforms/reference/CMakeLists.txt @@ -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) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ee0c19d..d7675cd 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -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}" diff --git a/python/setup.py b/python/setup.py index 99d5797..fe76b3c 100644 --- a/python/setup.py +++ b/python/setup.py @@ -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@' @@ -27,7 +28,8 @@ ) setup(name='openmmtorch', - version='1.0', + version=version, py_modules=['openmmtorch'], ext_modules=[extension], + install_requires=['openmm', 'torch'] )