From 91f8bf3cf095b9afabdf16c2f1801a790b2709a3 Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 17:47:19 +0000 Subject: [PATCH 1/6] Add standalone SimpleNet example build --- .github/workflows/test_suite_ubuntu.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index aab34ede..e5fc72fc 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -108,3 +108,17 @@ jobs: run: | . ftorch/bin/activate ./run_test_suite.sh --verbose --integration-only + + - name: Standalone SimpleNet example build + run: | + . ftorch/bin/activate + export FTORCH_BUILD_DIR="$(pwd)/build" + cd examples/1_SimpleNet + export BUILD_DIR="$(pwd)/build" + mkdir "${BUILD_DIR}" + cd "${BUILD_DIR}" + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ + -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}" + cmake --build . From 4d7ed460439308b422902eb7072c7a5e4bb193bb Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 17:48:20 +0000 Subject: [PATCH 2/6] Follow ShellCheck recommendations in CI --- .github/workflows/test_suite_ubuntu.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index e5fc72fc..f689ce08 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -83,16 +83,15 @@ jobs: run: | . ftorch/bin/activate VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))") - export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages - export BUILD_DIR=$(pwd)/build + export Torch_DIR="${VIRTUAL_ENV}/lib/python${VN}/site-packages" + export BUILD_DIR="$(pwd)/build" # NOTE: The pFUnit version (pinned during installation above) is used in the install path. - export PFUNIT_DIR=$(pwd)/pFUnit/build/installed/PFUNIT-4.10 - mkdir ${BUILD_DIR} - cd ${BUILD_DIR} + export PFUNIT_DIR="$(pwd)/pFUnit/build/installed/PFUNIT-4.10" + mkdir "${BUILD_DIR}" + cd "${BUILD_DIR}" cmake .. \ - -DPython_EXECUTABLE="$(which python)" \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \ + -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ -DCMAKE_BUILD_TESTS=TRUE \ -DCMAKE_PREFIX_PATH="${PFUNIT_DIR};${Torch_DIR}" \ -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}" From 522946fc5470cfaa75c2e8991b2e25214d35d93d Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 17:57:04 +0000 Subject: [PATCH 3/6] Add Python_EXECUTABLE back in --- .github/workflows/test_suite_ubuntu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index f689ce08..3df36328 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -90,6 +90,7 @@ jobs: mkdir "${BUILD_DIR}" cd "${BUILD_DIR}" cmake .. \ + -DPython_EXECUTABLE="$(which python)" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ -DCMAKE_BUILD_TESTS=TRUE \ From e1498ee28f460a2844f254eedd2381e9667d585d Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 17:58:03 +0000 Subject: [PATCH 4/6] Run standalone SimpleNet example, too --- .github/workflows/test_suite_ubuntu.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index 3df36328..0cb8cd57 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -109,7 +109,7 @@ jobs: . ftorch/bin/activate ./run_test_suite.sh --verbose --integration-only - - name: Standalone SimpleNet example build + - name: Standalone SimpleNet example run: | . ftorch/bin/activate export FTORCH_BUILD_DIR="$(pwd)/build" @@ -118,7 +118,9 @@ jobs: mkdir "${BUILD_DIR}" cd "${BUILD_DIR}" cmake .. \ + -DPython_EXECUTABLE="$(which python)" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}" cmake --build . + ctest -V From 1dd40703b71f9719e8793119e066e2faecd0fecf Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 18:15:28 +0000 Subject: [PATCH 5/6] Need to build tests to run them --- .github/workflows/test_suite_ubuntu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index 0cb8cd57..b1d96fbd 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -121,6 +121,7 @@ jobs: -DPython_EXECUTABLE="$(which python)" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ + -DCMAKE_BUILD_TESTS=TRUE \ -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}" cmake --build . ctest -V From 78069a880fea4af8ca6cffbcf5c5c0754d12ac88 Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Mon, 3 Mar 2025 18:17:41 +0000 Subject: [PATCH 6/6] Typo --- .github/workflows/test_suite_ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_suite_ubuntu.yml b/.github/workflows/test_suite_ubuntu.yml index b1d96fbd..d4c619b1 100644 --- a/.github/workflows/test_suite_ubuntu.yml +++ b/.github/workflows/test_suite_ubuntu.yml @@ -120,7 +120,7 @@ jobs: cmake .. \ -DPython_EXECUTABLE="$(which python)" \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ + -DCMAKE_INSTALL_PREFIX="${FTORCH_BUILD_DIR}" \ -DCMAKE_BUILD_TESTS=TRUE \ -DCMAKE_Fortran_FLAGS="-std=${{ matrix.std }}" cmake --build .