Skip to content

Commit 35eda41

Browse files
authored
Add a standalone SimpleNet example build to the CI (#304)
1 parent d05f163 commit 35eda41

2 files changed

Lines changed: 48 additions & 2 deletions

File tree

.github/workflows/test_suite_ubuntu_cpu_gnu.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,24 @@ jobs:
217217
. ftorch/bin/activate
218218
cd build
219219
ctest --verbose --tests-regex example
220+
221+
# Check that we can successfully build and run an example outside the main FTorch build process
222+
- name: Standalone SimpleNet example
223+
env:
224+
FORTRAN_STANDARD: ${{ matrix.std }}
225+
run: |
226+
. ftorch/bin/activate
227+
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
228+
export Torch_DIR="${VIRTUAL_ENV}/lib/python${VN}/site-packages/torch"
229+
export FTORCH_BUILD_DIR="$(pwd)/build"
230+
export EXAMPLE_BUILD_DIR="examples/2_SimpleNet/build"
231+
mkdir "${EXAMPLE_BUILD_DIR}"
232+
cd "${EXAMPLE_BUILD_DIR}"
233+
cmake .. \
234+
-DPython_EXECUTABLE="$(which python)" \
235+
-DCMAKE_BUILD_TYPE=Release \
236+
-DCMAKE_INSTALL_PREFIX="${FTORCH_BUILD_DIR}" \
237+
-DCMAKE_BUILD_TESTS=TRUE \
238+
-DCMAKE_Fortran_FLAGS="-std=${FORTRAN_STANDARD}"
239+
cmake --build .
240+
ctest -V

.github/workflows/test_suite_ubuntu_cpu_intel.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ jobs:
9999
run: |
100100
. ftorch/bin/activate
101101
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
102-
export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages
103-
export BUILD_DIR=$(pwd)/build
102+
export Torch_DIR="${VIRTUAL_ENV}/lib/python${VN}/site-packages"
103+
export BUILD_DIR="$(pwd)/build"
104104
# NOTE: The pFUnit version (pinned during installation above) is used in the install path.
105105
export PFUNIT_DIR=$(pwd)/pFUnit/build/installed/PFUNIT-4.12
106106
mkdir ${BUILD_DIR}
@@ -131,3 +131,28 @@ jobs:
131131
. ftorch/bin/activate
132132
cd build
133133
ctest --verbose --tests-regex example
134+
135+
# Check that we can successfully build and run an example outside the main FTorch build process
136+
- name: Standalone SimpleNet example
137+
env:
138+
FORTRAN_STANDARD: ${{ matrix.std }}
139+
run: |
140+
. ftorch/bin/activate
141+
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
142+
export Torch_DIR="${VIRTUAL_ENV}/lib/python${VN}/site-packages/torch"
143+
export FTORCH_BUILD_DIR="$(pwd)/build"
144+
export EXAMPLE_BUILD_DIR="examples/2_SimpleNet/build"
145+
mkdir "${EXAMPLE_BUILD_DIR}"
146+
cd "${EXAMPLE_BUILD_DIR}"
147+
cmake .. \
148+
-DPython_EXECUTABLE="$(which python)" \
149+
-DCMAKE_BUILD_TYPE=Release \
150+
-DCMAKE_C_COMPILER=icx \
151+
-DCMAKE_CXX_COMPILER=icpx \
152+
-DCMAKE_Fortran_COMPILER="${{ matrix.FC }}" \
153+
-DMPI_Fortran_COMPILER="${{ matrix.MPIFC }}" \
154+
-DCMAKE_INSTALL_PREFIX="${FTORCH_BUILD_DIR}" \
155+
-DCMAKE_BUILD_TESTS=TRUE \
156+
-DCMAKE_Fortran_FLAGS="-std=${FORTRAN_STANDARD}"
157+
cmake --build .
158+
ctest -V

0 commit comments

Comments
 (0)