pixiv / go-libjpeg

An implementation of Go binding for libjpeg (or libjpeg-turbo).
BSD 3-Clause "New" or "Revised" License
157 stars 52 forks source link

selecting libjpeg or libjpeg-turbo #46

Open thorsteinssonh opened 6 years ago

thorsteinssonh commented 6 years ago

By default the package links against libjpeg on my ubuntu 16.04. However, libjpeg-turbo8 is also available. I was hoping that the turbo library would be selected at compile time, but it seems go-libjpeg favours libjpeg, at least on my system. In the cgo header somwhere I noticed there is a "-ljpeg" presumably this will therefore only link against libjpeg. Could you advice how I would select libjpeg-turbo instead?

Cheers, Hrob.

scaszoo commented 4 years ago

Hi Hrob,

You probably solved that issue by now. But everybody else who's looking for an answer: CGO_LDFLAGS="-L/tmp/libjpeg-turbo/lib64" CGO_CPPFLAGS="-I/tmp/libjpeg-turbo/include" LD_LIBRARY_PATH="/tmp/libjpeg-turbo/lib64" go run main.go would work fine. But of course you have to find the appropriate folders for libjpeg-turbo on your system first and replace them in the string above.

Thanks for pointing me in the right direction EAX/N3o