caohaiwd / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

perftools-1.5: make fails on debian-5.0 amd64 #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.untar, configure google-perftools-1.5
2. make
3.

What is the expected output? What do you see instead?
Make errors on file src/malloc_extension.cc:

 g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -
DNO_HEAP_CHECK -pthread -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual 
-Wno-sign-compare -DNO_FRAME_POINTER -fno-exceptions -c 
src/malloc_extension.cc  -fPIC -DPIC -o 
.libs/libtcmalloc_minimal_internal_la-malloc_extension.o
src/malloc_extension.cc:54: error: 'STL_NAMESPACE' has not been declared
src/malloc_extension.cc:56: error: variable or field 'DumpAddressMap' 
declared void
src/malloc_extension.cc:56: error: 'string' was not declared in this scope
src/malloc_extension.cc:56: error: 'result' was not declared in this scope
make: *** [libtcmalloc_minimal_internal_la-malloc_extension.lo] Error 1

What version of the product are you using? On what operating system?
perftools v1.5, debian-5.0 on amd64/x86_64

Please provide any additional information below.
I think the ./configure phase didn't check if I had g++ and libstdc++ 
installed.

Original issue reported on code.google.com by miguel.filipe on 12 Feb 2010 at 2:33

GoogleCodeExporter commented 9 years ago
} I think the ./configure phase didn't check if I had g++ and libstdc++  
installed.

Hmm, it ought to.  Can you attach the output of your 'configure' run, and also 
the
resulting config.log file?

Original comment by csilv...@google.com on 13 Feb 2010 at 1:42

GoogleCodeExporter commented 9 years ago

Original comment by csilv...@gmail.com on 19 Feb 2010 at 3:27

GoogleCodeExporter commented 9 years ago
I got similar problem on Ubuntu9.10. Here is the detail:
1) ./configure
passed
2) make
no command `make`
3) sudo apt-get install build-essential
4) make
got errors which is described at the start of this issue.
5) ./configure
6) make
passed

I think adding checking for g++ in configure.ac could solve the problem. 
Anyway, it's
a tiny issue.

Cameron

Original comment by hgn...@gmail.com on 2 Mar 2010 at 2:57

GoogleCodeExporter commented 9 years ago
I'm confused because configure.ac *does* check for g++.  And here's what I see 
in my 
config.log:
} configure:4405: checking for g++
} configure:4421: found /usr/bin/g++

I'm glad you can reproduce the problem.  Can you attach the output of running 
'configure'?  And also your config.log file?

Original comment by csilv...@gmail.com on 2 Mar 2010 at 7:44

GoogleCodeExporter commented 9 years ago
Yes. I see g++ checking in configure output. It seems that configure.ac checks 
it
without any action. The Makefile is generated even g++ is missing.

logs are attached.

Original comment by hgn...@gmail.com on 3 Mar 2010 at 6:34

Attachments:

GoogleCodeExporter commented 9 years ago
Ah, I see what happens: configure decides to just use 'g++' as the compiler and 
hope 
for the best (maybe it just couldn't find g++ in its check but it still exists?)

I'm guessing there's a reason autotools sets things up that way, so maybe we 
shouldn't 
die if configure can't find g++, but instead print out a warning.  I'll think 
about it 
-- you're right it's not a very big deal, so I don't want to do anything too 
invasive.

Original comment by csilv...@gmail.com on 3 Mar 2010 at 8:22

GoogleCodeExporter commented 9 years ago
Sorry for my late reply. I just forgot this issue...

The problem was 'g++' hadn't been installed when configure, but it passed and
generated the Makefile.

Then I installed 'g++' after it complained.

Since Makefile had been generated without 'g++', something should be abnormal.

So I needed to re-run 'configure' to generate a right Makefile again.

I think 'configure' should not generate Makefile when 'g++' is missing. Not 
quite
sure. Maybe in configure's view, g++ is not the only compiler. That Makefile is 
for
general compilers. It should be a limitation rather then bug.

Cameron

Original comment by hgn...@gmail.com on 26 Mar 2010 at 6:47

GoogleCodeExporter commented 9 years ago
configure looks for any valid c++ compiler, not just g++.  The problem is you 
didn't 
have any c++ installed, that configure could find, so configure just decided to 
use 
g++ in the hopes it's there, and configure just missed it somehow.  That seems 
as good 
a behavior as any.

I may make it so configure dies if g++ isn't installed, but if the current 
behavior is 
good enough for the folks who wrote configure, maybe it's good enough for me. 
:-)

Original comment by csilv...@gmail.com on 26 Mar 2010 at 2:57

GoogleCodeExporter commented 9 years ago
I've discovered the bug in autoconf that makes it not die when it can't find 
g++:
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357378
There's a simple workaround (put the CXX check before the CC check).  I'll put 
it in the next release.

Original comment by csilv...@gmail.com on 31 Aug 2011 at 10:52

GoogleCodeExporter commented 9 years ago
This should be fixed in perftools 1.9, just released.

Original comment by csilv...@gmail.com on 23 Dec 2011 at 12:46