ARudik / phc

Automatically exported from code.google.com/p/phc
0 stars 0 forks source link

"configure: error: Could not link against !" #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm really not sure what info you need me to supply, but I had a problem 
configuring the svn-trunk of phc on Ubuntu 10.10. I installed all of the 
dependencies except libxerces-27, which was not found. I installed 
libxerces-c2-dev instead.

Here is the last bit of the ./configure output. Please let me know if this is 
insufficient and I will send more information.

checking for gengetopt... config/phc_missing gengetopt
checking for gperf... config/phc_missing gperf
checking for flex... config/phc_missing flex
checking for bison... config/phc_missing bison
checking for valgrind... no
checking for dot... /usr/bin/dot
checking for gc... /usr/bin/gc
checking for maketea... config/phc_missing maketea
checking for php... /usr/local/bin/php
checking for zend_eval_string in -lphp5... no
checking for sapi/embed/php_embed.h... yes
checking whether compiler supports covariant returns... yes
checking for /usr/lib/libCrun.so.1... no
checking for boostlib >= 1.35.0... yes
checking whether the Boost::Regex library is available... yes
configure: error: Could not link against  !

Original issue reported on code.google.com by shabbyr...@gmail.com on 13 Nov 2010 at 10:13

GoogleCodeExporter commented 9 years ago
It looks like you're missing the boost regex library I think. On Ubuntu 10.04, 
you probably want to install libboost-all-dev.

We've had a few complaints about Boost::Regex in configure, would be nice to 
have a better solution to our current autoconf macro.

Original comment by paul.biggar on 13 Nov 2010 at 11:03

GoogleCodeExporter commented 9 years ago
Yep, that got it past that point. Sorry to waste your time - I wrongly assumed 
Boost::Regex was fine as it said 'yes' at the end of the line.

Unfortunately, I'm now having trouble getting it to find the embed SAPI. I 
configured PHP with --enable-embed. The header file is at 
/usr/local/include/php/sapi/embed/php_embed.h. I found some help in the mailing 
list that suggested I call "CFLAGS="-I/usr/local/include/php" ./configure", but 
it didn't help. 

Original comment by shabbyr...@gmail.com on 14 Nov 2010 at 3:18

GoogleCodeExporter commented 9 years ago
Not a time waste - it was our poor coding that wasted _your_ time!

I typically do `make install` on the embed version of PHP, and then configure 
normally. If you want to try the CFLAGS solution, you might try adding it to 
CPPFLAGS or CXXFLAGS too. CFLAGS only works on the C compiler, but we also use 
embedded PHP when compiling C++ (CXX). CPPFLAGS is for the preprocessor, so 
should work for both, but it doesn't always work for me.

Original comment by paul.biggar on 14 Nov 2010 at 12:54

GoogleCodeExporter commented 9 years ago
Thanks so much for your prompt, friendly and thorough responses. It's a credit 
to yourself and the project and all too uncommon in the FOSS world.

I installed php using make install, but did not provide any prefixes during 
configure so it installed to /usr/local. The php configuration process 
confirmed at the end that the embed SAPI was being installed.

I tried configuring with the following command: 
CPPFLAGS="-I/usr/local/include/php/sapi/embed/" 
CXXFLAGS="-I/usr/local/include/php/sapi/embed/" 
CFLAGS="-I/usr/local/include/php/sapi/embed/" ./configure

I tried using /usr/local, /usr/local/include and the above folder as the value 
and still no dice.

