BCLOUD 6.9 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 -O3 -pipe -fopenmp '
X
xiexionghang 已提交
5 6 7
CFLAGS(GLOBAL_CFLAGS_STR)
GLOBAL_CXXFLAGS_STR = GLOBAL_CFLAGS_STR + ' -std=c++11 '
CXXFLAGS(GLOBAL_CXXFLAGS_STR)
X
xiexionghang 已提交
8 9 10 11 12
INCPATHS('./')
INCPATHS('$OUT/../')
INCPATHS('../../third-party')
INCPATHS('../../third-party/eigen')
INCPATHS('$OUT_ROOT/baidu/third-party/python/output/include/python2.7')
X
xiexionghang 已提交
13
LDFLAGS('-lpthread -lcrypto -lrt -ldl -lssl -lz -lgomp -fopenmp ')
X
xiexionghang 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
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 已提交
36
CONFIGS('baidu/third-party/yaml-cpp@yaml-cpp_0-6-2-0_GEN_PD_BL@git_tag')
X
xiexionghang 已提交
37
CONFIGS('baidu/third-party/openmpi@openmpi_1-4-5-0-feed_mlarch@git_branch')
X
xiexionghang 已提交
38
CONFIGS('baidu/paddlepaddle/pslib@expt-feed-trainer@git_branch')
R
execute  
rensilin 已提交
39
CONFIGS('third-64/gtest@base')
X
xiexionghang 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
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 已提交
61 62
#proto
StaticLibrary("fake_paddle_proto", Sources(GLOB("paddle/fluid/framework/*.proto"), GLOB("paddle/fluid/platform/*.proto")))
X
xiexionghang 已提交
63 64 65
#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 已提交
66 67
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 已提交
68 69 70
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 已提交
71
HEADERS('paddle/fluid/train/custom_trainer/feed/accessor/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/accessor/')
R
rensilin 已提交
72
HEADERS('paddle/fluid/train/custom_trainer/feed/io/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/io/')
X
xiexionghang 已提交
73
NEED_OUTPUT("baidu/third-party/mklml")
X
xiexionghang 已提交
74
NEED_OUTPUT("baidu/third-party/openmpi")
X
xiexionghang 已提交
75 76
OUTPUT('paddle/fluid/train/custom_trainer/feed/conf', '$OUT')
OUTPUT('paddle/fluid/train/custom_trainer/feed/scripts', '$OUT')
R
execute  
rensilin 已提交
77

X
xiexionghang 已提交
78

R
execute  
rensilin 已提交
79 80
def UT_FILE(filename):
    UT_DIR = 'paddle/fluid/train/custom_trainer/feed/unit_test'
R
rensilin 已提交
81
    import os
R
execute  
rensilin 已提交
82 83
    return os.path.join(UT_DIR, filename)
custom_trainer_src = GLOB('paddle/fluid/train/custom_trainer/feed/*/*.cc', Exclude(UT_FILE('*')))
R
rensilin 已提交
84
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 已提交
85

X
xiexionghang 已提交
86
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 -Wno-narrowing -Wnarrowing -fopenmp -mavx -O3 -DNDEBUG '
R
rensilin 已提交
87
CXXFLAGS_STR = '-std=c++11 ' + CFLAGS_STR
R
execute  
rensilin 已提交
88

R
rensilin 已提交
89
SharedLibrary("paddle_fluid_avx_mklml", PreBuilt(True))
X
xiexionghang 已提交
90

R
rensilin 已提交
91 92 93 94 95 96 97 98
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 已提交
99
StaticLibrary("feed_trainer", Sources(custom_trainer_src), *application_args)
R
rensilin 已提交
100

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

R
rensilin 已提交
103
#feed unit test
R
rensilin 已提交
104 105

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