Error installing on FreeBSD - libjpeg

I am receiving the following error on FreeBSD 10 when trying to compile and install Plone 5.0.4:

"Unable to find libjpeg library and headers. These are required to build Plone."

I believe i have all dependencies correctly installed using pkg, the FreeBSD binary package manager. I have tried the "jpeg" package as well as the "jpeg-turbo" package, both of which have a libjpeg.so library which is what I assume Plone is looking for. It seems that Plone either can't find it or doesn't like the library. Mine is located in /usr/local/lib/libjpeg.so.

How can I get past this error? I've searched Google for an answer but found nothing useful when searching for Plone+FreeBSD+libjpeg.

FYI, I was able to get Plone running easily using the pkg/ports system, but it's an older version (4.3.x) and doesn't seem to support buildout, which I need in order to install a plone-based application, Bikalims... so I need to install Plone from source. I'm stuck at the error above.

Without knowing details about FreeBSD: libjpeg and its header files (often packaged separate) are needed to build the Python Imaging Library (PIL/ best packaged under the name Pillow).

Check if your source buildout uses PIL, PILwoTK or Pillow. If PIL or PILwoTK is used exchange this with Pillow. Latest version works fine with all Plone 4.3.x and 5.x (and is recommended).

Then this may help http://pillow.readthedocs.io/en/3.2.x/installation.html#building-on-freebsd to get the dependencies together.

HTH

I just installed py27-pillow, but the Plone installer still stops with the same error about jpeg and its headers.

Pillow appears to have libjpeg as a dependency too, but it installed fine since I have jpeg already installed. I still wonder if the Plone install script is not looking in the right part of the filesystem to find libjpeg and its headers. I'm not sure where to look in the install script to check that.

config.log provides the following info:

preflight:3883: checking for jpeg_read_header in -ljpeg preflight:3908: cc -o conftest -g -O2 conftest.c -ljpeg >&5 /usr/bin/ld: cannot find -ljpeg cc: error: linker command failed with exit code 1 (use -v to see invocation) preflight:3908: $? = 1

Do you need to change an environment variable like LD_LIBRARY_PATH to include /usr/local/lib ?

I've reproduced this in 10.2 and 10.3. I'll work on it and see what I can figure out.

I was able to do the build with the following commands:

% sh  # use Bourne shell because it's the one where I know how to control the environment
$ export CFLAGS="-I/usr/local/include"
$ export CPPFLAGS="-I/usr/local/include"
$ export LDFLAGS="-L/usr/local/lib"
$ ./install.sh standalone

I've no idea why 10.x freebsd is leaving /usr/local out of the build environment. We do have some BSD folks in the community. Maybe they can help us out.

2 Likes

Future releases of the Unified Installer will fix this. We've probably got 4.3.x and 5.0.x updates coming soon.

That is excellent, thank-you so much! With this I was able to successfully install Plone on FreeBSD 10... and inside a secure jail, in fact. As I'm using csh for my shell instead of Bourne, the syntax is just very slightly different:

$ setenv CFLAGS "-I/usr/local/include" $ setenv CPPFLAGS "-I/usr/local/include" $ setenv LDFLAGS "-L/usr/local/lib" $ ./install.sh standalone

Thanks agin for the help. Great introduction the Plone community. :slight_smile:

1 Like

In your buildout, consider pinning your Pillow version number to the same one you have installed already, if you feel it is sufficient and it works. This prevents buildout from installing (another) Pillow (yet again).

Sean

oh, never mind :slight_smile: