File tree Expand file tree Collapse file tree 10 files changed +66
-11
lines changed Expand file tree Collapse file tree 10 files changed +66
-11
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
55
55
option (COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF )
56
56
option (ON_TRAVIS "Exclude special unit test on Travis CI" OFF )
57
57
option (WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF )
58
+ # TODO: Only compile PaddlePaddle fluid version by WITH_FLUID option.
59
+ option (WITH_FLUID "Compile PaddlePaddle fluid only(TODO)" ON )
58
60
option (WITH_GOLANG "Compile PaddlePaddle with GOLANG" OFF )
59
61
option (GLIDE_INSTALL "Download and install go dependencies " ON )
60
62
option (USE_NNPACK "Compile PaddlePaddle with NNPACK library" OFF )
@@ -107,6 +109,10 @@ if (WITH_C_API AND WITH_PYTHON)
107
109
"different Python interpreter from compiling." )
108
110
endif ()
109
111
112
+ if (WITH_C_API )
113
+ set (WITH_FLUID OFF CACHE STRING "Disable install fluid when compile the C_API" FORCE )
114
+ endif ()
115
+
110
116
if (MOBILE_INFERENCE )
111
117
set (THIRD_PARTY_BUILD_TYPE MinSizeRel )
112
118
else ()
Original file line number Diff line number Diff line change 1
1
INCLUDE (ExternalProject )
2
2
3
3
SET (EIGEN_SOURCE_DIR ${THIRD_PARTY_PATH} /eigen3 )
4
-
5
- INCLUDE_DIRECTORIES (${EIGEN_SOURCE_DIR} /src/extern_eigen3 )
4
+ SET ( EIGEN_INCLUDE_DIR ${EIGEN_SOURCE_DIR} /src/extern_eigen3 )
5
+ INCLUDE_DIRECTORIES (${EIGEN_INCLUDE_DIR} )
6
6
7
7
ExternalProject_Add (
8
8
extern_eigen3
@@ -28,3 +28,9 @@ endif()
28
28
add_dependencies (eigen3 extern_eigen3 )
29
29
30
30
LIST (APPEND external_project_dependencies eigen3 )
31
+
32
+ IF (NOT WITH_C_API AND WITH_FLUID )
33
+ INSTALL (FILES ${EIGEN_INCLUDE_DIR} /Eigen/Core DESTINATION third_party/eigen3/Eigen )
34
+ INSTALL (DIRECTORY ${EIGEN_INCLUDE_DIR} /Eigen/src DESTINATION third_party/eigen3/Eigen )
35
+ INSTALL (DIRECTORY ${EIGEN_INCLUDE_DIR} /unsupported/Eigen DESTINATION third_party/eigen3/unsupported )
36
+ ENDIF ()
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ ADD_DEPENDENCIES(gflags extern_gflags)
52
52
53
53
LIST (APPEND external_project_dependencies gflags )
54
54
55
- IF (WITH_C_API )
55
+ IF (WITH_C_API OR WITH_FLUID )
56
56
INSTALL (DIRECTORY ${GFLAGS_INCLUDE_DIR} DESTINATION third_party/gflags )
57
57
IF (ANDROID )
58
58
INSTALL (FILES ${GFLAGS_LIBRARIES} DESTINATION third_party/gflags/lib/${ANDROID_ABI} )
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ LINK_LIBRARIES(glog gflags)
68
68
69
69
LIST (APPEND external_project_dependencies glog )
70
70
71
- IF (WITH_C_API )
71
+ IF (WITH_C_API OR WITH_FLUID )
72
72
INSTALL (DIRECTORY ${GLOG_INCLUDE_DIR} DESTINATION third_party/glog )
73
73
IF (ANDROID )
74
74
INSTALL (FILES ${GLOG_LIBRARIES} DESTINATION third_party/glog/lib/${ANDROID_ABI} )
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ IF(NOT PROTOBUF_FOUND)
250
250
SET (PROTOBUF_PROTOC_LIBRARY ${extern_protobuf_PROTOC_LIBRARY}
251
251
CACHE FILEPATH "protoc library." FORCE )
252
252
253
- IF (WITH_C_API )
253
+ IF (WITH_C_API OR WITH_FLUID )
254
254
INSTALL (DIRECTORY ${PROTOBUF_INCLUDE_DIR} DESTINATION third_party/protobuf )
255
255
IF (ANDROID )
256
256
INSTALL (FILES ${PROTOBUF_LITE_LIBRARY} DESTINATION third_party/protobuf/lib/${ANDROID_ABI} )
Original file line number Diff line number Diff line change @@ -88,3 +88,10 @@ cc_test(init_test SRCS init_test.cc DEPS init)
88
88
89
89
cc_test (op_kernel_type_test SRCS op_kernel_type_test.cc DEPS place device_context framework_proto )
90
90
cc_test (cow_ptr_tests SRCS details/cow_ptr_test.cc )
91
+
92
+ if (NOT WITH_C_API AND WITH_FLUID )
93
+ file (GLOB FRAMEWORK_HEADERS *.h )
94
+ install (FILES ${FRAMEWORK_HEADERS} DESTINATION include /paddle/framework )
95
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /framework.pb.h DESTINATION include /paddle/framework )
96
+ install (FILES details/cow_ptr.h details/op_registry.h DESTINATION include /paddle/framework/details )
97
+ endif ()
Original file line number Diff line number Diff line change 1
- set (FLUID_CORE_MODULES
2
- backward proto_desc paddle_memory executor prune init ${GLOB_OP_LIB} )
1
+ set (FLUID_CORE_MODULES proto_desc paddle_memory executor prune init )
3
2
4
3
cc_library (paddle_fluid_api
5
4
SRCS inference.cc
6
- DEPS ${FLUID_CORE_MODULES} )
5
+ DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB} )
7
6
8
- # Merge all modules into a simgle static library
9
- cc_library (paddle_fluid DEPS paddle_fluid_api ${FLUID_CORE_MODULES} )
7
+ # Merge all modules into a single static library
8
+ cc_library (paddle_fluid DEPS paddle_fluid_api ${FLUID_CORE_MODULES} ${GLOB_OP_LIB} )
9
+
10
+ # Create shared library
11
+ add_library (paddle_fluid_shared SHARED inference.cc )
12
+
13
+ target_circle_link_libraries (paddle_fluid_shared
14
+ ARCHIVE_START
15
+ ${GLOB_OP_LIB}
16
+ ARCHIVE_END
17
+ ${FLUID_CORE_MODULES} )
18
+
19
+ SET_TARGET_PROPERTIES (paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid )
20
+
21
+ # install library & headers
22
+ if (NOT WITH_C_API AND WITH_FLUID )
23
+ install (FILES inference.h DESTINATION include /paddle/inference )
24
+ install (TARGETS paddle_fluid_shared DESTINATION lib )
25
+ endif ()
10
26
11
27
add_executable (example example.cc )
12
28
if (APPLE )
Original file line number Diff line number Diff line change @@ -14,3 +14,10 @@ cc_library(paddle_memory
14
14
system_allocator )
15
15
16
16
cc_test (memory_test SRCS memory_test.cc DEPS place paddle_memory )
17
+
18
+ if (NOT WITH_C_API AND WITH_FLUID )
19
+ file (GLOB MEMORY_HEADERS *.h )
20
+ file (GLOB MEMORY_DETAIL_HEADERS detail/*.h )
21
+ install (FILES ${MEMORY_HEADERS} DESTINATION include /paddle/memory )
22
+ install (FILES ${MEMORY_DETAIL_HEADERS} DESTINATION include /paddle/memory/detail )
23
+ endif ()
Original file line number Diff line number Diff line change @@ -39,3 +39,11 @@ nv_test(nccl_test SRCS nccl_test.cu DEPS dynload_cuda gpu_info device_context)
39
39
40
40
cc_library (profiler SRCS profiler.cc DEPS device_context )
41
41
cc_test (profiler_test SRCS profiler_test.cc DEPS profiler )
42
+
43
+ if (NOT WITH_C_API AND WITH_FLUID )
44
+ file (GLOB PLATFORM_HEADERS *.h )
45
+ file (GLOB PLATFORM_dynload_HEADERS dynload/*.h )
46
+ install (FILES ${PLATFORM_HEADERS} DESTINATION include /paddle/platform )
47
+ install (FILES ${PLATFORM_HEADERS} DESTINATION include /paddle/platform/dynload )
48
+ install (FILES details/device_ptr_cast.h DESTINATION include /paddle/platform/details )
49
+ endif ()
Original file line number Diff line number Diff line change 1
1
cc_library (stringpiece SRCS piece.cc )
2
2
cc_test (stringpiece_test SRCS piece_test.cc DEPS stringpiece glog gflags )
3
-
4
3
cc_test (stringprintf_test SRCS printf_test.cc DEPS glog gflags )
5
4
cc_test (to_string_test SRCS to_string_test.cc )
5
+
6
+ if (NOT WITH_C_API AND WITH_FLUID )
7
+ file (GLOB STRING_HEADERS *.h )
8
+ install (FILES ${STRING_HEADERS} DESTINATION include /paddle/string )
9
+ install (FILES tinyformat/tinyformat.h DESTINATION include /paddle/string/tinyformat )
10
+ endif ()
You can’t perform that action at this time.
0 commit comments