Summary:ASTERISK-20681: Unable to compile pjproject in Asterisk 11
Reporter:Dinesh Ramjuttun (din3sh)Labels:
Date Opened:2012-11-14 08:40:09.000-0600Date Closed:2013-02-26 10:18:55.000-0600
Versions:11.0.0 11.0.1 Frequency of
must be completed before resolvingASTERISK-20809 11.2.0 Blockers
is duplicated byASTERISK-20684 Installation Issue
Environment:Centos 6.3 x86_64Attachments:( 0) 20121208__ccar_solved.diff.txt
( 1) 20130118-res-Makeifle.diff.txt
( 2) cc-auto.mak.txt
( 3) config.log
( 4) config.log
Description:Cannot compile. I am stuck with the error below.
FYI Asterisk 1.8.x compiles with no problem on same system/server.

../src/pj/ssl_sock_ossl.c: In function âcreate_sslâ:
../src/pj/ssl_sock_ossl.c:605: warning: value computed is not used
../src/pj/ssl_sock_ossl.c:606: warning: value computed is not used
../src/pj/ssl_sock_ossl.c: In function âflush_write_bioâ:
../src/pj/ssl_sock_ossl.c:1148: warning: value computed is not used
make[5]: ccar: Command not found
make[5]: *** [../lib/libpj-x86_64-unknown-linux-gnu.a] Error 127
make[4]: *** [pjlib] Error 2
make[3]: *** [all] Error 1
make[2]: *** [pjproject] Error 2
make[1]: *** [res] Error 2
make[1]: Leaving directory `/usr/src/install/asterisk-11.0.1'
make: *** [_cleantest_all] Error 2
Comments:By: Matt Jordan (mjordan) 2012-11-14 09:52:38.385-0600

Please provide the full output of your configure.log and the output of make as attachments on the issue.

By: danilo borges (dbbrito) 2012-11-14 15:36:19.683-0600

config.log   error 127   Centos 6.3 x64

By: Walter Doekes (wdoekes) 2012-11-14 16:13:07.806-0600

I think we're looking at the wrong config.log. Is there one in res/pjproject?

By: danilo borges (dbbrito) 2012-11-14 16:24:23.946-0600

yes, config.log in res/pjproject

By: Matt Jordan (mjordan) 2012-11-14 16:27:38.024-0600

You're also not the issue reporter.  Are you running into the same problem?

As Walter pointed out, pjproject has its own configure script that runs.  Please attach the output of that, as well as the full output of make.

By: danilo borges (dbbrito) 2012-11-14 16:48:32.308-0600

I do not understand what you need, I'm from Brazil and my English is bad!
Tell me what directory and file name you need.

config.log 101k in res/pjproject
config.log 830k in /usr/src/asterisk/asterisk-11.0.1

By: Michael L. Young (elguero) 2012-11-15 15:27:24.486-0600

Please attach the full output from running make.

By: Michael L. Young (elguero) 2012-11-15 15:34:36.933-0600

Here is an email thread discussing the same problem:


By: Matt Jordan (mjordan) 2012-11-15 16:23:51.423-0600

And here is a forum post as well, with a possible solution.


I've been running with that problem and here is the workaround i've found :

The problem is located in the following file : res/pjproject/build/cc-auto.mak
The AR and RANLIB variables are prefixed with 'cc'.
Simply remove 'cc' in 'ccar' and 'ccranlib' and it will compile.

I've not investigated yet why these variables are not set correctly but maybe some other people have the clue.

By: danilo borges (dbbrito) 2012-11-15 19:00:36.203-0600

Simply remove 'cc' in 'CCAR' and 'ccranlib' and it will compile, it also did not solve the problem!

By: Mark Michelson (mmichelson) 2012-11-27 14:22:28.697-0600

I've seen this issue pop up a couple of times recently on new installations, and I have tracked it down a bit.

I checked out two copies of Asterisk trunk. In copy 1, I ran `./configure && make install` . Everything worked fine. In copy 2, I ran `make install` . This operation bombed out after a second and told me I needed to run the configure script. So I then ran `./configure && make install` . In this situation, I got the "ccar" error.

Apparently, the issue stems from the pjproject's configure script being run before Asterisk's. If you notice the "ccar" error occur, then just run the following from the Asterisk source directory:

cd res/pjproject
cd ../..
make install

Asterisk should then compile without issue.

Something needs to be put in place to ensure that pjproject's configure script does not get run before Asterisk's.

By: Michael L. Young (elguero) 2012-12-04 10:53:34.279-0600

Looks like Tilghman may have found the problem and posted a solution on the -dev list.


By: danilo borges (dbbrito) 2012-12-08 08:02:35.540-0600

Friends, we downloaded the version 11.0.2 and now gave the error:

can not be used when making a shared object; recompile with -fPIC
/usr/src/asterisk/asterisk-11.0.2/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [res_rtp_asterisk.so] Error 1
make[1]: *** [res] Error 2
make[1]: Leaving directory `/usr/src/asterisk/asterisk-11.0.2'
make: *** [_cleantest_all] Error 2

if anyone can help us thankful

By: Tilghman Lesher (tilghman) 2012-12-08 12:26:56.147-0600

Took me some time, but this solves the problem.  Had to rebuild from scratch several times to track this down, but the final solution was not to build res/pjproject/build/cc-auto.mak.

By: Steve Lang (stevenla) 2013-01-01 21:08:14.312-0600

Same problem here from new install cent os 6.3 / 64. Unable to build any V 11

By: Tilghman Lesher (tilghman) 2013-01-02 00:18:23.599-0600

Steve:  does the patch I uploaded here solve the problem for you?

By: danilo borges (dbbrito) 2013-01-02 04:48:52.647-0600

Friends, I managed to solve the problem Centos 6.3 x64.
The error is the why I was installing asterisk 11 on top of version 10.
So I had to do the steps below to completely uninstall the asterisk 10 and after installation without errors occurred!

killall -9 safe_asterisk
killall -9 asterisk

lsmod | grep dahdi
dahdi_transcode         6697  1 wctc4xxp
dahdi_voicebus         55791  2 wctdm24xxp,wcte12xp
dahdi                 212660  11 xpp,dahdi_transcode,wcb4xxp,wctdm,wcfxo,wctdm24xxp,wcte11xp,wct1xxp,wcte12xp,dahdi_voicebus,wct4xxp
crc_ccitt               1677  2 wctdm24xxp,dahdi

