Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mac OS X port #138

Merged
merged 55 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
445d1e8
Support MAC OS for PaddlePaddle
gangliao Sep 9, 2016
ad6cade
replace linux/tcp by netinet/tcp
gangliao Sep 9, 2016
3f5ce64
fix StorageEngine::singleton and std::function<void()> type unmatched.
gangliao Sep 9, 2016
94b88c8
Merge branch 'master' of https://github.com/gangliao/Paddle
gangliao Sep 9, 2016
a3941cb
remove weak attribute for internal FPGA
gangliao Sep 9, 2016
38166e2
Add default openblas path on MAC OS
gangliao Sep 9, 2016
58f74e2
Add main entry for unit test files and replace memalign by posix_mema…
gangliao Sep 10, 2016
87f96f8
fix dynamic load PaddlePaddle for Mac OS
gangliao Sep 10, 2016
b664ca0
auto-tuning SND/REV buff size on MAC OS
gangliao Sep 10, 2016
ec2a3eb
Merge remote-tracking branch 'upstream/master'
gangliao Sep 10, 2016
70cceb0
fix compile paddle swig bug on MAC OS
gangliao Sep 11, 2016
c7ece60
add gettid syscall for MAC OS
gangliao Sep 12, 2016
8d02141
fix unit test bug when only one gpu
gangliao Sep 12, 2016
9a9e059
Merge remote-tracking branch 'upstream/master'
gangliao Sep 12, 2016
d3eef0c
reduce data_layer size of unit test to avoid cuda out of memory on M…
gangliao Sep 12, 2016
eb5cf64
reduce data_layer size of unit test to avoid cuda out of memory on M…
gangliao Sep 12, 2016
0ad0e4a
Add Wall Werror
reyoung Sep 12, 2016
738b689
Make whole-archive to less library
reyoung Sep 12, 2016
4315a38
Merge pull request #1 from reyoung/mac_port
gangliao Sep 12, 2016
db13fdd
Clean locks.h, Add arch Locks.cpp
reyoung Sep 13, 2016
d9870c3
Merge branch 'master' into mac_port
reyoung Sep 13, 2016
a238b11
Fix linux compile
reyoung Sep 13, 2016
55a1a75
Disable a unittest will use large memory by grep
reyoung Sep 13, 2016
7dec631
Merge pull request #2 from reyoung/mac_port
gangliao Sep 13, 2016
1df0c7b
avoid link failed on unit test for mac os
gangliao Sep 14, 2016
b2d6538
Merge remote-tracking branch 'origin/master'
gangliao Sep 14, 2016
d8366a6
fix bug on thread barrier
gangliao Sep 14, 2016
0ba302f
fix bug on paddle api when WITH_DOUBLE
gangliao Sep 14, 2016
8a379fc
add sse instructions support for double on MAC OS
gangliao Sep 14, 2016
1f8c219
replace fabsf() using std::abs
gangliao Sep 14, 2016
92ca98d
Merge remote-tracking branch 'upstream/master'
gangliao Sep 17, 2016
a6b58cf
Merge remote-tracking branch 'upstream/master'
gangliao Sep 19, 2016
75beeaf
Fix unit test stack trace bug on MAC OS
gangliao Sep 19, 2016
4e37b22
Revise member variable in private barrier class
gangliao Sep 19, 2016
2d13462
Fix incompatible on CUDA atomicAdd operation
gangliao Sep 19, 2016
75cbf5e
add gitignore for VS CODE on MAC OS
gangliao Sep 20, 2016
2daa05c
add build on MAC OSX docs
gangliao Sep 20, 2016
9795e01
Merge remote-tracking branch 'upstream/master'
gangliao Sep 20, 2016
536bf7d
fix poolAllocator unordered_map bug on Mac OS X
gangliao Sep 20, 2016
8b1c76a
comment LOG(info) in createPythonClass
gangliao Sep 20, 2016
7ff8e76
Shrink batch size on unit test for Mac OS X
gangliao Sep 20, 2016
aaed5cf
revert real into float for swig API
gangliao Sep 20, 2016
b8d26ff
fix float except bugs
Sep 21, 2016
32b5557
Add thread Barrier unit test
gangliao Sep 23, 2016
5bca34e
Merge remote-tracking branch 'upstream/master'
gangliao Sep 23, 2016
1d4bc47
support gettid() on MAC OS X
gangliao Sep 26, 2016
a8df411
Replace random_shuffle using shuffle.
gangliao Sep 28, 2016
23e47bb
Merge remote-tracking branch 'upstream/master'
gangliao Sep 28, 2016
0072ef5
Fix compile check type failed in linux
gangliao Sep 28, 2016
eaedef8
Update build doc
gangliao Sep 28, 2016
876ab96
Merge remote-tracking branch 'upstream/master'
gangliao Sep 28, 2016
cbb9043
Remove main function in some unittest.
reyoung Sep 29, 2016
54c37ab
Merge pull request #3 from reyoung/mac_port
gangliao Sep 29, 2016
8ddc5fa
Update Mac OS X port
gangliao Sep 29, 2016
efea5c8
Revise some word in build doc
gangliao Sep 29, 2016
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.DS_Store
build/
*.user

.vscode
.idea
6 changes: 4 additions & 2 deletions cmake/cblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion cmake/cudnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS
$ENV{CUDNN_ROOT}/lib64
$ENV{CUDNN_ROOT}/lib
/usr/lib)
find_library(CUDNN_LIBRARY NAMES libcudnn.so # libcudnn_static.a
find_library(CUDNN_LIBRARY NAMES libcudnn.so libcudnn.dylib # libcudnn_static.a
PATHS ${CUDNN_CHECK_LIBRARY_DIRS} ${CUDNN_INCLUDE_DIR} ${__libpath_hist}
NO_DEFAULT_PATH
DOC "Path to cuDNN library.")
Expand Down
57 changes: 48 additions & 9 deletions cmake/util.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
# Some common routine for paddle compile.


# target_circle_link_libraries
# Link libraries to target which has circle dependencies.
#
# First Argument: target name want to be linked with libraries
# Rest Arguments: libraries which link together.
function(target_circle_link_libraries TARGET_NAME)
target_link_libraries(${TARGET_NAME}
-Wl,--start-group
${ARGN}
-Wl,--end-group)
if(APPLE)
set(LIBS)
set(inArchive OFF)
set(libsInArgn)

foreach(arg ${ARGN})
if(${arg} STREQUAL "ARCHIVE_START")
set(inArchive ON)
elseif(${arg} STREQUAL "ARCHIVE_END")
set(inArchive OFF)
else()
if(inArchive)
list(APPEND LIBS "-Wl,-force_load")
endif()
list(APPEND LIBS ${arg})
list(APPEND libsInArgn ${arg})
endif()
endforeach()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
list(APPEND LIBS "-undefined dynamic_lookup")
endif()
list(REVERSE libsInArgn)
target_link_libraries(${TARGET_NAME}
${LIBS}
${libsInArgn})

else() # LINUX
set(LIBS)

foreach(arg ${ARGN})
if(${arg} STREQUAL "ARCHIVE_START")
list(APPEND LIBS "-Wl,--whole-archive")
elseif(${arg} STREQUAL "ARCHIVE_END")
list(APPEND LIBS "-Wl,--no-whole-archive")
else()
list(APPEND LIBS ${arg})
endif()
endforeach()

target_link_libraries(${TARGET_NAME}
"-Wl,--start-group"
${LIBS}
"-Wl,--end-group")
endif()
endfunction()

# compile_cu_as_cpp
Expand Down Expand Up @@ -41,20 +80,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}
-Wl,--whole-archive
ARCHIVE_START
paddle_internal_gserver
paddle_internal_owlqn
-Wl,--no-whole-archive
ARCHIVE_END
paddle_internal_parameter)
else()
set(INTERAL_LIBS "")
endif()

target_circle_link_libraries(${TARGET_NAME}
-Wl,--whole-archive
ARCHIVE_START
paddle_gserver
${METRIC_LIBS}
-Wl,--no-whole-archive
ARCHIVE_END
paddle_pserver
paddle_trainer_lib
paddle_network
Expand Down
Loading