From 00f4fa71b6c6342773fe791d5b69307de86e8050 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 18 Nov 2024 00:24:33 -0800 Subject: [PATCH 1/2] Install Visual Studio Redistributable. --- cmake/BuildRADE.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/BuildRADE.cmake b/cmake/BuildRADE.cmake index 9e5e1cd6..6a68b0d4 100644 --- a/cmake/BuildRADE.cmake +++ b/cmake/BuildRADE.cmake @@ -55,6 +55,14 @@ if (NOT download_pip_POPULATED) FetchContent_Populate(download_pip) endif (NOT download_pip_POPULATED) +# PyTorch needs the Visual Studio redistributable to be installed. +FetchContent_Declare(download_vsr + URL https://aka.ms/vs/16/release/vc_redist.x64.exe + DOWNLOAD_NO_EXTRACT TRUE) +if (NOT download_vsr_POPULATED) + FetchContent_Populate(download_vsr) +endif (NOT download_vsr_POPULATED) + # Per https://bnikolic.co.uk/blog/python/2022/03/14/python-embedwin.html # there are some tweaks we need to make to the embeddable package first # before FreeDV can use it. Additionally, renaming python312._pth does not @@ -100,9 +108,15 @@ install( DESTINATION bin/model19_check3/checkpoints ) +# Install VS Redistributable +install( + FILES ${download_vsr_SOURCE_DIR}/vc_redist.x86.exe + DESTINATION bin) + # Ensure that rade-setup.bat is executed by the installer, # otherwise no packages will be installed. set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS + "ExecWait '\"\$INSTDIR\\\\bin\\\\vcredist_x86.exe\" /install /passive'" "ExecShellWait '' '\$INSTDIR\\\\bin\\\\rade-setup.bat' ''") # Make sure we fully clean up after Python on uninstall. From 64b21928830a2697096c9a79083d697c08cfdeba Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 18 Nov 2024 00:48:51 -0800 Subject: [PATCH 2/2] Fix errors in initial commit. --- cmake/BuildRADE.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/BuildRADE.cmake b/cmake/BuildRADE.cmake index 6a68b0d4..dfb69863 100644 --- a/cmake/BuildRADE.cmake +++ b/cmake/BuildRADE.cmake @@ -110,14 +110,14 @@ install( # Install VS Redistributable install( - FILES ${download_vsr_SOURCE_DIR}/vc_redist.x86.exe + FILES ${download_vsr_SOURCE_DIR}/vc_redist.x64.exe DESTINATION bin) # Ensure that rade-setup.bat is executed by the installer, # otherwise no packages will be installed. set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS - "ExecWait '\"\$INSTDIR\\\\bin\\\\vcredist_x86.exe\" /install /passive'" - "ExecShellWait '' '\$INSTDIR\\\\bin\\\\rade-setup.bat' ''") + "ExecWait '\\\"\$INSTDIR\\\\bin\\\\vc_redist.x64.exe\\\" /install /passive' + ExecShellWait '' '\$INSTDIR\\\\bin\\\\rade-setup.bat' ''") # Make sure we fully clean up after Python on uninstall. set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS