Skip to content

Commit

Permalink
fix macos-12 build
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Oct 14, 2023
1 parent 357c5b8 commit c1c5501
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; \
print(distutils.sysconfig.get_config_var('INCLUDEDIR'))"
OUTPUT_VARIABLE PYTHON_INCLUDE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)

IF (NOT PYTHONLIBS_FOUND)
IF (PYTHONLIBS_FOUND)
STRING(FIND ${PYTHONLIBS_VERSION_STRING} "." PYV_L REVERSE)
STRING(SUBSTRING ${PYTHONLIBS_VERSION_STRING} 0 ${PYV_L} PYTHONLIBS_VERSION_STRING_SHORT)
ELSE()
SET(PYTHONLIBS_VERSION_STRING_SHORT 0.0)
ENDIF()

MESSAGE(STATUS "PYTHONLIBS_VERSION_STRING_SHORT = ${PYTHONLIBS_VERSION_STRING_SHORT}")

IF ((NOT PYTHONLIBS_FOUND) OR NOT (${PYTHONLIBS_VERSION_STRING_SHORT} EQUAL ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}))
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; \
import os; print(os.path.join(distutils.sysconfig.get_config_var('LIBDIR'), \
distutils.sysconfig.get_config_var('LDLIBRARY')))"
Expand Down Expand Up @@ -248,11 +257,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}")
Expand Down

0 comments on commit c1c5501

Please sign in to comment.