Skip to content

Commit

Permalink
Merge pull request NREL#10454 from jmarrec/develop
Browse files Browse the repository at this point in the history
Fix NREL#10453 - python38.dll missing on windows installers
  • Loading branch information
Myoldmopar authored Mar 28, 2024
2 parents b826be0 + 0ece21d commit 9d7789a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ jobs:
mpm --find-updates
mpm --admin --find-updates
- name: Downgrade cmake to 3.28
run: |
cmake --version
choco install cmake --version=3.28.4 --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Check cmake
run: |
cmake --version
# This will install all required packages and does that in a single thread. So later in cmake we can safely run in parallel
- name: Install required packages by building the Test document
shell: bash
Expand Down
1 change: 1 addition & 0 deletions cmake/PythonGetLibAndLinkUp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ if(WIN32)
endif()

# then copy the DLL in
message("COPYING ${RESOLVED_PYTHON_LIB} to ${BASE_PATH}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${RESOLVED_PYTHON_LIB}" "${BASE_PATH}")
4 changes: 4 additions & 0 deletions src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ endif()
if(LINK_WITH_PYTHON)
# link the executable to the dll and bring it in
get_filename_component(RESOLVED_PYTHON_LIBRARY "${Python_LIBRARIES}" REALPATH)
message("Python_LIBRARIES=${Python_LIBRARIES}")
message("RESOLVED_PYTHON_LIBRARY=${RESOLVED_PYTHON_LIBRARY}")
if(WIN32)

# In case you have both release and debug Python libraries on your system, Python_LIBRARIES might be "optimized;C:/.../python38.lib;debug;C:/.../python38_d.lib"
Expand All @@ -931,6 +933,7 @@ if(LINK_WITH_PYTHON)
endforeach()
# else()
# No-op, already done above
message("RESOLVED_PYTHON_LIBRARY (optimized) =${RESOLVED_PYTHON_LIBRARY}")
endif()

# Windows is being ugly and linking against the Python DLL but not running
Expand All @@ -941,6 +944,7 @@ if(LINK_WITH_PYTHON)
COMMAND ${CMAKE_COMMAND} -DRESOLVED_PYTHON_LIB=${RESOLVED_PYTHON_LIBRARY} -DEXECUTABLE_PATH=$<TARGET_FILE:energyplusapi> -P
${PROJECT_SOURCE_DIR}/cmake/PythonGetLibAndLinkUp.cmake)
endif()

install(
CODE "execute_process(
COMMAND ${CMAKE_COMMAND}
Expand Down

0 comments on commit 9d7789a

Please sign in to comment.