BCLOUD 6.8 KB
Newer Older
G
init  
gerrit 已提交
1 2
WORKROOT('../../../')
COMPILER('gcc482')
X
xiexionghang 已提交
3
CPPFLAGS('-D_GNU_SOURCE -DNDEBUG')
X
xiexionghang 已提交
4
GLOBAL_CFLAGS_STR = '-g -O0 -pipe -fopenmp '
X
xiexionghang 已提交
5 6 7
CFLAGS(GLOBAL_CFLAGS_STR)
GLOBAL_CXXFLAGS_STR = GLOBAL_CFLAGS_STR + ' -std=c++11 '
CXXFLAGS(GLOBAL_CXXFLAGS_STR)
G
init  
gerrit 已提交
8

X
xiexionghang 已提交
9 10 11 12 13
INCPATHS('./')
INCPATHS('$OUT/../')
INCPATHS('../../third-party')
INCPATHS('../../third-party/eigen')
INCPATHS('$OUT_ROOT/baidu/third-party/python/output/include/python2.7')
X
xiexionghang 已提交
14
LDFLAGS('-lpthread -lcrypto -lrt -ldl -lssl -lz -lgomp -fopenmp ')
X
xiexionghang 已提交
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
CONFIGS('baidu/third-party/any@15595d8324be9e8a9a80d9ae442fdd12bd66df5d@git_branch')
CONFIGS('baidu/third-party/boost@v1.41.0@git_branch')
CONFIGS('baidu/third-party/c-ares@v1.13.0@git_branch')
CONFIGS('baidu/third-party/eigen@917060c364181f33a735dc023818d5a54f60e54c@git_branch')
CONFIGS('baidu/third-party/gflags@77592648e3f3be87d6c7123eb81cbad75f9aef5a@git_branch')
CONFIGS('baidu/third-party/glog@v0.3.5@git_branch')
CONFIGS('baidu/third-party/leveldb@v1.18@git_branch')
CONFIGS('baidu/third-party/OpenBLAS@v0.2.20@git_branch')
CONFIGS('baidu/third-party/protobuf@9f75c5aa851cd877fb0d93ccc31b8567a6706546@git_branch')
CONFIGS('baidu/third-party/snappy@v1.1.7@git_branch')
CONFIGS('baidu/third-party/snappy_stream@0.2.8@git_branch')
CONFIGS('baidu/third-party/threadpool@9a42ec1329f259a5f4881a291db1dcb8f2ad9040@git_branch')
CONFIGS('baidu/third-party/warpctc@warp_ctc_head@git_branch')
CONFIGS('baidu/third-party/zlib@v1.2.8@git_branch')
# CONFIGS('baidu/third-party/brpc@7dc04defad1fd4173aae170c3fcbde131b65155a@git_branch')
CONFIGS('baidu/third-party/mklml@v20180406@git_branch')
CONFIGS('baidu/third-party/xbyak@v5.661@git_branch')
CONFIGS('baidu/third-party/xxhash@v0.6.5@git_branch')
CONFIGS('baidu/third-party/dlpack@v0.2@git_branch')
CONFIGS('baidu/third-party/gzstream@master@git_branch')
CONFIGS('baidu/third-party/pybind11@v2.2.4@git_branch')
CONFIGS('baidu/third-party/python@gcc482output@git_branch')
X
xiexionghang 已提交
37
CONFIGS('baidu/third-party/yaml-cpp@yaml-cpp_0-6-2-0_GEN_PD_BL@git_tag')
X
xiexionghang 已提交
38
CONFIGS('baidu/third-party/openmpi@openmpi_1-4-5-0-feed_mlarch@git_branch')
X
xiexionghang 已提交
39
CONFIGS('baidu/paddlepaddle/pslib@master@git_branch')
R
execute  
rensilin 已提交
40
CONFIGS('third-64/gtest@base')
X
xiexionghang 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

HEADERS('paddle/fluid/memory/*.h', '$INC/paddle/fluid/memory/')
HEADERS('paddle/fluid/memory/detail/*.h', '$INC/paddle/fluid/memory/detail/')
HEADERS('paddle/fluid/memory/allocation/*.h', '$INC/paddle/fluid/memory/allocation/')
HEADERS('paddle/fluid/inference/*.h', '$INC/paddle/fluid/inference/')
HEADERS('paddle/fluid/platform/*.h', '$INC/paddle/fluid/platform/')
HEADERS('paddle/fluid/platform/dynload/*.h', '$INC/paddle/fluid/platform/dynload/')
HEADERS('paddle/fluid/platform/details/*.h', '$INC/paddle/fluid/platform/details/')
HEADERS('paddle/fluid/string/*.h', '$INC/paddle/fluid/string/')
HEADERS('paddle/fluid/string/tinyformat/*.h', '$INC/paddle/fluid/string/tinyformat/')
HEADERS('paddle/fluid/framework/*.h', '$INC/paddle/fluid/framework/')
HEADERS('paddle/fluid/framework/details/*.h', '$INC/paddle/fluid/framework/details/')
HEADERS('paddle/fluid/framework/ir/memory_optimize_pass/*.h', '$INC/paddle/fluid/framework/ir/memory_optimize_pass/')
HEADERS('paddle/fluid/framework/ir/*.h', '$INC/paddle/fluid/framework/ir/')
HEADERS('paddle/fluid/framework/fleet/*.h', '$INC/paddle/fluid/framework/fleet/')
HEADERS('paddle/fluid/inference/*.h', '$INC/paddle/fluid/inference/')
HEADERS('paddle/fluid/inference/api/*.h', '$INC/paddle/fluid/inference/api/')
HEADERS('paddle/fluid/pybind/pybind.h', '$INC/paddle/fluid/pybind')
HEADERS('paddle/fluid/inference/api/*.h', '$INC/paddle/fluid/inference/api/')
HEADERS(GLOB_GEN_SRCS('paddle/fluid/framework/*pb.h'), '$INC/paddle/fluid/framework')
HEADERS(GLOB_GEN_SRCS('paddle/fluid/platform/*pb.h'), '$INC/paddle/fluid/platform')

