ngraph compile fail
Created by: tensor-tang
how to reproduce
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=ON -DWITH_TESTING=ON -DWITH_FLUID_ONLY=ON -DWITH_DOC=OFF -DWITH_CONTRIB=OFF -DWITH_INFERENCE_API_TEST=ON -DON_INFER=ON -DWITH_MKLDNN=ON -DWITH_NGRAPH=ON
make -j
error
[ 99%] Linking CXX static library libpaddle_fluid.a
../../operators/ngraph/libngraph_engine.a(ngraph_engine.cc.o): In function `paddle::operators::NgraphEngine::BuildNgFunction()':
ngraph_engine.cc:(.text+0x43d4): undefined reference to `ngraph::Function::Function(ngraph::NodeVector const&, ngraph::ParameterVector const&, std::string const&)'
../../operators/ngraph/libngraph_engine.a(ngraph_engine.cc.o): In function `_GLOBAL__sub_I_ngraph_engine.cc':
ngraph_engine.cc:(.text.startup+0x268): undefined reference to `ngraph::runtime::Backend::create(std::string const&)'
../../operators/ngraph/libngraph_bridge.a(ngraph_bridge.cc.o): In function `ngraph::op::Constant::Constant<float>(ngraph::element::Type const&, ngraph::Shape, std::vector<float, std::allocator<float> > const&)':
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x99): undefined reference to `ngraph::Node::Node(std::string const&, ngraph::NodeVector const&, unsigned long)'
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x674): undefined reference to `ngraph::node_validation_assertion_string(ngraph::Node const*)'
../../operators/ngraph/libngraph_bridge.a(ngraph_bridge.cc.o): In function `ngraph::op::Constant::Constant<int>(ngraph::element::Type const&, ngraph::Shape, std::vector<int, std::allocator<int> > const&)':
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x99): undefined reference to `ngraph::Node::Node(std::string const&, ngraph::NodeVector const&, unsigned long)'
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x674): undefined reference to `ngraph::node_validation_assertion_string(ngraph::Node const*)'
collect2: error: ld returned 1 exit status
paddle/fluid/inference/analysis/CMakeFiles/test_analyzer.dir/build.make:513: recipe for target 'paddle/fluid/inference/analysis/test_analyzer' failed
make[2]: *** [paddle/fluid/inference/analysis/test_analyzer] Error 1
[ 98%] Linking CXX executable test_analyzer
../../operators/ngraph/libngraph_engine.a(ngraph_engine.cc.o): In function `paddle::operators::NgraphEngine::BuildNgFunction()':
ngraph_engine.cc:(.text+0x43d4): undefined reference to `ngraph::Function::Function(ngraph::NodeVector const&, ngraph::ParameterVector const&, std::string const&)'
../../operators/ngraph/libngraph_engine.a(ngraph_engine.cc.o): In function `_GLOBAL__sub_I_ngraph_engine.cc':
ngraph_engine.cc:(.text.startup+0x268): undefined reference to `ngraph::runtime::Backend::create(std::string const&)'
../../operators/ngraph/libngraph_bridge.a(ngraph_bridge.cc.o): In function `ngraph::op::Constant::Constant<float>(ngraph::element::Type const&, ngraph::Shape, std::vector<float, std::allocator<float> > const&)':
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x99): undefined reference to `ngraph::Node::Node(std::string const&, ngraph::NodeVector const&, unsigned long)'
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IfEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x674): undefined reference to `ngraph::node_validation_assertion_string(ngraph::Node const*)'
../../operators/ngraph/libngraph_bridge.a(ngraph_bridge.cc.o): In function `ngraph::op::Constant::Constant<int>(ngraph::element::Type const&, ngraph::Shape, std::vector<int, std::allocator<int> > const&)':
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x99): undefined reference to `ngraph::Node::Node(std::string const&, ngraph::NodeVector const&, unsigned long)'
ngraph_bridge.cc:(.text._ZN6ngraph2op8ConstantC2IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE[_ZN6ngraph2op8ConstantC5IiEERKNS_7element4TypeENS_5ShapeERKSt6vectorIT_SaIS9_EE]+0x674): undefined reference to `ngraph::node_validation_assertion_string(ngraph::Node const*)'
collect2: error: ld returned 1 exit status
paddle/fluid/inference/analysis/CMakeFiles/test_analyzer.dir/build.make:513: recipe for target 'paddle/fluid/inference/analysis/test_analyzer' failed
make[2]: *** [paddle/fluid/inference/analysis/test_analyzer] Error 1
CMakeFiles/Makefile2:58274: recipe for target 'paddle/fluid/inference/analysis/CMakeFiles/test_analyzer.dir/all' failed
make[1]: *** [paddle/fluid/inference/analysis/CMakeFiles/test_analyzer.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
@baojun-nervana @mozga-intel could please help to fix this.