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

combine batch_size_like.cc into batch_size_like.h #8602

Closed
luotao1 opened this issue Feb 27, 2018 · 0 comments · Fixed by #8604
Closed

combine batch_size_like.cc into batch_size_like.h #8602

luotao1 opened this issue Feb 27, 2018 · 0 comments · Fixed by #8604
Labels
预测 原名Inference,包含Capi预测问题等

Comments

@luotao1
Copy link
Contributor

luotao1 commented Feb 27, 2018

If we build batch_size_like independently, it is not in GLOB_OP_LIB.

cc_library(batch_size_like SRCS batch_size_like.cc DEPS op_registry)
op_library(fill_constant_batch_size_like_op DEPS batch_size_like)
op_library(uniform_random_batch_size_like_op DEPS batch_size_like uniform_random_op)
op_library(gaussian_random_batch_size_like_op DEPS batch_size_like gaussian_random_op)

set(GLOB_OP_LIB ${OP_LIBRARY} CACHE INTERNAL "Global OP library")

where GLOB_OP_LIB is used to create fluid static library.

# Create static library
cc_library(paddle_fluid DEPS paddle_fluid_api ${FLUID_CORE_MODULES} ${GLOB_OP_LIB})

If we use this fluid static library in an independent example (see #7827 and https://github.com/luotao1/fluid_inference_example), the building error is

/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(fill_constant_batch_size_like_op.cc.o): In function `paddle::operators::FillConstantBatchSizeLikeOpMaker::FillConstantBatchSizeLikeOpMaker(paddle::framework::proto::OpProto*, paddle::framework::OpAttrChecker*)':
fill_constant_batch_size_like_op.cc:(.text._ZN6paddle9operators32FillConstantBatchSizeLikeOpMakerC2EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE[_ZN6paddle9operators32FillConstantBatchSizeLikeOpMakerC5EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE]+0x1c): undefined reference to `paddle::operators::BatchSizeLikeOpMaker::BatchSizeLikeOpMaker(paddle::framework::proto::OpProto*, paddle::framework::OpAttrChecker*)'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(fill_constant_batch_size_like_op.cc.o):(.data.rel.ro._ZTIN6paddle9operators27FillConstantBatchSizeLikeOpE[_ZTIN6paddle9operators27FillConstantBatchSizeLikeOpE]+0x10): undefined reference to `typeinfo for paddle::operators::BatchSizeLikeOp'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(fill_constant_batch_size_like_op.cc.o):(.data.rel.ro._ZTVN6paddle9operators27FillConstantBatchSizeLikeOpE[_ZTVN6paddle9operators27FillConstantBatchSizeLikeOpE]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(fill_constant_batch_size_like_op.cc.o):(.data.rel.ro._ZTV39_OpClass_fill_constant_batch_size_like_[_ZTV39_OpClass_fill_constant_batch_size_like_]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'
gaussian_random_batch_size_like_op.cc:(.text._ZN6paddle9operators34GaussianRandomBatchSizeLikeOpMakerC2EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE[_ZN6paddle9operators34GaussianRandomBatchSizeLikeOpMakerC5EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE]+0x1c): undefined reference to `paddle::operators::BatchSizeLikeOpMaker::BatchSizeLikeOpMaker(paddle::framework::proto::OpProto*, paddle::framework::OpAttrChecker*)'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(gaussian_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTIN6paddle9operators29GaussianRandomBatchSizeLikeOpE[_ZTIN6paddle9operators29GaussianRandomBatchSizeLikeOpE]+0x10): undefined reference to `typeinfo for paddle::operators::BatchSizeLikeOp'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(gaussian_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTVN6paddle9operators29GaussianRandomBatchSizeLikeOpE[_ZTVN6paddle9operators29GaussianRandomBatchSizeLikeOpE]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(gaussian_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTV41_OpClass_gaussian_random_batch_size_like_[_ZTV41_OpClass_gaussian_random_batch_size_like_]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(uniform_random_batch_size_like_op.cc.o): In function `paddle::operators::UniformRandomBatchSizeLikeOpMaker::UniformRandomBatchSizeLikeOpMaker(paddle::framework::proto::OpProto*, paddle::framework::OpAttrChecker*)':
uniform_random_batch_size_like_op.cc:(.text._ZN6paddle9operators33UniformRandomBatchSizeLikeOpMakerC2EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE[_ZN6paddle9operators33UniformRandomBatchSizeLikeOpMakerC5EPNS_9framework5proto7OpProtoEPNS2_13OpAttrCheckerE]+0x1c): undefined reference to `paddle::operators::BatchSizeLikeOpMaker::BatchSizeLikeOpMaker(paddle::framework::proto::OpProto*, paddle::framework::OpAttrChecker*)'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(uniform_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTIN6paddle9operators28UniformRandomBatchSizeLikeOpE[_ZTIN6paddle9operators28UniformRandomBatchSizeLikeOpE]+0x10): undefined reference to `typeinfo for paddle::operators::BatchSizeLikeOp'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(uniform_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTVN6paddle9operators28UniformRandomBatchSizeLikeOpE[_ZTVN6paddle9operators28UniformRandomBatchSizeLikeOpE]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'
/home/luotao02/PaddleRoot/paddle/fluid/inference/libpaddle_fluid.a(uniform_random_batch_size_like_op.cc.o):(.data.rel.ro._ZTV40_OpClass_uniform_random_batch_size_like_[_ZTV40_OpClass_uniform_random_batch_size_like_]+0x58): undefined reference to `paddle::operators::BatchSizeLikeOp::InferShape(paddle::framework::InferShapeContext*) const'

Thus, we could combine batch_size_like.cc into batch_size_like.h, and remove cc_library(batch_size_like SRCS batch_size_like.cc DEPS op_registry) in operator/CMakelists.txt.

@luotao1 luotao1 added the 预测 原名Inference,包含Capi预测问题等 label Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
预测 原名Inference,包含Capi预测问题等
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant