Skip to content

Commit

Permalink
Check that CPU platform matches Tcl precompiled builds
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed May 13, 2024
1 parent 7fd7133 commit 4f64013
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,35 @@ if(NOT DEFINED COLVARS_TCL)
set(COLVARS_TCL ON)
endif()

if(DEFINED CMAKE_SYSTEM_NAME AND COLVARS_TCL)

# If available, use pre-downloaded OS-specific TCL libraries

if(EXISTS "${COLVARS_SOURCE_DIR}/devel-tools/packages")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.6.13-linux-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.6.a")
# If available, use pre-downloaded TCL libraries
if(EXISTS "${COLVARS_SOURCE_DIR}/devel-tools/packages")
if(DEFINED CMAKE_SYSTEM_NAME)
# On Linux and macOS, test if we are using Intel
if (DEFINED CMAKE_HOST_SYSTEM_PROCESSOR)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.6.13-linux-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.6.a")
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-macosx-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.5.a")
endif()
endif()

# Assume Intel when using Windows
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-win64")
set(TCL_LIBRARY "tcl85.lib")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-macosx-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.5.a")
endif()

set(DEFINE_TCL_DIR "-DTCL_DIR=${TCL_DIR}")
set(DEFINE_TCL_LIBRARY "-DTCL_LIBRARY=${TCL_DIR}/lib/${TCL_LIBRARY}")
endif()

endif()

if(COLVARS_TCL AND DEFINED TCL_DIR)
set(DEFINE_TCL_DIR "-DTCL_DIR=${TCL_DIR}")
set(DEFINE_TCL_LIBRARY "-DTCL_LIBRARY=${TCL_DIR}/lib/${TCL_LIBRARY}")
endif()


if(COLVARS_LEPTON)
if(NOT DEFINED LEPTON_DIR)
set(LEPTON_DIR "${COLVARS_SOURCE_DIR}/openmm-source/libraries/lepton")
Expand Down

0 comments on commit 4f64013

Please sign in to comment.