From c87fd9760b829f29bdad3952a49d145cd9a320ec Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 16 Dec 2024 12:25:53 +0000 Subject: [PATCH 1/2] test: make windows CI more robust Previously I hard-coded the path to libtorch. This commit replaces the hard-code path using `pip show` to get the updated location. --- .github/workflows/test_suite_windows.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_suite_windows.yml b/.github/workflows/test_suite_windows.yml index 3cfb2321..a667e8a5 100644 --- a/.github/workflows/test_suite_windows.yml +++ b/.github/workflows/test_suite_windows.yml @@ -69,11 +69,13 @@ jobs: shell: cmd run: | cd src + rem find torch location + for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set package_path=%%i cmake ^ -Bbuild ^ -G "NMake Makefiles" ^ -DCMAKE_Fortran_FLAGS="/fpscomp:logicals" ^ - -DCMAKE_PREFIX_PATH="C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages" ^ + -DCMAKE_PREFIX_PATH=%package_path% ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_Fortran_COMPILER=ifx ^ -DCMAKE_C_COMPILER=icx ^ @@ -85,7 +87,7 @@ jobs: - name: Integration tests shell: cmd run: | - set PATH=C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages;%PATH% + for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set package_path=%%i set PATH=C:\Program Files (x86)\FTorch\bin;%PATH% - set PATH=C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages\torch\lib;%PATH% + set PATH=%package_path%\torch\lib;%PATH% run_integration_tests.bat From 98917d38c807e253ecd9662000316599a9be7b87 Mon Sep 17 00:00:00 2001 From: tommelt Date: Mon, 16 Dec 2024 22:09:59 +0000 Subject: [PATCH 2/2] chore: rename variable to torch_path --- .github/workflows/test_suite_windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_suite_windows.yml b/.github/workflows/test_suite_windows.yml index a667e8a5..d96712dd 100644 --- a/.github/workflows/test_suite_windows.yml +++ b/.github/workflows/test_suite_windows.yml @@ -70,12 +70,12 @@ jobs: run: | cd src rem find torch location - for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set package_path=%%i + for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set torch_path=%%i cmake ^ -Bbuild ^ -G "NMake Makefiles" ^ -DCMAKE_Fortran_FLAGS="/fpscomp:logicals" ^ - -DCMAKE_PREFIX_PATH=%package_path% ^ + -DCMAKE_PREFIX_PATH=%torch_path% ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_Fortran_COMPILER=ifx ^ -DCMAKE_C_COMPILER=icx ^ @@ -87,7 +87,7 @@ jobs: - name: Integration tests shell: cmd run: | - for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set package_path=%%i + for /f "tokens=2*" %%i in ('pip show torch ^| findstr /R "^Location"') do set torch_path=%%i set PATH=C:\Program Files (x86)\FTorch\bin;%PATH% - set PATH=%package_path%\torch\lib;%PATH% + set PATH=%torch_path%\torch\lib;%PATH% run_integration_tests.bat