rm -f /usr/lib/asterisk/modules/*
service dahdi stop
modprobe -r wctc4xxp
modprobe -r wctdm24xxp
modprobe -r wcte12xp
modprobe -r xpp
modprobe -r dahdi_transcode
modprobe -r wcb4xxp
modprobe -r wctdm
modprobe -r wcfxo
modprobe -r wctdm24xxp
modprobe -r wcte11xp
modprobe -r wct1xxp
modprobe -r wcte12xp
modprobe -r dahdi_voicebus
modprobe -r wct4xxp
modprobe -r wctdm24xxp
modprobe -r dahdi

rm -rf /etc/asterisk
rm -f  /etc/zaptel.conf
rm -rf /var/log/asterisk
rm -rf /var/lib/asterisk
rm -rf /var/spool/asterisk
rm -rf /usr/lib64/asterisk
rm -rf /usr/lib/asterisk
rm -rf /usr/src/asterisk

yum update


By: Steve Lang (stevenla) 2013-01-02 11:51:24.980-0600

Tilghman: Patch worked on asterisk-11.2.0-rc1 and asterisk-11.1.0

The build moves past the section below and completes.

  [LD] func_vmcount.o -> func_vmcount.so
  [CC] func_volume.c -> func_volume.o
  [LD] func_volume.o -> func_volume.so
../src/pj/ssl_sock_ossl.c: In function âcreate_sslâ:
../src/pj/ssl_sock_ossl.c:605: warning: value computed is not used
../src/pj/ssl_sock_ossl.c:606: warning: value computed is not used
../src/pj/ssl_sock_ossl.c: In function âflush_write_bioâ:
../src/pj/ssl_sock_ossl.c:1148: warning: value computed is not used
ar: creating ../lib/libpj-x86_64-unknown-linux-gnu.a                   <=
a - output/pjlib-x86_64-unknown-linux-gnu/ioqueue_select.o
a - output/pjlib-x86_64-unknown-linux-gnu/file_access_unistd.o
a - output/pjlib-x86_64-unknown-linux-gnu/file_io_ansi.o
a - output/pjlib-x86_64-unknown-linux-gnu/os_core_unix.o
a - output/pjlib-x86_64-unknown-linux-gnu/os_error_unix.o
a - output/pjlib-x86_64-unknown-linux-gnu/os_time_unix.o

Good Job and Thank you.

By: abelbeck (abelbeck) 2013-01-16 18:34:47.175-0600

This fix is causing 11.2.0 to fail building while cross-compiling:
  [LD] func_volume.o -> func_volume.so
../src/pj/guid_uuid.c:26:23: error: uuid/uuid.h: No such file or directory
../src/pj/guid_uuid.c:26:23: error: uuid/uuid.h: No such file or directory
../src/pj/guid_uuid.c: In function ‘pj_generate_unique_string’:
make[6]: *** [output/pjlib-i686-pc-linux-gnu/guid_uuid.o] Error 1
make[5]: *** [pjlib] Error 2
make[4]: *** [all] Error 1
make[3]: *** [pjproject] Error 2
make[2]: *** [res] Error 2
make[2]: Leaving directory `/home/user/astlinux/1.0/output/build/asterisk-11.2.0'

Reverting 378582 solves the problem.

I have attached the generated "res/pjproject/build/cc-auto.mak" file that is needed for cross compiling.

By: abelbeck (abelbeck) 2013-01-16 18:36:20.428-0600

attached: generated "res/pjproject/build/cc-auto.mak" file needed for cross compiling.

By: Michael Keuter (mkeuter) 2013-01-17 03:56:25.331-0600

I see exactly the same behavior as abelbeck when cross-compiling 11.2.0. :-(.
11.2.0-rc1 built correctly.

By: Matt Jordan (mjordan) 2013-01-18 08:33:39.751-0600

I've reopened this; however, I don't think the solution is going to be putting the original cc-auto.mak back into the build system. As it is, pjproject's cc-auto.mak caused more problems for more people than it's removal - that is, if it's a choice between pjproject building reliably in 99% of situations and not supporting cross compiling, OR having it fail randomly on people but support cross-compiling, I'm going to choose the former over the latter.

If you'd like cross-compiling to be supported, a patch that restores cc-auto.mak AND fixes it such that it doesn't screw up the build system when {{make}} is run before {{configure}} will be needed.

By: abelbeck (abelbeck) 2013-01-18 11:28:55.614-0600

attachment: revert commit 378582 and remove res/pjproject/build/cc-auto.mak if not cross-compiling

By: abelbeck (abelbeck) 2013-01-18 11:30:08.081-0600

The res/pjproject/build/cc-auto.mak file is optional in the res/pjproject/build/common.mak file (before commit 378582).

How about reverting commit 378582 so res/pjproject/build/cc-auto.mak gets created again, then remove build/cc-auto.mak in res/Makefile after calling ./configure if not cross-compiling.

Attached is a one line addition to res/Makefile, plus reverting commit 378582.  Tested and works for me.

If someone knows of a better way to determine if the main configure script determined cross-compiling, I'm all ears.

Ideally this could be done in res/pjproject/aconfigure, but that script does not work when set for cross-compiling (fails with /bin/sh not finding a command beginning with the --host value) with --build and --host set to different values.  Not to mention res/Makefile calls ./configure with no --build and --host options.

By: Tilghman Lesher (tilghman) 2013-01-18 12:04:17.113-0600

That patch is very hacky.  I'd rather not make the build system any more broken than it already is for pjproject.

A better option would be to conditionally not render cc-auto.mak if host-cc and build-cc are equal (they're different when cross-compiling).

By: abelbeck (abelbeck) 2013-01-18 12:25:59.586-0600

I agree the patch is somewhat hacky :-) , but it works.

We can't make changes to res/pjproject/aconfigure to solve this since it fails with different --build and --host options.

Please note that commit 378582 did not need to change res/pjproject/build/common.mak, the leading '-' to the include ignores the file if it is missing.

Given the sequencing when pjproject's configure is called by make, without rewriting pjproject's aconfigure, it seems to me build/cc-auto.mak must be created, then either deleted or ignored by build/common.mak.

By: Jason Parker (jparker) 2013-01-23 17:25:48.412-0600

I would recommend giving my branch a try.  None of this should be problematic anymore.  If it is, I'd like to fix it by using the pjproject build system more appropriately.


By: abelbeck (abelbeck) 2013-01-24 13:07:06.598-0600

Jason, excellent work!

I generated a tar package based on your "/pjproject-cleanup/" branch, and used the latest AstLinux 1.0 branch, it built perfectly.  And it executed properly on the target box for a few quick tests.

looking at "res/pjproject/config.log" is see:
-- snip --
./aconfigure --build=i686-pc-linux-gnu --host=i586-pc-linux-gnu ...
which is what I would expect, and after a brief inspection the rest of "res/pjproject/config.log" looks good.

I vote this gets merged into the Asterisk 11 branch.  Clearly not a new feature, simply fixing the pjproject build environment.

By: Jason Parker (jparker) 2013-02-26 10:18:55.347-0600

This was fixed in r380816.

By: abelbeck (abelbeck) 2013-03-28 17:50:21.973-0500

It seems Janson's r380816 did not make it into 11.3.0, should it have ?

By: Matt Jordan (mjordan) 2013-03-29 08:36:06.682-0500

No, it was not a blocker for that release. It will be released in 11.4.0.