daulet / tokenizers

Go bindings for HuggingFace Tokenizer
MIT License
92 stars 23 forks source link

add -lm flag to runtime issue #3

Closed clems4ever closed 1 year ago

clems4ever commented 1 year ago

Adding the -lm flag prevents libc incompatibility issues.

$ go run example/main.go 
# command-line-arguments
/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /home/cmichaud/github.com/daulet/tokenizers/libtokenizers.a(tokenizers-00debc4cfaeea180.tokenizers.dd41142f88f0a814-cgu.7.rcgu.o): undefined reference to symbol 'exp@@GLIBC_2.29'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
clems4ever commented 1 year ago

Hey, nice work @daulet ! When trying out the example I faced the issue mentioned above. It's likely due to an incompatibility between my local libc (latest since I'm on Arch) and the one used to build the huggingface tokenizer I guess.

Adding -lm solved the issue.

daulet commented 1 year ago

oh nice, good find @clems4ever! I was passing in additional flags to go build 🤦 , but this is cleaner.