diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8080ca37b..0d8bff3ec 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -26,10 +26,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2016, ubuntu-16.04, macos-latest] + os: [windows-2016, ubuntu-16.04, macos-10.15] requirements: [requirements-swmm.txt] include: - os: windows-2016 + sys_pkgs: choco install boost-msvc-14.1 generator: Visual Studio 15 2017 Win64 experimental: true script_extension: cmd @@ -40,7 +41,9 @@ jobs: run: shell: cmd working-directory: ./ci-tools/windows + - os: ubuntu-16.04 + sys_pkgs: sudo apt install libboost-dev libboost-all-dev generator: "Unix Makefiles" experimental: true script_extension: sh @@ -51,7 +54,9 @@ jobs: run: shell: bash working-directory: ./ci-tools/linux - - os: macos-latest + + - os: macos-10.15 + sys_pkgs: brew install libomp boost generator: Xcode experimental: true ci_tools_path: ci-tools/darwin @@ -81,8 +86,13 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 + + - name: Clone ci-tools repo + uses: actions/checkout@v2 with: - submodules: recursive + repository: OpenWaterAnalytics/ci-tools + ref: master + path: ci-tools - name: Setup python uses: actions/setup-python@v2 @@ -94,11 +104,8 @@ jobs: python -m pip install --upgrade pip python -m pip install -r ${{ matrix.requirements }} - - name: Install Darwin requirements - if: ${{ contains(matrix.os, 'macos') }} - run: | - brew install libomp - brew install boost + - name: Install required system packages + run: ${{ matrix.sys_pkgs }} - name: Build and unit test run: | @@ -110,7 +117,7 @@ jobs: - name: Before reg test run: | - ./before-nrtest.${{ matrix.script_extension }} + ./before-nrtest.${{ matrix.script_extension }} v1.0.3-dev - name: Run reg test run: | diff --git a/.gitmodules b/.gitmodules index 9e5fd7a64..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "ci-tools"] - path = ci-tools - url = https://github.com/OpenWaterAnalytics/ci-tools.git diff --git a/CMakeLists.txt b/CMakeLists.txt index c1790c6a5..77fee6f75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # CMakeLists.txt - CMake configuration file for swmm-solver # # Created: July 11, 2019 -# Updated: May 29, 2020 +# Updated: May 19, 2021 # # Author: Michael E. Tryby # US EPA ORD/CESER @@ -61,14 +61,10 @@ if(BUILD_TESTS) endif() -# Pass var up the project tree -if(APPLE) - set(EXTERN_LIB_PATH ${EXTERN_LIB_PATH} PARENT_SCOPE) -endif() - - # Create install rules for vcruntime.dll, msvcp.dll, vcomp.dll etc. -set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE) +if(OpenMP_FOUND) + set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE) +endif() include(InstallRequiredSystemLibraries) diff --git a/ci-tools b/ci-tools deleted file mode 160000 index 98e969009..000000000 --- a/ci-tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 98e969009b092d2a27550ba4f44f0eca1661a970 diff --git a/src/solver/CMakeLists.txt b/src/solver/CMakeLists.txt index 5108d1a61..b3f344107 100644 --- a/src/solver/CMakeLists.txt +++ b/src/solver/CMakeLists.txt @@ -2,14 +2,17 @@ # CMakeLists.txt - CMake configuration file for swmm-solver/library # # Created: Jul 11, 2019 -# Updated: Mar 5, 2020 +# Updated: May 19, 2021 # # Author: Michael E. Tryby # US EPA ORD/CESER # -find_package(OpenMP REQUIRED) +find_package(OpenMP + OPTIONAL_COMPONENTS + C +) # configure file groups @@ -55,6 +58,9 @@ target_compile_options(swmm5 "$<$:/fp:fast>" "$<$:/Zi>" ">" + $<$: + $<$:-O3> + > ) target_link_options(swmm5 @@ -67,7 +73,8 @@ target_link_options(swmm5 target_link_libraries(swmm5 PUBLIC $<$>>:m> - $<$:OpenMP::OpenMP_C> + $<$:OpenMP::OpenMP_C> + $<$:omp> ) target_include_directories(swmm5 @@ -102,23 +109,6 @@ install( ) -# TODO: Figure out why this doesn't work for package target -# When building on MacOS relocate libomp to install package -if(APPLE) - get_filename_component(EXTERN_LIB_PATH ${OpenMP_libomp_LIBRARY} REALPATH) - - install( - FILES - ${EXTERN_LIB_PATH} - DESTINATION - ${CMAKE_INSTALL_PREFIX}/extern - ) - - # Pass the var up the project tree - set(EXTERN_LIB_PATH ${EXTERN_LIB_PATH} PARENT_SCOPE) -endif() - - # copy swmm5 to build tree for testing add_custom_command(TARGET swmm5 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy