You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,I don't want to compile the lib, I just want test, I enter the directory example/simple-go-cgo and 'make' and show that
go build -o demo
# github.com/asg017/sqlite-vec/examples/go
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `distance_cosine_float':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:464: undefined reference to `sqrt'
/usr/bin/ld: /home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:464: undefined reference to `sqrt'
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `distance_cosine_int8':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:482: undefined reference to `sqrt'
/usr/bin/ld: /home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:482: undefined reference to `sqrt'
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `vec_normalize':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:1747: undefined reference to `sqrtf'
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `l2_sqr_int8':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:374: undefined reference to `sqrtf'
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `l2_sqr_float':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:359: undefined reference to `sqrtf'
/usr/bin/ld: /tmp/go-link-3424282799/000002.o: in function `l2_sqr_int8':
/home/alfred/go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/sqlite-vec.c:374: undefined reference to `sqrtf'
I upgrade the example/simple-go-cgo/go.mod
module github.com/asg017/sqlite-vec/examples/go
go 1.22.5
require github.com/mattn/go-sqlite3 v1.14.22
require github.com/asg017/sqlite-vec-go-bindings v0.1.1
And I found that go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/lib.go
Can you show me how to compile the sample?
My system is ubuntu 22.04 go version is 1.22.6
I find the include file /usr/include/math.h
the lib /usr/lib/x86_64-linux-gnu/libm.so
Thanks!
Activity
BeeBreeze commentedon Aug 14, 2024
In makefile:143, move -lm to the end of the command
fayfive commentedon Aug 14, 2024
Hello,I don't want to compile the lib, I just want test, I enter the directory
example/simple-go-cgoand 'make' and show thatI upgrade the
example/simple-go-cgo/go.modAnd I found that
go/pkg/mod/github.com/asg017/sqlite-vec-go-bindings@v0.1.1/cgo/lib.goIt seems that there is no lib and the directory similarly like this
Can you show me how to compile the sample?
My system is ubuntu 22.04 go version is 1.22.6
I find the include file /usr/include/math.h
the lib /usr/lib/x86_64-linux-gnu/libm.so
Thanks!
asg017 commentedon Aug 15, 2024
@fayfive can you try again with the latest
v0.1.2-alpha.7verision? I added-lmto cgo LDFLAGS for linux environments, hopefully that fixes itfayfive commentedon Aug 15, 2024
Yes, it works well.
Resolve link ordering and scope link libs per target
Resolve link ordering and scope link libs per target