I had problems making mexmaci64 files using Mex from both jpeg_read.c and jpeg_write.c from jpeg toolbox. I asked my question here and the problem for jpeg_read solved. but I st
First off:
By pointing at the /usr/local/Cellar/jpeg/
location of the jpeg
or other libraries, you're dependent on the specific version that is currently installed. You probably want to use /usr/local/opt/jpeg/include/
etc instead. /usr/local/opt
is where Homebrew exposes its non-versioned presentations of its installed package contents.
So:
mex -compatibleArrayDims -I/usr/local/Cellar/jpeg/9d/include ...
This is pointing at the jpeg
library. Does the jpeg
library supply jpegint.h
?
$ ls /usr/local/Cellar/jpeg/9d/include/
jconfig.h jerror.h jmorecfg.h jpeglib.h
Nope. So that's why it's not found. So you have to figure out where you can actually get jpegint.h
from. Hit Google and consult your documentation to figure out what library you're actually trying to pull jpegint.h
from, and pull that in, too, with the appropriate -I
, -L
, and -l
flags.
If you think you have it already installed, you can use find /usr/local/Cellar -name jpegint.h
to look for it. I found it in the gdcm
package.
[~] $ find /usr/local/Cellar -name jpegint.h
/usr/local/Cellar/gdcm/3.0.8_1/include/gdcm-3.0/gdcmjpeg/jpegint.h
So you probably want something like:
mex -compatibleArrayDims -I/usr/local/opt/jpeg/include ...
-I/usr/local/opt/gdcm/include/gdcm-3.0/gdcmjpeg ...
jpeg_write.c ...
-L/usr/local/opt/jpeg/lib -L/usr/local/opt/gdcm/lib ...
-ljpeg -lgdcmjpeg16
(I don't know if you actually want -lgdcmjpeg8
, -lgdcmjpeg12
, or -lgdcmjpeg16
, or maybe something else. I'm just guessing here. Consult the GDCM documentation.)