From efd7590140a8229072992316c1b6ee601fef5b39 Mon Sep 17 00:00:00 2001 From: Huanchen Zhai Date: Fri, 13 Oct 2023 19:18:57 -0700 Subject: [PATCH] try fix macos-12 build --- .github/workflows/build.yml | 2 ++ CMakeLists.txt | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5b987b..46408ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,8 @@ jobs: run: | mkdir build cd build + ls -l /Applications/Xcode_14.2.app/Contents/Developer/Library/Frameworks/Python3.framework/ + ls -l /Applications/Xcode_14.2.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions cmake .. -DUSE_MKL=ON make -j 4 cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f5b68d..d3cee53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,8 @@ IF (NOT PYTHONLIBS_FOUND) distutils.sysconfig.get_config_var('LDLIBRARY')))" OUTPUT_VARIABLE PYTHON_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_inc; \ - print(get_python_inc())" + print(get_python_inc().replace('/Python3.framework/Headers', \ + '/Python3.framework/Versions/${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/Headers'))" OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) ENDIF() @@ -248,11 +249,11 @@ ENDIF() SET(OPT_FLAG ${OPT_FLAG} -fvisibility=hidden) IF ((NOT APPLE) AND (NOT WIN32)) - TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC rt) + TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE rt) ENDIF() -TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${OMP_LIB_NAME} ${PTHREAD}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LIBS} ${HPTT_LIB} ${CUT_LIB}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${OMP_LIB_NAME} ${PTHREAD}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MKL_LIBS} ${HPTT_LIB} ${CUT_LIB}) MESSAGE(STATUS "ARCH_FLAG = ${ARCH_FLAG}") MESSAGE(STATUS "OPT_FLAG = ${OPT_FLAG}")