Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion swmm-toolkit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
################## CMAKELISTS FOR SWMM-TOOLKIT PROJECT ###################
################################################################################

cmake_minimum_required (VERSION 3.17)
cmake_minimum_required (VERSION 4.0.2)

project(swmm-toolkit
VERSION
Expand Down
11 changes: 5 additions & 6 deletions swmm-toolkit/build-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@



setuptools == 65.5.1
wheel == 0.38.1
scikit-build == 0.11.1
cmake == 3.21
swig == 4.0.2
ninja; sys_platform == "darwin"
setuptools
wheel
scikit-build
cmake
swig == 4.0.2
81 changes: 52 additions & 29 deletions swmm-toolkit/extern/openmp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMakeLists.txt - CMake configuration file for OpenMP Library on Darwin
#
# Created: Mar 17, 2021
# Updated: May 19, 2021
# Updated: Aug 29, 2025
#
# Author: Michael E. Tryby
# US EPA ORD/CESER
Expand All @@ -14,50 +14,73 @@
# instead.
#
# All sources were obtained directly from the LLVM releases on github
# See license-llvm-openmp.txt for the corresponding license and
# https://openmp.llvm.org/ for details on the OpenMP run-time.
# See license-llvm-openmp.txt for the corresponding license and
# https://openmp.llvm.org/ for details on the OpenMP run-time.

################################################################################
##################### CMAKELISTS FOR OPENMP LIBRARY ######################
################################################################################

include(FetchContent)

# Append local dir to module search path
list(
APPEND CMAKE_MODULE_PATH
${CMAKE_BINARY_DIR}/_deps/llvm_cmake-src/Modules
)

include(
FetchContent
)


# v17.0.1 (v17.0.0 was yanked)
FetchContent_Declare(
llvm_cmake
URL
https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.1/cmake-17.0.1.src.tar.xz
URL_HASH
SHA256=46e745d9bdcd2e18719a47b080e65fd476e1f6c4bbaa5947e4dee057458b78bc
)

FetchContent_Declare(OpenMP
FetchContent_Declare(
OpenMP
URL
https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/openmp-12.0.1.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.1/openmp-17.0.1.src.tar.xz
URL_HASH
SHA256=60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091
SHA256=d4a25c04d1bc035990a85f172bfe29a38f21ff87448f7fbae165fa780cb95717
OVERRIDE_FIND_PACKAGE
)

set(OPENMP_STANDALONE_BUILD TRUE)
set(LIBOMP_INSTALL_ALIASES OFF)
set(
OPENMP_STANDALONE_BUILD
TRUE
)
set(
LIBOMP_INSTALL_ALIASES
OFF
)

FetchContent_MakeAvailable(OpenMP)
set(OpenMP_AVAILABLE TRUE)
FetchContent_MakeAvailable(
llvm_cmake
OpenMP
)

target_compile_options(
omp
INTERFACE
-Xclang
-fopenmp
)

target_link_directories(omp
target_link_directories(
omp
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src>
$<INSTALL_INTERFACE:${LIBRARY_DIST}>
$<INSTALL_INTERFACE:/include>
)

install(TARGETS omp
LIBRARY
DESTINATION
"${LIBRARY_DIST}"
add_library(
OpenMP::OpenMP_C
ALIAS
omp
)

if(CMAKE_C_COMPILER_ID MATCHES "Clang\$")
set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src")
set(OpenMP_C_LIB_NAMES "omp")
set(OpenMP_omp_LIBRARY "${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src/libomp.dylib")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang\$")
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src")
set(OpenMP_CXX_LIB_NAMES "omp")
set(OpenMP_omp_LIBRARY "${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src/libomp.dylib")
endif()
2 changes: 1 addition & 1 deletion swmm-toolkit/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run(self):
cmake_args = ["-GVisual Studio 17 2022","-Ax64"]

elif platform_system == "Darwin":
cmake_args = ["-GNinja","-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.0"]
cmake_args = ["-GXcode","-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.0"]

else:
cmake_args = ["-GUnix Makefiles"]
Expand Down
2 changes: 1 addition & 1 deletion swmm-toolkit/swmm-solver
Loading