Home / Go / cgo edit
Try Documentalist, my app that offers fast, offline access to 190+ programmer API docs.


==> ./configure --prefix=/usr/local/Cellar/jpeg-turbo/1.3.1 --with-jpeg8 --mandir=/usr/local/Cellar/jpeg-turbo/1.3.1/share/man NASM=/usr/local/Cellar/nasm/2.11.05/bin/nasm
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

libjpeg-turbo is not linked to prevent conflicts with the standard libjpeg.

    LDFLAGS:  -L/usr/local/opt/jpeg-turbo/lib
    CPPFLAGS: -I/usr/local/opt/jpeg-turbo/include

image magick serializes libjpeg calls:

https://gowalker.org/github.com/jeremytorres/jpegextract#performance - this says that libjpeg-turbo is 8x faster than Go, libjpeg 3x faster


Cgo with pkg-config:
#cgo pkg-config: vips
#include "vips.h"

Cgo with explicit flags:
// #cgo LDFLAGS: -L/usr/local/Cellar/jpeg-turbo/1.3.1/lib -ljpeg
// #cgo CFLAGS: -I/usr/local/Cellar/jpeg-turbo/1.3.1/include

Cgo with different flags for different OSes:

// #cgo linux LDFLAGS: -L/opt/irlibs/lib -ljpeg
// #cgo linux CFLAGS: -I/opt/irlibs/include
// #cgo darwin LDFLAGS: -L/usr/local/Cellar/jpeg-turbo/1.3.1/lib -ljpeg
// #cgo darwin CFLAGS: -I/usr/local/Cellar/jpeg-turbo/1.3.1/include

Feedback about page:

Optional: your email if you want me to get back to you:

Need fast, offline access to 190+ programmer API docs? Try my app Documentalist for Windows