pbiggar / phc

A compiler for PHP
132 stars 37 forks source link

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

Closed pbiggar closed 9 years ago

pbiggar 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 shabbyrobe on 2010-11-13 10:13:46

pbiggar 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 issue reported on code.google.com by paul.biggar on 2010-11-13 11:03:58

pbiggar 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 issue reported on code.google.com by shabbyrobe on 2010-11-14 03:18:56

pbiggar 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 issue reported on code.google.com by paul.biggar on 2010-11-14 12:54:39

pbiggar 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 issue reported on code.google.com by shabbyrobe on 2010-11-15 00:15:29

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

Original issue reported on code.google.com by paul.biggar on 2010-11-15 00:22:11

pbiggar commented 9 years ago
Here 'tis.

Original issue reported on code.google.com by shabbyrobe on 2010-11-15 02:55:26


pbiggar 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 issue reported on code.google.com by paul.biggar on 2010-11-15 11:11:47

pbiggar 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 issue reported on code.google.com by shabbyrobe on 2010-11-15 12:33:38

pbiggar commented 9 years ago
Sorry, please ignore last notification email. It actually didn't work. I was misreading
the thing.

Original issue reported on code.google.com by shabbyrobe on 2010-11-15 13:49:25

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

Original issue reported on code.google.com by paul.biggar on 2010-11-15 14:48:03

pbiggar 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 issue reported on code.google.com by saltwaterc on 2010-11-24 14:36:59

pbiggar 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 issue reported on code.google.com by paul.biggar on 2010-11-24 16:07:27

pbiggar 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 issue reported on code.google.com by laffintoo on 2010-12-23 04:30:17

pbiggar 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 issue reported on code.google.com by logytech on 2010-12-23 12:22:27

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

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

Original issue reported on code.google.com by kevinday on 2011-02-08 17:51:06

pbiggar 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 issue reported on code.google.com by Danielr.venezuela on 2011-12-17 07:08:06

pbiggar 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 issue reported on code.google.com by logytech on 2011-12-17 17:31:35

pbiggar 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-boost_regex.patch?revision=1.1&view=markup
fixes that (at least for me).

Original issue reported on code.google.com by adamg@adamg.eu on 2011-12-18 21:42:03


pbiggar 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 issue reported on code.google.com by paul.biggar on 2011-12-18 22:25:46

pbiggar 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 issue reported on code.google.com by adamg@adamg.eu on 2011-12-18 23:43:40

pbiggar commented 9 years ago
fixed in rev3418

Original issue reported on code.google.com by adamg@adamg.eu on 2011-12-18 23:47:45

pbiggar 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 issue reported on code.google.com by pat.vdleer on 2012-10-15 09:35:55

pbiggar 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 issue reported on code.google.com by Tomassie91 on 2012-10-30 11:11:28

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

Original issue reported on code.google.com by pat.vdleer on 2012-12-17 22:27:04

pbiggar 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 issue reported on code.google.com by `prateekbans74` on 2013-02-07 07:11:59
<hr>
 * *Attachment: [config.log](https://storage.googleapis.com/google-code-attachments/phc/issue-132/comment-26/config.log)*
pbiggar 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 issue reported on code.google.com by info@icod.de on 2013-04-02 06:33:02

pbiggar 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 issue reported on code.google.com by oliver.metz on 2013-04-03 06:08:02

pbiggar 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 issue reported on code.google.com by rose.andrew on 2013-05-28 11:12:38

pbiggar 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 issue reported on code.google.com by ydk2@hotmail.com on 2013-07-01 15:54:27

pbiggar 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 issue reported on code.google.com by logytech on 2013-07-09 01:17:46

pbiggar 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 issue reported on code.google.com by ydk2@hotmail.com on 2013-07-13 09:07:49

pbiggar 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 issue reported on code.google.com by aregic on 2014-10-22 23:16:21

purnimam commented 9 years ago

Hi, I am getting this configure error "configure: error: Could not link against !" when trying to install nox13oflib on ubuntu 14.10. I have already installed libboost-all-dev and every dependencies. Kindly help.

renaldi1982 commented 9 years ago

I've had the same error and for some reason using ./configure --with-boost-regex=boost_regex fixed it for me.

walid32 commented 8 years ago

purniman how did u solve the error. Could not link against

purnimam commented 8 years ago

I couldn’t solve it. I had to go back to ubuntu 12.04.

On Sat, Dec 26, 2015 at 4:23 AM, walid32 notifications@github.com wrote:

purniman how did u solve the error. Could not link against

— Reply to this email directly or view it on GitHub https://github.com/pbiggar/phc/issues/141#issuecomment-167261178.

Regards,

Purnima MuralimohanNational University of Singapore