BCLOUD 6.5 KB
Newer Older
G
init  
gerrit 已提交
1 2
WORKROOT('../../../')
COMPILER('gcc482')
X
xiexionghang 已提交
3 4 5 6 7
CPPFLAGS('-D_GNU_SOURCE -DNDEBUG')
GLOBAL_CFLAGS_STR = '-g -O3 -pipe '
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')
R
rensilin 已提交
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')
R
execute  
rensilin 已提交
38
CONFIGS('third-64/gtest@base')
X
xiexionghang 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

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 已提交
63 64
#proto
StaticLibrary("fake_paddle_proto", Sources(GLOB("paddle/fluid/framework/*.proto"), GLOB("paddle/fluid/platform/*.proto")))
X
xiexionghang 已提交
65

X
xiexionghang 已提交
66 67 68
#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 已提交
69 70
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 已提交
71 72 73
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 已提交
74
HEADERS('paddle/fluid/train/custom_trainer/feed/accessor/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/accessor/')
R
rensilin 已提交
75
HEADERS('paddle/fluid/train/custom_trainer/feed/io/*.h', '$INC/paddle/fluid/train/custom_trainer/feed/io/')
X
xiexionghang 已提交
76 77 78
NEED_OUTPUT("baidu/third-party/mklml")
OUTPUT('paddle/fluid/train/custom_trainer/feed/conf', '$OUT')
OUTPUT('paddle/fluid/train/custom_trainer/feed/scripts', '$OUT')
R
rensilin 已提交
79
OUTPUT('paddle/fluid/train/custom_trainer/feed/so', '$OUT')
R
execute  
rensilin 已提交
80 81 82

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

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

R
rensilin 已提交
88
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 已提交
89

R
rensilin 已提交
90
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 -O3 -DNDEBUG '
R
rensilin 已提交
91
CXXFLAGS_STR = '-std=c++11 ' + CFLAGS_STR
R
execute  
rensilin 已提交
92

R
rensilin 已提交
93
Application('feed_trainer', Sources('paddle/fluid/train/custom_trainer/feed/main.cc', custom_trainer_src), CppFlags(CPPFLAGS_STR), CFlags(CFLAGS_STR), CxxFlags(CXXFLAGS_STR), Libs(src_libs=['paddle/fluid/train/custom_trainer/feed/so/libpaddle_fluid_avx_mklml.so']))
X
xiexionghang 已提交
94 95


R
rensilin 已提交
96 97
#feed unit test
UT_MAIN = UT_FILE('main.cc')
R
rensilin 已提交
98
UTApplication('unit_test', Sources(UT_MAIN, GLOB(UT_FILE('test_*.cc')), custom_trainer_src), CppFlags(CPPFLAGS_STR), CFlags(CFLAGS_STR), CxxFlags(CXXFLAGS_STR), Libs(src_libs=['paddle/fluid/train/custom_trainer/feed/so/libpaddle_fluid_avx_mklml.so']))