doukezi4606 2013-01-09 11:28
浏览 41
已采纳

如何构建thrift4go?

I'm new in GO. I have decide to use implementation of Thrift for Go. After reading manual installation instruction steps I have downloaded last Thrift 0.9.0 from git and start building process:

My build script is follow:

#!/bin/bash
export THRIFT=$(pwd)/thrift
export THRIFT4GO=$(pwd)/thrift4go
export GOROOT=/usr

bash $THRIFT4GO/scripts/merge_and_build.sh -b

cd $THRIFT
#./cleanup.sh
./bootstrap.sh
./configure --with-go --without-python --without-csharp

make
if "$?" == "1"; then
    ln -s $THRIFT/lib/go/src/thrift $GOPATH/src/thrift
    go install thrift
fi

But make doesn't work well for GO, whereis the problem ? I have correct installed GO with exported GOPATH variable in bash, "go install" worked for other projects. I can't understand why GO can't find package.

Making all in go
make[3]: Entering directory `/home/user/projects/delkon/thrift/lib/go'
make  check-local
make[4]: Entering directory `/home/user/projects/delkon/thrift/lib/go'
go build -v -x thrift
WORK=/tmp/go-build548238117
src/thrift/tiostream_transport.go:23:2: import "bufio": cannot find package
src/thrift/tframed_transport.go:23:2: import "bytes": cannot find package
src/thrift/tmap.go:24:2: import "container/list": cannot find package
src/thrift/tjson_protocol.go:23:2: import "encoding/base64": cannot find package
src/thrift/tbinary_protocol.go:23:2: import "encoding/binary": cannot find package
src/thrift/tsimple_json_protocol.go:26:2: import "encoding/json": cannot find package
src/thrift/tapplication_exception.go:23:2: import "errors": cannot find package
src/thrift/tcompact_protocol.go:24:2: import "fmt": cannot find package
src/thrift/tbinary_protocol.go:24:2: import "io": cannot find package
src/thrift/ttransport.go:23:2: import "log": cannot find package
src/thrift/tbinary_protocol.go:25:2: import "math": cannot find package
src/thrift/tnonblocking_server_socket.go:23:2: import "net": cannot find package
src/thrift/thttp_client.go:24:2: import "net/http": cannot find package
src/thrift/thttp_client.go:25:2: import "net/url": cannot find package
src/thrift/ttransport.go:24:2: import "os": cannot find package
src/thrift/tmap.go:25:2: import "reflect": cannot find package
package thrift
imports runtime: import "runtime": cannot find package
src/thrift/tfield.go:23:2: import "sort": cannot find package
src/thrift/thttp_client.go:26:2: import "strconv": cannot find package
src/thrift/tbinary_protocol.go:26:2: import "strings": cannot find package
src/thrift/tnonblocking_socket.go:24:2: import "time": cannot find package
make[4]: *** [check-local] Error 1
make[4]: Leaving directory `/home/user/projects/delkon/thrift/lib/go'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/user/projects/delkon/thrift/lib/go'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/user/projects/delkon/thrift/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/projects/delkon/thrift'
make: *** [all] Error 2

Thank you for any input p.s Arch linux (X86, 64)

upd The problem was when thrift cloned from GIT, use https://dist.apache.org/repos/dist/release/thrift/0.9.0/thrift-0.9.0.tar.gz version instead

  • 写回答

1条回答 默认 最新

  • duanboxue3422 2013-01-09 11:58
    关注

    I tried to follow exactly all of the Manual Installation steps with no problems whatsoever.

    (12:49) jnml@fsc-r550:~$ go version
    go version go1.0.3
    (12:49) jnml@fsc-r550:~$ go env
    GOARCH="amd64"
    GOBIN="/home/jnml/bin"
    GOCHAR="6"
    GOEXE=""
    GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/jnml"
    GOROOT="/home/jnml/go"
    GOTOOLDIR="/home/jnml/go/pkg/tool/linux_amd64"
    CGO_ENABLED="1"
    (12:49) jnml@fsc-r550:~$ 
    

    Note: I have cloned the thrift4go repository into $GOPATH/src/github.com/pomack/thrift4go. This is not mentioned in the README.md.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line