提交 38166e29 编写于 作者: L liaogang

Add default openblas path on MAC OS

上级 a3941cbc
......@@ -44,8 +44,8 @@ set(ATLAS_LIB_SEARCH_PATHS
/usr/lib
/usr/lib/blas/atlas
/usr/lib/atlas
/usr/lib/atlas-base # special for ubuntu 14.04.
)
/usr/lib/atlas-base) # special for ubuntu 14.04.
find_path(ATLAS_INC_DIR NAMES cblas.h
PATHS ${ATLAS_INCLUDE_SEARCH_PATHS})
find_library(ATLAS_CBLAS_LIB NAMES cblas libcblas.so.3
......@@ -65,12 +65,14 @@ set(OPENBLAS_ROOT $ENV{OPENBLAS_ROOT} CACHE PATH "Folder contains Openblas")
set(OPENBLAS_INCLUDE_SEARCH_PATHS
${OPENBLAS_ROOT}/include
/usr/include
/usr/include/openblas)
/usr/include/openblas
/usr/local/opt/openblas/include)
set(OPENBLAS_LIB_SEARCH_PATHS
${OPENBLAS_ROOT}/lib
/usr/lib
/usr/lib/blas/openblas
/usr/lib/openblas)
/usr/lib/openblas
/usr/local/opt/openblas/lib)
find_path(OPENBLAS_INC_DIR NAMES cblas.h
PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS})
......
# Some common routine for paddle compile.
# MAC OS does not contain start-up and whole-archive args
if(APPLE)
# -------------------------------------------------------
# OSX
# -------------------------------------------------------
set(GROUP_START "-Wl,-force_load")
set(GROUP_START "")
set(GROUP_END "")
set(ARCHIVE_START "-Wl,-force_load")
set(ARCHIVE_START "")
set(ARCHIVE_END "")
else()
set(GROUP_START "-Wl,--start-group")
......@@ -17,6 +14,7 @@ else()
endif()
# Some common routine for paddle compile.
# target_circle_link_libraries
# Link libraries to target which has circle dependencies.
......@@ -25,15 +23,16 @@ endif()
# Rest Arguments: libraries which link together.
function(target_circle_link_libraries TARGET_NAME)
if(APPLE)
foreach(f ${ARGN})
list(APPEND OSX_LIBRARIES "-Wl,-force_load" "${f}")
endforeach(f)
foreach(arg ${ARGN})
list(APPEND OSX_LIBRARIES "-Wl,-force_load" "${arg}")
endforeach()
target_link_libraries(${TARGET_NAME}
${OSX_LIBRARIES})
${OSX_LIBRARIES} -lz)
else()
target_link_libraries(${TARGET_NAME}
${GROUP_START}
${ARGN}
-lz
${GROUP_END})
endif()
endfunction()
......@@ -66,18 +65,20 @@ function(link_paddle_exe TARGET_NAME)
if(PADDLE_WITH_INTERNAL)
set(INTERAL_LIBS paddle_internal_gserver paddle_internal_parameter)
target_circle_link_libraries(${TARGET_NAME}
${ARCHIVE_START}
paddle_internal_gserver
paddle_internal_owlqn
${ARCHIVE_END}
paddle_internal_parameter)
else()
set(INTERAL_LIBS "")
endif()
target_circle_link_libraries(${TARGET_NAME}
# ${ARCHIVE_START}
${ARCHIVE_START}
paddle_gserver
${METRIC_LIBS}
# ${ARCHIVE_END}
${ARCHIVE_END}
paddle_pserver
paddle_trainer_lib
paddle_network
......@@ -91,8 +92,7 @@ function(link_paddle_exe TARGET_NAME)
${CMAKE_THREAD_LIBS_INIT}
${CBLAS_LIBS}
${CMAKE_DL_LIBS}
${INTERAL_LIBS}
)
${INTERAL_LIBS})
if(WITH_PYTHON)
target_link_libraries(${TARGET_NAME}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册