Closed dalanmiller closed 7 years ago
Try brew update && brew install libpng gflags
.
$ ~ brew update && brew install libpng gflags
Already up-to-date.
Warning: libpng-1.6.28 already installed
Warning: gflags-2.2.0 already installed
I think it might be something to do with the way gflags
is linked? I've done both brew unlink
and brew link
on it however.
brew unlink gflags && brew link gflags
doesn't help, because guetzli/bazel is not even trying to find where they are installed. It just assumes they'll be in the default include path or the current directory.
The build script has to use pkg-config --cflags gflags
I downloaded and unpacked the archive and then CLI'd into the unpacked folder and ran make
and it worked just fine. This is after doing brew update && brew install libpng gflags
The binary is in the bin folder and seems to have been built successfully.
Because I went into the directory itself, I assume that's why it worked for me, because its assumption of "current directory" was true in my particular case.
Add path to headers and the libraries to guetzli.make will solve your problem. Because Homebrew will install headers and libraries to /usr/local/include and /usr/local/lib by default.
See also: Homebrew/homebrew-core#11190 (seems to work fine for El Capitan and Sierra)
Someone's gotta make a simple app around this
I'll be adding it to ImageOptim.
Nice. I was just about to suggest that!
Thanks @pornel ! I'm excited to share this with our design team.
BTW if someone is planning to built it with libpng and gflags installed via MacPorts you have to edit guetzli.make similar as CliffsDovers suggestion above. But for MacPorts it has to point to /opt/local/lib
When trying to built it with the necessary libs installed through MacPorts the build-process failed because the libs couldn't be found.
==== Building guetzli (release) ====
guetzli.cc
guetzli/guetzli.cc:25:10: fatal error: 'png.h' file not found
#include "png.h"
^
1 error generated.
make[1]: *** [obj/Release/guetzli.o] Error 1
make: *** [guetzli] Error 2
In both lines of guetzli.make beginning wie LIBS you have to add:
-L/opt/local/lib
like LIBS += -L/opt/local/lib -lpng -lgflags_nothreads -lz -lpthread
@Pesthauch666 Does MacPorts cause pkg-config
to report correct paths?
@robryk
I'm not that familar with this tool (I'm still a rookie after all), but:
pkg-config --libs libpng
reports
-L/opt/local/lib -lpng16
Anyone gotten this to work?