PROTOC('../../third-party/protobuf/bin/protoc')

R
rensilin 已提交
65 66
#proto
StaticLibrary("fake_paddle_proto", Sources(GLOB("paddle/fluid/framework/*.proto"), GLOB("paddle/fluid/platform/*.proto")))
X
xiexionghang 已提交
67

X
xiexionghang 已提交
68 69 70
#feed
HEADERS('paddle/fluid/train/custom_trainer/feed/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/')
HEADERS('paddle/fluid/train/custom_trainer/feed/common/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/common/')
X
xiexionghang 已提交
71 72
HEADERS('paddle/fluid/train/custom_trainer/feed/executor/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/executor/')
HEADERS('paddle/fluid/train/custom_trainer/feed/monitor/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/monitor/')
X
xiexionghang 已提交
73 74 75
HEADERS('paddle/fluid/train/custom_trainer/feed/dataset/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/dataset/')
HEADERS('paddle/fluid/train/custom_trainer/feed/process/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/process/')
HEADERS('paddle/fluid/train/custom_trainer/feed/shuffler/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/shuffler/')
X
xiexionghang 已提交
76
HEADERS('paddle/fluid/train/custom_trainer/feed/accessor/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/accessor/')
R
rensilin 已提交
77
HEADERS('paddle/fluid/train/custom_trainer/feed/io/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/io/')
X
xiexionghang 已提交
78
NEED_OUTPUT("baidu/third-party/mklml")
X
xiexionghang 已提交
79
NEED_OUTPUT("baidu/third-party/openmpi")
X
xiexionghang 已提交
80 81
OUTPUT('paddle/fluid/train/custom_trainer/feed/conf', '$OUT')
OUTPUT('paddle/fluid/train/custom_trainer/feed/scripts', '$OUT')
R
execute  
rensilin 已提交
82 83 84

def UT_FILE(filename):
    UT_DIR = 'paddle/fluid/train/custom_trainer/feed/unit_test'
R
rensilin 已提交
85
    import os
R
execute  
rensilin 已提交
86 87 88 89
    return os.path.join(UT_DIR, filename)

custom_trainer_src = GLOB('paddle/fluid/train/custom_trainer/feed/*/*.cc', Exclude(UT_FILE('*')))

R
rensilin 已提交
90
CPPFLAGS_STR = '-DHPPL_STUB_FUNC -DLAPACK_FOUND -DPADDLE_DISABLE_PROFILER -DPADDLE_NO_PYTHON -DCUSTOM_TRAINER -DPADDLE_ON_INFERENCE -DPADDLE_USE_DSO -DPADDLE_USE_PTHREAD_BARRIER -DPADDLE_USE_PTHREAD_SPINLOCK -DPADDLE_VERSION=0.0.0 -DPADDLE_WITH_AVX -DPADDLE_WITH_MKLML -DPADDLE_WITH_XBYAK -DXBYAK64 -DXBYAK_NO_OP_NAMES -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -DPYBIND_AVX_MKLML' + r" -DPADDLE_REVISION=\"%s@%s@%s\"" % (REPO_URL(), REPO_BRANCH(), REPO_REVISION())
R
execute  
rensilin 已提交
91

X
xiexionghang 已提交
92
CFLAGS_STR = '-m64 -fPIC -fno-omit-frame-pointer -Werror -Wall -Wextra -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wno-unused-parameter -Wno-unused-function -Wno-error=literal-suffix -Wno-error=sign-compare -Wno-error=unused-local-typedefs -Wno-error=maybe-uninitialized -fopenmp -mavx -O0 -DNDEBUG '
R
rensilin 已提交
93
CXXFLAGS_STR = '-std=c++11 ' + CFLAGS_STR
R
execute  
rensilin 已提交
94

R
rensilin 已提交
95
SharedLibrary("paddle_fluid_avx_mklml", PreBuilt(True))
X
xiexionghang 已提交
96

R
rensilin 已提交
97 98 99 100 101 102 103 104
application_args = [
    CppFlags(CPPFLAGS_STR),
    CFlags(CFLAGS_STR),
    CxxFlags(CXXFLAGS_STR),
    Libs(libs=['libpaddle_fluid_avx_mklml.so']),
    Libs(module='baidu/third-party/openmpi', libs=['libmpi.so', 'libmpi_cxx.so', 'libopen-pal.so', 'libopen-rte.so']),
]

R
rensilin 已提交
105
StaticLibrary("feed_trainer", Sources(custom_trainer_src), *application_args)
R
rensilin 已提交
106

R
rensilin 已提交
107
Application('feed_trainer', Sources('paddle/fluid/train/custom_trainer/feed/main.cc'), WholeArchives("$OUT/lib/libfeed_trainer.a"), *application_args)
X
xiexionghang 已提交
108

R
rensilin 已提交
109
#feed unit test
R
rensilin 已提交
110 111

# bug: shared librarys can not be found when run on server
R
rensilin 已提交
112
UTApplication('unit_test', UTOnServer(False), Sources(UT_FILE('main.cc'), GLOB(UT_FILE('test_*.cc'))), WholeArchives("$OUT/lib/libfeed_trainer.a"), *application_args)