I picked through the configure and makefile scripts but I'm just not clever 
enough to work out what's really going on - I am after all just a 
run-of-the-mill PHP coder. :(

Original comment by shabbyr...@gmail.com on 15 Nov 2010 at 12:15

GoogleCodeExporter commented 9 years ago
Post your config.log, and I'll take a look.

Original comment by paul.biggar on 15 Nov 2010 at 12:22

GoogleCodeExporter commented 9 years ago
Here 'tis.

Original comment by shabbyr...@gmail.com on 15 Nov 2010 at 2:55

Attachments:

GoogleCodeExporter commented 9 years ago
OK, it finds libphp5.so, but then it can't link:

/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_bucket_eos_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_cleanup'
/usr/local/lib/libphp5.so: undefined reference to `ap_auth_type'
...

Those are Apache symbols, which phc doesn't provide. So this means php was 
configured expecting apache.

I suspect you were trying to configure a single version of libphp5 to support 
both apache and embed? If so, I guess this doesn't work. Try again without the 
apache support.

And if you're not doing anything weird, can you include a list of the 
instructions you ran: (ie downloaded PHP for X, ran ./configure --enable-X 
--disable-Y, make, sudo make install).

I think we'll get there :)

Original comment by paul.biggar on 15 Nov 2010 at 11:11

GoogleCodeExporter commented 9 years ago
You were right - it was the --with-apxs2 flag. Once I removed that from my php 
configure call and did another make / make install, phc configured with no 
errors. Seems like it only really warrants a warning in the docs rather than 
there being any problem with your code.

I actually just stumbled across this 
(http://code.google.com/p/phc/issues/detail?id=118) when looking in the issues 
list - I think I might have posted a dupe here... sorry about that :X

I also didn't realise PHP 5.3 wasn't supported yet - that's what I have been 
using. Could that have anything to do with the error I am now receiving during 
the make process for phc?

src/embed/optimize.cpp: In static member function ‘static Method_info* 
PHP::get_method_info(String*)’:
src/embed/optimize.cpp:223: error: invalid conversion from 
‘zend_fcall_info*’ to ‘uint’
src/embed/optimize.cpp:223: error: cannot convert ‘zend_fcall_info_cache*’ 
to ‘zend_fcall_info*’ for argument ‘3’ to ‘int 
zend_fcall_info_init(zval*, uint, zend_fcall_info*, zend_fcall_info_cache*, 
char**, char**)’
m

Original comment by shabbyr...@gmail.com on 15 Nov 2010 at 12:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, please ignore last notification email. It actually didn't work. I was 
misreading the thing.

Original comment by shabbyr...@gmail.com on 15 Nov 2010 at 1:49

GoogleCodeExporter commented 9 years ago
That might be a 5.3 error, I'm not sure. See if it works with 5.2.14...

Original comment by paul.biggar on 15 Nov 2010 at 2:48

GoogleCodeExporter commented 9 years ago
libboost-all-dev is not required, just libboost-regex-dev. At lest for Ubuntu 
10.04 LTS. Adds less junk to the build box.

However, I do have the same issue from comment #8 while trying to build phc 
with PHP 5.3.3. A minimal (as the documentations says) 5.2.14 builds flawlessly.

Original comment by saltwaterc on 24 Nov 2010 at 2:36

GoogleCodeExporter commented 9 years ago
I guess PHP 5.3 changed the signature. I'm happy to take a patch which guards 
using the php version preprocessor macros.

Original comment by paul.biggar on 24 Nov 2010 at 4:07

GoogleCodeExporter commented 9 years ago
Running PHP 5.3.4 here, and i got that error as well. looking thru some of the 
php extensions (pdo_phar i think it was). I found a similar call. Just started 
recompiling and gcc is happily chugging along.

in file src/embed/optimize.cpp line 223
int result = zend_fcall_info_init (&fn, &fci, &fcic TSRMLS_CC);

I have replaced with
int result = zend_fcall_info_init (&fn, 0, &fci, &fcic, NULL, NULL TSRMLS_CC);

Original comment by laffin...@gmail.com on 23 Dec 2010 at 4:30

GoogleCodeExporter commented 9 years ago
Hello laffintoo,

  Indeed, if you provide this patch phc compiles without complains. However, this fix is not enough for codegen.  I have recently posted something about this a few days ago, please refer to: http://www.phpcompiler.org/lists/phc-internals/2010-December/005904.html . If you don't need codegen, I think you're fine.

  I'm still trying to fix this problem, but I'm not a devel in the codegen part of phc, so I'm having some difficulties. Anyway, I'm still trying...

  []z, Andrei

Original comment by logyt...@gmail.com on 23 Dec 2010 at 12:22

GoogleCodeExporter commented 9 years ago
For anyone else stuck with this message on FreeBSD, try:

./configure --with-boost-regex=boost_regex

Original comment by kevin...@gmail.com on 8 Feb 2011 at 5:51

GoogleCodeExporter commented 9 years ago
Hi, I'm used ubuntu 11.10 yeah yeah yeah I know this ubuntu suck, but I dont 
solved this problem, you may I help..

Thanks

Original comment by Danielr....@gmail.com on 17 Dec 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Hi Daniel,

  Which specific compiling problem are you having? Your configure can't find libboost or is it something else? Have you tried installing this library like this?
    # apt-get install libboost-all-dev

  If this is not your problem, paste some part of the error.
  []z, Andrei

Original comment by logyt...@gmail.com on 17 Dec 2011 at 5:31

GoogleCodeExporter commented 9 years ago
Hi,

the problem with "configure: error: Could not link against  !" is most likely 
caused by small bug hidden in m4/ax_boost_regex.m4. In line 75 we have a call 
to ls:
ls $BOOSTLIBDIR/libboost_regex*.{so,a}*

which in such form causes ls to fail and return empty string if any of paths 
({so,a})
is missing. Since we need either shared or static version of boost_regex, this 
should be changed to:
ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.a*

The attached patch, which is also available in PLD Linux CVS repository:
http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/php-phc/php-phc-m4-boos
t_regex.patch?revision=1.1&view=markup
fixes that (at least for me).

Original comment by ad...@adamg.eu on 18 Dec 2011 at 9:42

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch adam. I've added you as a committer, so if you've 
confirmed this works please commit it.

Original comment by paul.biggar on 18 Dec 2011 at 10:25

GoogleCodeExporter commented 9 years ago
Thanks for the commit rights Paul, I'll fix it shortly (and I'll have a look at 
other m4 macros as well).

Original comment by ad...@adamg.eu on 18 Dec 2011 at 11:43

GoogleCodeExporter commented 9 years ago
fixed in rev3418

Original comment by ad...@adamg.eu on 18 Dec 2011 at 11:47

GoogleCodeExporter commented 9 years ago
with rev3418

System, Ubuntu 11.10 (oneiric) x64
Linux patrick-N53SV 3.0.0-26-generic #43-Ubuntu SMP Tue Sep 25 17:19:22 UTC 
2012 x86_64 x86_64 x86_64 GNU/Linux

./configure --with-boost-regex=boost_regex
checking for boostlib >= 1.35.0... yes
checking whether the Boost::Regex library is available... yes
checking for main in -lboost_regex... no
checking for main in -lboost_regex-boost_regex... no
configure: error: Could not link against boost_regex-boost_regex !

./configure --with-boost=/usr
checking for boostlib >= 1.35.0... yes
checking whether the Boost::Regex library is available... yes
checking for exit in -lboost_regex-mt... no
checking for exit in -lboost_regex-mt... (cached) no
checking for exit in -lboost_regex... no
checking for exit in -lboost_regex... (cached) no
checking for exit in -lboost_regex... (cached) no
configure: error: Could not link against boost_regex !

./configure --with-boost=/opt/local
checking for boostlib >= 1.35.0... yes
checking whether the Boost::Regex library is available... yes
configure: error: Could not link against  !

aptitude search boost
p   libboost-all-dev

aptitude search boost | grep regex
i   libboost-regex-dev              - regular expression library for C++ (defaul
p   libboost-regex1.42-dev          - regular expression library for C++        
p   libboost-regex1.42.0            - regular expression library for C++        
i A libboost-regex1.46-dev          - regular expression library for C++        
i A libboost-regex1.46.1            - regular expression library for C++ 

Original comment by pat.vdl...@gmail.com on 15 Oct 2012 at 9:35

GoogleCodeExporter commented 9 years ago
Please re-open this issue, since it is clearly not solved:

tomas@ProtonLaptop ~/Downloads/phc/phc-read-only $ sudo ./configure 
configure: WARNING:
***********************************************
* You are using the phc svn repository. Read  *
* README.svn or you may experience problems.  *
***********************************************

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
checking for boostlib >= 1.35.0... yes
checking whether the Boost::Regex library is available... yes
checking for exit in -lboost_regex-mt... no
checking for exit in -lboost_regex-mt... (cached) no
checking for exit in -lboost_regex... no
checking for exit in -lboost_regex... (cached) no
checking for exit in -lboost_regex... (cached) no
configure: error: Could not link against boost_regex !

tomas@ProtonLaptop ~/Downloads/phc/phc-read-only $ aptitude search boost | grep 
regex
i A libboost-regex-dev              - regular expression library for C++ (defaul
p   libboost-regex-dev:i386         - regular expression library for C++ (defaul
i A libboost-regex1.46-dev          - regular expression library for C++        
p   libboost-regex1.46-dev:i386     - regular expression library for C++        
i A libboost-regex1.46.1            - regular expression library for C++        
p   libboost-regex1.46.1:i386       - regular expression library for C++        
p   libboost-regex1.48-dev          - regular expression library for C++        
p   libboost-regex1.48-dev:i386     - regular expression library for C++        
p   libboost-regex1.48.0            - regular expression library for C++        
p   libboost-regex1.48.0:i386       - regular expression library for C++  

Running on Mint 13 64 bit. Thanks for any help in advance.

Original comment by Tomassi...@gmail.com on 30 Oct 2012 at 11:11

GoogleCodeExporter commented 9 years ago
I've recently upgraded to Ubuntu 12.04 and installed libboost-all-dev which did 
fix this problem

Original comment by pat.vdl...@gmail.com on 17 Dec 2012 at 10:27

GoogleCodeExporter commented 9 years ago
I am facing a similar issue on fedora 18:

checking for gengetopt... config/phc_missing gengetopt checking for gperf... config/phc_missing gperf checking for flex... config/phc_missing flex checking for bison... config/phc_missing bison checking for valgrind... no checking for dot... /usr/bin/dot checking for gc... /usr/bin/gc checking for maketea... config/phc_missing maketea checking for php... /home/pratik/php.for.phc/bin/php checking for zend_eval_string in -lphp5... yes checking for sapi/embed/php_embed.h... yes checking whether compiler supports covariant returns... yes checking for /usr/lib/libCrun.so.1... no checking for boostlib >= 1.35.0... yes checking whether the Boost::Regex library is available... yes checking for exit in -lboost_regex... no checking for exit in -lboost_regex... (cached) no checking for exit in -lboost_regex... (cached) no configure: error: Could not link against boost_regex !

I have boost regex libs installed on my system: [pratik@Pratik-fedora boost_1_53_0]$ ls -ltr /usr/local/lib/libboost_regex.so lrwxrwxrwx. 1 root root 24 Feb 6 22:44 /usr/local/lib/libboost_regex.so -> libboost_regex.so.1.53.0

Also, attaching config log for reference.


Original comment by `prateekb...@gmail.com` on 7 Feb 2013 at 7:11
* Added labels: ****
* Removed labels: ****

Attachments:
* [config.log](https://storage.googleapis.com/google-code-attachments/phc/issue-132/comment-26/config.log)
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
ubuntu 12.10
aptitude install libphp5-embed
doesn't find that it's compiled with --enable-embed
right, now when I
sudo ln -s /usr/lib/php5/libphp5-5.4.6-1ubuntu1.2.so /usr/lib/libphp5.so
and
./configure

checking whether the Boost::Regex library is available... yes
checking for exit in -lboost_regex-mt... no
checking for exit in -lboost_regex-mt... (cached) no
checking for exit in -lboost_regex... no
checking for exit in -lboost_regex... (cached) no
checking for exit in -lboost_regex... (cached) no
configure: error: Could not link against boost_regex !

when I unlink /usr/lib/libphp5.so
boot_regex is found
but --enable-embed isn't recognized ;)

Original comment by i...@icod.de on 2 Apr 2013 at 6:33

GoogleCodeExporter commented 9 years ago
Which version of phc do you use? There was an update in svn fixing this issue. 
But there is no stable version/download containing this fix yet.

During ./configure a file named config.log ist created. Please look into it 
when /usr/lib/libphp5.so is in place and search for a compiler error near 
"-lboost_regex".

Original comment by oliver.metz on 3 Apr 2013 at 6:08

GoogleCodeExporter commented 9 years ago
configure:17250: checking for exit in -lboost_regex
configure:17275: g++ -o conftest -g -O2  -I/usr/include  -L/usr/lib 
conftest.cpp -lboost_regex  -lphp5 -L/usr/local/lib -R/usr/local/lib -ldl  >&5
g++: error: unrecognized command line option '-R'

Original comment by rose.and...@gmail.com on 28 May 2013 at 11:12

GoogleCodeExporter commented 9 years ago
On OSX I use boost 1.43 from Rudix project, build PHP as static not shared. 
Force change zend_eval_string to yes (I check it with simple stub file before) 
and patch optimize.cpp (link for patch it's in other posts), compilation 
success, but  when i run i get:
dyld: Symbol not found: __libiconv_version
  Referenced from: /Users/ydk2/Desktop/phc-0.3.0.1/.libs/libphc.0.dylib
  Expected in: flat namespace
 in /Users/ydk2/Desktop/phc-0.3.0.1/.libs/libphc.0.dylib
Trace/BPT trap: 5
Sorry for me english.

Original comment by y...@hotmail.com on 1 Jul 2013 at 3:54

GoogleCodeExporter commented 9 years ago
Hello Folks,

  Indeed the problem wasn't fixed before. rose.andrew got it right, the problem was not detection of lib boost_regex, but the detection of php. The configure script was tainting a global variable (LIBS) after checking for php, which propagates to other checks like libboost, pthreads and so on. To fix this issue, I changed the m4 script and regenerated the script. Please check if it is ok now.

  Ydk2, I'm still struggling to get phc on Mac. Seems like you've got farther than me. The error indicates that your php is lacking libiconv. Have you fixed this?

  []z, Andrei

Original comment by logyt...@gmail.com on 9 Jul 2013 at 1:17

GoogleCodeExporter commented 9 years ago
Yes i fix iconv problem, it is some idiotics. when I try compile with installed 
php get LD errors, when I change to php source path, problem gone. But I build 
stub with embed php with success compile and run both arch i386 and x86_64, You 
can check it on wxphp forum. 
http://forums.wxphp.org/viewtopic.php?f=6&t=42&p=282#p282 maybe help some.

Original comment by y...@hotmail.com on 13 Jul 2013 at 9:07

GoogleCodeExporter commented 9 years ago
Hello,

I have the same problem as the first user:

checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for strftime... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking netinet/ip.h usability... yes
checking netinet/ip.h presence... yes
checking for netinet/ip.h... yes
checking for pcap_open_live in -lpcap... yes
checking for boostlib >= 1.20.0... yes
checking whether the Boost::Regex library is available... yes
configure: error: Could not link against  !

I have installed libboost-all-dev and every dependencies. I'm using ubuntu 14.10

Original comment by are...@gmail.com on 22 Oct 2014 at 11:16