From 2712df42a3738b207d06cb2f1e27026aca5af169 Mon Sep 17 00:00:00 2001 From: Qi Li Date: Fri, 4 Dec 2020 14:37:51 +0800 Subject: [PATCH] fix go demo, test=develop (#29107) --- go/README_cn.md | 3 ++- go/paddle/common.go | 4 ++-- go/paddle/config.go | 4 ++-- go/paddle/predictor.go | 4 ++-- go/paddle/tensor.go | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go/README_cn.md b/go/README_cn.md index 8ffc31adf8..a184ecbb8d 100644 --- a/go/README_cn.md +++ b/go/README_cn.md @@ -49,6 +49,7 @@ output_data := value.Interface().([][]float32) 下载[数据](https://paddle-inference-dist.cdn.bcebos.com/mobilenet-test-model-data.tar.gz)并解压到当前目录 运行 -``` go +```bash +export LD_LIBRARY_PATH=`pwd`/paddle_c/paddle/lib:$LD_LIBRARY_PATH go run ./demo/mobilenet.go ``` diff --git a/go/paddle/common.go b/go/paddle/common.go index b29efbdf30..4bf9476593 100644 --- a/go/paddle/common.go +++ b/go/paddle/common.go @@ -14,8 +14,8 @@ package paddle -// #cgo CFLAGS: -Ipaddle_c/paddle/include -// #cgo LDFLAGS: -Lpaddle_c/paddle/lib -lpaddle_fluid_c +// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include +// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c // #include // #include import "C" diff --git a/go/paddle/config.go b/go/paddle/config.go index c4f39fa9c5..dcdb64008b 100644 --- a/go/paddle/config.go +++ b/go/paddle/config.go @@ -14,8 +14,8 @@ package paddle -// #cgo CFLAGS: -Ipaddle_c/paddle/include -// #cgo LDFLAGS: -Lpaddle_c/paddle/lib -lpaddle_fluid_c +// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include +// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c // #include // #include // #include diff --git a/go/paddle/predictor.go b/go/paddle/predictor.go index 2bae7854c3..59bad908e6 100644 --- a/go/paddle/predictor.go +++ b/go/paddle/predictor.go @@ -14,8 +14,8 @@ package paddle -// #cgo CFLAGS: -Ipaddle_c/paddle/include -// #cgo LDFLAGS: -Lpaddle_c/paddle/lib -lpaddle_fluid_c +// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include +// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c // #include // #include "paddle_c_api.h" import "C" diff --git a/go/paddle/tensor.go b/go/paddle/tensor.go index 4da99ea840..e6e2c53fef 100644 --- a/go/paddle/tensor.go +++ b/go/paddle/tensor.go @@ -14,8 +14,8 @@ package paddle -// #cgo CFLAGS: -Ipaddle_c/paddle/include -// #cgo LDFLAGS: -Lpaddle_c/paddle/lib -lpaddle_fluid_c +// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include +// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c // #include // #include // #include -- GitLab