diff --git a/.github/workflows/reusable_basic.yml b/.github/workflows/reusable_basic.yml index 25d33e2b3a..22bf0ea505 100644 --- a/.github/workflows/reusable_basic.yml +++ b/.github/workflows/reusable_basic.yml @@ -453,6 +453,9 @@ jobs: strategy: matrix: os: ['macos-13', 'macos-14'] + include: + - os: macos-14 + static_hwloc: '-DUMF_LINK_HWLOC_STATICALLY=ON' env: BUILD_TYPE : "Release" runs-on: ${{matrix.os}} @@ -471,8 +474,12 @@ jobs: echo "$PATH" >> $GITHUB_PATH python3 -m pip install -r third_party/requirements.txt + - name: Install dependencies + run: brew install jemalloc tbb automake libtool + - name: Install hwloc - run: brew install hwloc tbb automake + if: ${{ !matrix.static_hwloc }} + run: brew install hwloc - name: Get UMF version run: | @@ -492,6 +499,7 @@ jobs: -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON -DUMF_BUILD_SHARED_LIBRARY=ON -DUMF_TESTS_FAIL_ON_SKIP=ON + ${{matrix.static_hwloc}} - name: Build UMF run: cmake --build ${{env.BUILD_DIR}} -j $(sysctl -n hw.logicalcpu) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe05ef0b7b..c0072be7e4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2023-2024 Intel Corporation +# Copyright (C) 2023-2025 Intel Corporation # Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -182,6 +182,18 @@ add_dependencies(umf coarse) if(UMF_LINK_HWLOC_STATICALLY) add_dependencies(umf ${UMF_HWLOC_NAME}) + # On Darwin, link with the IOKit and Foundation frameworks, if they are + # available in the system. This is to comply with hwloc which links these, + # if available. There is no option to disable these frameworks on Darwin + # hwloc builds. + if(MACOSX) + find_library(IOKIT_LIBRARY IOKit) + find_library(FOUNDATION_LIBRARY Foundation) + if(IOKIT_LIBRARY OR FOUNDATION_LIBRARY) + target_link_libraries(umf PRIVATE ${IOKIT_LIBRARY} + ${FOUNDATION_LIBRARY}) + endif() + endif() endif() if(NOT WINDOWS AND UMF_POOL_JEMALLOC_ENABLED)