goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
216 stars 15 forks source link

llgo run get error : can't open output file on macOS #361

Closed 2458zhanghehe closed 1 week ago

2458zhanghehe commented 2 weeks ago

When use llgo run . running demos in llgo/_demo or llgo/_pydemo get error Error Info:

ld: can't open output file for writing '/usr/local/go/bin/concat.ld_1Ot1II', errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

go version : 1.21.4 macOS : 13.6.7

go Env:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/zhangyifan/Library/Caches/go-build'
GOENV='/Users/zhangyifan/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/zhangyifan/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/zhangyifan/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/nc/j_4dvjq50w37k5l3tmsm8jn80000gn/T/go-build1065555309=/tmp/go-build -gno-record-gcc-switches -fno-common'

Environment variables:

xport PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/zhangyifan/go/bin"
export LLGOROOT="/Users/zhangyifan/Documents/llgo"
export LLGO_LIB_PYTHON="/opt/anaconda3/lib/python3.11"
export DYLD_LIBRARY_PATH="/opt/anaconda3/lib"
export GOROOT=/usr/local/go
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:$GOROOT/bin
#export GOPATH=$HOME/go
aofei commented 2 weeks ago

Wait until #362 is merged, or set GOBIN yourself by running export GOBIN=$HOME/go/bin.

2458zhanghehe commented 1 week ago

Wait until #362 is merged, or set GOBIN yourself by running export GOBIN=$HOME/go/bin.

the error was solved after merge