Comments (3)
补充:
- 在ubuntu20下编译win64的exe,可以编译,并且可以运行成功, 编译命令:GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -v -x -buildmode=exe -o xxx xxx.go
- 用楼上的命令编译linux64, 不通过,于是我增加编译参数
- GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -v -x -o xxx xxx.go
- 编译输出
WORK=/tmp/go-build653870338
github.com/ying32/govcl/vcl/api
mkdir -p $WORK/b037/
cat >$WORK/b037/importcfg << 'EOF' # internal
# import config
packagefile github.com/ying32/dylib=/home/yang/.cache/go-build/b7/b765481a4c95f077201b997b82d82472a169842ddf67e55b9257ff387a185108-d
packagefile github.com/ying32/govcl/pkgs/libname=/home/yang/.cache/go-build/26/26c294efb18c15f1efd57fd13843b7b0cd6f5631724f9787f882aaa3e186d1ec-d
packagefile github.com/ying32/govcl/vcl/types=/home/yang/.cache/go-build/9e/9e94d0688a6f0c41617d7eaea5fd014e8e10b3408be5f5830224fff1710e368c-d
packagefile reflect=/usr/local/go/pkg/linux_amd64/reflect.a
packagefile runtime=/usr/local/go/pkg/linux_amd64/runtime.a
packagefile sync=/usr/local/go/pkg/linux_amd64/sync.a
packagefile time=/usr/local/go/pkg/linux_amd64/time.a
EOF
cd /data/app/gotest
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b037/_pkg_.a -trimpath "$WORK/b037=>" -p github.com/ying32/govcl/vcl/api -complete -buildid qrUzE9XsnTP64sUOLzE9/qrUzE9XsnTP64sUOLzE9 -goversion go1.16.5 -D "" -importcfg $WORK/b037/importcfg -pack -c=4 /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/applicationdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/applicationformresdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/bitmapdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/canvasdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/clipboarddef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/dfuncs.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/dylib.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/dylib_nonmemory.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/dylib_nontempdll.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/finalizerOff.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/formdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/imagelistdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/importAuto.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/importFuncsAuto.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/importdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/importdef_linux.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/intf_posix.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/memorystreamdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/mousedef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/printerdef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/screendef.go /data/app/go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/stdstr.go
go build github.com/ying32/govcl/vcl/api: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
from liblcl.
- 找到kill的原因了.
# dmesg
[ +0.000002] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/[email protected],task=compile,pid=282497,uid=1000
[ +0.000039] Out of memory: Killed process 282497 (compile) total-vm:12238312kB, anon-rss:9513676kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:18756kB oom_score_adj:0
[ +0.192844] oom_reaper: reaped process 282497 (compile), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
- 为什么编译过程中会占用如此大量的内存? 是正常吗?
from liblcl.
这个问题你得问google为啥要这么大量的内存,这个问题也是从go1.16开始才有的,用govcl dev分支的可以在linux下成功编译。
from liblcl.
Related Issues (13)
- 安装GoVCL时报错 HOT 2
- can not work with golang in linux-i686 HOT 4
- MacOS下面怎么用
- Mac M1 build error " identifier not found LazarusResources" HOT 2
- Do you have plan to support GTK+ 3 under Linux? HOT 1
- 请问有没有示范项目可用? HOT 1
- 能支持一下TCheckComboBox吗? HOT 4
- 不好用啊。 HOT 1
- 能不能用个什么参数或者设置个变量之类的不输出 Library Version HOT 3
- 怎么编译成动态库啊
- Mac编译时出现内存不足的问题 HOT 7
- TStrings 相关的函数,通过FFI调用会出现abstract method called错误 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liblcl.