Merge pull request #781 from eladsal/update-build-script
Update old build script
This commit is contained in:
61
.github/workflows/ccpp.yml
vendored
61
.github/workflows/ccpp.yml
vendored
@@ -9,27 +9,52 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup build directory
|
|
||||||
run: mkdir buildproducts
|
|
||||||
|
|
||||||
- name: CMake
|
- name: Setup build directory
|
||||||
working-directory: ./buildproducts
|
run: mkdir buildproducts
|
||||||
run: cmake ..
|
|
||||||
|
|
||||||
- name: Make
|
- name: CMake
|
||||||
working-directory: ./buildproducts
|
working-directory: ./buildproducts
|
||||||
run: make
|
run: |
|
||||||
|
retry=0
|
||||||
|
max_retries=3
|
||||||
|
until cmake ..; do
|
||||||
|
retry=$((retry+1))
|
||||||
|
echo "Retry $retry/$max_retries..."
|
||||||
|
if [ "$retry" -ge "$max_retries" ]; then
|
||||||
|
echo "CMake configuration failed after $max_retries attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
- name: Copy header files to build directory
|
- name: Make
|
||||||
run: |
|
working-directory: ./buildproducts
|
||||||
cp include/epanet2.h buildproducts/
|
run: |
|
||||||
cp include/epanet2_2.h buildproducts/
|
retry=0
|
||||||
cp include/epanet2_enums.h buildproducts/
|
max_retries=3
|
||||||
|
until make; do
|
||||||
|
retry=$((retry+1))
|
||||||
|
echo "Retry $retry/$max_retries..."
|
||||||
|
if [ "$retry" -ge "$max_retries" ]; then
|
||||||
|
echo "Make build failed after $max_retries attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Copy header files to build directory
|
||||||
with:
|
run: |
|
||||||
name: libepanet-output
|
cp include/epanet2.h buildproducts/
|
||||||
path: buildproducts/
|
cp include/epanet2_2.h buildproducts/
|
||||||
|
cp include/epanet2_enums.h buildproducts/
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: libepanet-output
|
||||||
|
path: buildproducts/
|
||||||
|
|||||||
29
.github/workflows/macos.yml
vendored
29
.github/workflows/macos.yml
vendored
@@ -9,19 +9,44 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup build directory
|
- name: Setup build directory
|
||||||
run: mkdir buildproducts
|
run: mkdir buildproducts
|
||||||
|
|
||||||
- name: CMake
|
- name: CMake
|
||||||
working-directory: ./buildproducts
|
working-directory: ./buildproducts
|
||||||
run: cmake ..
|
run: |
|
||||||
|
retry=0
|
||||||
|
max_retries=3
|
||||||
|
until cmake ..; do
|
||||||
|
((retry++))
|
||||||
|
echo "Retry $retry/$max_retries..."
|
||||||
|
if [ "$retry" -ge "$max_retries" ]; then
|
||||||
|
echo "CMake configuration failed after $max_retries attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
- name: Make
|
- name: Make
|
||||||
working-directory: ./buildproducts
|
working-directory: ./buildproducts
|
||||||
run: make
|
run: |
|
||||||
|
retry=0
|
||||||
|
max_retries=3
|
||||||
|
until make; do
|
||||||
|
((retry++))
|
||||||
|
echo "Retry $retry/$max_retries..."
|
||||||
|
if [ "$retry" -ge "$max_retries" ]; then
|
||||||
|
echo "Make build failed after $max_retries attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
- name: Copy header files to build directory
|
- name: Copy header files to build directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
18
.github/workflows/win32.yml
vendored
18
.github/workflows/win32.yml
vendored
@@ -9,6 +9,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -19,7 +21,21 @@ jobs:
|
|||||||
|
|
||||||
- name: CMake
|
- name: CMake
|
||||||
working-directory: ./buildproducts
|
working-directory: ./buildproducts
|
||||||
run: cmake .. -A Win32 && cmake --build . --config Release
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$retryCount = 0
|
||||||
|
$maxRetries = 3
|
||||||
|
do {
|
||||||
|
cmake .. -A Win32 && cmake --build . --config Release
|
||||||
|
if ($LASTEXITCODE -eq 0) { break }
|
||||||
|
Write-Host "Retry $($retryCount + 1)/$maxRetries..."
|
||||||
|
Start-Sleep -Seconds 10
|
||||||
|
$retryCount++
|
||||||
|
} while ($retryCount -lt $maxRetries)
|
||||||
|
if ($retryCount -eq $maxRetries) {
|
||||||
|
Write-Host "CMake build failed after $maxRetries attempts."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
- name: Copy header files to build directory
|
- name: Copy header files to build directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
19
.github/workflows/win64.yml
vendored
19
.github/workflows/win64.yml
vendored
@@ -9,6 +9,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -19,7 +21,22 @@ jobs:
|
|||||||
|
|
||||||
- name: CMake
|
- name: CMake
|
||||||
working-directory: ./buildproducts
|
working-directory: ./buildproducts
|
||||||
run: cmake .. -A x64 && cmake --build . --config Release
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$retryCount = 0
|
||||||
|
$maxRetries = 3
|
||||||
|
do {
|
||||||
|
cmake .. -A x64 # Specify architecture for 64-bit
|
||||||
|
cmake --build . --config Release
|
||||||
|
if ($LASTEXITCODE -eq 0) { break }
|
||||||
|
Write-Host "Retry $($retryCount + 1)/$maxRetries..."
|
||||||
|
Start-Sleep -Seconds 10
|
||||||
|
$retryCount++
|
||||||
|
} while ($retryCount -lt $maxRetries)
|
||||||
|
if ($retryCount -eq $maxRetries) {
|
||||||
|
Write-Host "CMake build failed after $maxRetries attempts."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
- name: Copy header files to build directory
|
- name: Copy header files to build directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
# CMake is available at https://cmake.org/download/
|
# CMake is available at https://cmake.org/download/
|
||||||
#
|
#
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 2.8.8)
|
cmake_minimum_required (VERSION 3.5.2)
|
||||||
|
|
||||||
project(EPANET)
|
project(EPANET)
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ OWA-EPANET
|
|||||||
[](https://codecov.io/gh/OpenWaterAnalytics/EPANET)
|
[](https://codecov.io/gh/OpenWaterAnalytics/EPANET)
|
||||||
|
|
||||||
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/ccpp.yml)
|
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/ccpp.yml)
|
||||||
|
[](https://github.
|
||||||
|
com/OpenWaterAnalytics/EPANET/actions/workflows/macos.yml)
|
||||||
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/win32.yml)
|
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/win32.yml)
|
||||||
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/win64.yml)
|
[](https://github.com/OpenWaterAnalytics/EPANET/actions/workflows/win64.yml)
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ Find /i "x86" < checkOS.tmp > StringCheck.tmp
|
|||||||
If %ERRORLEVEL% == 1 (
|
If %ERRORLEVEL% == 1 (
|
||||||
CALL "%SDK_PATH%bin\"SetEnv.cmd /x64 /release
|
CALL "%SDK_PATH%bin\"SetEnv.cmd /x64 /release
|
||||||
rem : create epanet2.dll
|
rem : create epanet2.dll
|
||||||
cl -o epanet2.dll epanet.c epanet2.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /link /DLL
|
cl -o epanet2.dll epanet.c epanet2.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c validate.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /link /DLL
|
||||||
rem : create runepanet.exe
|
rem : create runepanet.exe
|
||||||
cl -o runepanet.exe epanet.c epanet2.c ..\run\main.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /I ..\src /link
|
cl -o runepanet.exe epanet.c epanet2.c ..\run\main.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c validate.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /I ..\src /link
|
||||||
md "%Build_PATH%"\64bit
|
md "%Build_PATH%"\64bit
|
||||||
move /y "%SRC_PATH%"\*.dll "%Build_PATH%"\64bit
|
move /y "%SRC_PATH%"\*.dll "%Build_PATH%"\64bit
|
||||||
move /y "%SRC_PATH%"\*.exe "%Build_PATH%"\64bit
|
move /y "%SRC_PATH%"\*.exe "%Build_PATH%"\64bit
|
||||||
@@ -37,9 +37,9 @@ rem : 32 bit with DEF
|
|||||||
CALL "%SDK_PATH%bin\"SetEnv.cmd /x86 /release
|
CALL "%SDK_PATH%bin\"SetEnv.cmd /x86 /release
|
||||||
echo "32 bit with epanet2.def mapping"
|
echo "32 bit with epanet2.def mapping"
|
||||||
rem : create epanet2.dll
|
rem : create epanet2.dll
|
||||||
cl -o epanet2.dll epanet.c epanet2.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /link /DLL /def:..\include\epanet2.def /MAP
|
cl -o epanet2.dll epanet.c epanet2.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c validate.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /link /DLL /def:..\include\epanet2.def /MAP
|
||||||
rem : create runepanet.exe
|
rem : create runepanet.exe
|
||||||
cl -o runepanet.exe epanet.c epanet2.c ..\run\main.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /I ..\src /link
|
cl -o runepanet.exe epanet.c epanet2.c ..\run\main.c hash.c hydraul.c hydcoeffs.c hydstatus.c hydsolver.c inpfile.c input1.c input2.c input3.c mempool.c output.c project.c quality.c qualroute.c qualreact.c report.c rules.c smatrix.c genmmd.c validate.c /O2 /Depanet2_EXPORTS /I ..\include /I ..\run /I ..\src /link
|
||||||
md "%Build_PATH%"\32bit
|
md "%Build_PATH%"\32bit
|
||||||
move /y "%SRC_PATH%"\*.dll "%Build_PATH%"\32bit
|
move /y "%SRC_PATH%"\*.dll "%Build_PATH%"\32bit
|
||||||
move /y "%SRC_PATH%"\*.exe "%Build_PATH%"\32bit
|
move /y "%SRC_PATH%"\*.exe "%Build_PATH%"\32bit
|
||||||
|
|||||||
Reference in New Issue
Block a user