# Cannot install ImageMagick - Fails on cups-image port



## Flantec (Jan 25, 2016)

I have tried repeatedly to install ImageMagick, but it keeps failing with the following:


```
Makefile:31: recipe for target 'all' failed
gmake[5]: *** [all] Error 1
gmake[5]: Leaving directory '/usr/ports/print/cups-image/work/cups-2.0.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/print/cups-image
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/print/ghostscript9-base
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/print/ghostscript9-base
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/ImageMagick-nox11
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/ImageMagick-nox11
```

This is on FreeBSD 10.2-RELEASE-p9, and the ports tree is completely up to date.  Thank you in advance for any assistance.


----------



## SirDice (Jan 25, 2016)

Please post the whole error, not just the last bit. These are just generic error messages, the real error happens somewhere before that.


----------



## Flantec (Jan 26, 2016)

Ok, admittedly, i*I* was doing this via ssh(1) so i*I* was not seeing what messages were on the console.  Once i*I* did that i*I* see the following:

There are countless lines of:


```
kern.ipc.maxpipekva exceeded; see tuning(7)
```

followed by the last line:


```
maxproc limit exceeded by uid 0 ....
```

Now, this is a brand new install i*I* am preparing, and i*I* am the only one on the server.   And the server is not doing anything else in the background, other then trying to do this install.

The output of `sysctl -a | grep kern.maxproc`:

```
kern.maxproc: 8192
```

The output of `sysctl -a | grep maxpipe`:

```
kern.ipc.maxpipekva: 16793600
```

I am guessing that there must be something broken in the print/cups-image port perhaps that is spooling resources out of control.  does that seem feasible?  Thank you very much.


----------



## marino (Jan 26, 2016)

try with DISABLE_MAKE_JOBS=1 in the command line.  It can't hurt.


----------



## Flantec (Jan 26, 2016)

I tried that, but that did not make any difference.  Thanks for the suggestion.


----------



## tobik@ (Jan 26, 2016)

Flantec said:


> Ok, admittedly, i*I* was doing this via ssh(1) so i*I* was not seeing what messages were on the console. Once i*I* did that i*I* see the following:


If you scroll up in your terminal you should see more of the build error messages.

You can also run `make -C /usr/port/print/cups-image  >& ~/cups-image.log` when using the default shell csh(1) or  `make -C /usr/port/print/cups-image > ~/cups-image.log 2>&1` with sh(1) or bash(1) to capture the whole build output and attach it here. Please do a `make -C /usr/port/print/cups-image clean` first.


----------



## kpa (Jan 27, 2016)

There's a better tool for capturing output from build runs, script(1):

`# script /tmp/cups-image.log make -C /usr/port/print/cups-image install`


----------



## Flantec (Jan 27, 2016)

tobik said:


> If you scroll up in your terminal you should see more of the build error messages.
> 
> You can also run `make -C /usr/port/print/cups-image  >& ~/cups-image.log` when using the default shell csh(1) or  `make -C /usr/port/print/cups-image > ~/cups-image.log 2>&1` with sh(1) or bash(1) to capture the whole build output and attach it here. Please do a `make -C /usr/port/print/cups-image clean` first.



itsIt is a 10MB file, so instead of copying it all here, iI posted it here: http://flantec.com/cups-image.log

tThanks.


----------



## Flantec (Jan 27, 2016)

it just appears to be stuck in a endless loop, generating countless iterations of itself until it reaches the procmax limit.


----------



## wblock@ (Jan 27, 2016)

Please show the contents of /etc/make.conf.


----------



## Flantec (Jan 27, 2016)

I do not have an /etc/make.conf file....


----------



## marino (Jan 27, 2016)

Shameless plug, but have you considered trying building it under synth environment?
In the worst case you see the same thing there but then it would be repeatable for others.
This kind of case is one of the reasons for synth's existence.


----------



## chrbr (Jan 27, 2016)

Compiling was successful on my system. The problem starts with the filter. Below is a block from the fail.

```
Making all in filter...
cd: filter: No such file or directory
gmake[2]: Entering directory '/usr/ports/print/cups-image/work/cups-2.0.3'
chmod +x cups-config
echo Using ARCHFLAGS=""
Using ARCHFLAGS=
```
Here it is

```
Making all in filter...
511 gmake[2]: Entering directory '/wrkdirs/usr/ports/print/cups-image/work/cups-2.0.3/filter'
512 echo Compiling error.c...
513 echo Compiling interpret.c...
514 Compiling error.c...
515 cc  -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wsign-conversion -Wno-tautological-compare -I.. -D_CUPS_SOURCE -I/usr/local/include -O2 -pipe  -fstack-prote  ctor -fno-strict-aliasing  -I/usr/local/include -I/usr/local/include/p11-kit-1  -D_LARGEFILE_SOURCE  -D_THREAD_SAFE -D_REENTRANT  -c -o error.o error.c
516 Compiling interpret.c...
```
The other obvious difference before is that

```
checking for perl... /usr/local/bin/perl
checking for php-cgi... no
checking for php... no
checking for python... /usr/local/bin/python
```
on the fail log and

```
checking for perl... no
checking for php-cgi... no
checking for php... no
checking for python... no
```
on the working system. I am not sure if this can make the difference.
`make extract` on my system did show a directory work/cups-2.0.3/filter. It might be worth to confirm that this directory exists.

EDIT: I saw an additional difference.
This is from the problematic log:

```
cups-image-2.0.3_2 depends on package: libiconv>=1.14_9 - found
```
This does not appear in the log of my system.

Please compare also the options. My options for the port are

```
# This file is auto-generated by 'make config'.
# Options for cups-client-2.0.3_2
_OPTIONS_READ=cups-client-2.0.3_2
_FILE_COMPLETE_OPTIONS_LIST= AVAHI MDNSRESPONDER
OPTIONS_FILE_UNSET+=AVAHI
OPTIONS_FILE_SET+=MDNSRESPONDER
```


----------

