Opened 11 years ago

Closed 10 years ago

#67 closed enhancement (fixed)

Running configure without g++ => cryptic error

Reported by: plb Owned by: andreasw
Priority: trivial Component: configuration tests
Version: 0.5 Keywords: configure g++
Cc:

Description

While setting up bcp (with CoinUtils?? 2.2.5), I ran into the following problem :

configure: error: Cannot find integer type with 64 bits configure: error: /bin/bash '../../CoinUtils?/configure' failed for CoinUtils?

I'm enclosing config.log.

I tried several times. I had gcc installed, but not g++. I set up g++ and ran configure, and it went just fine. I'm enclosing the config.log of the successful run. If the failure was indeed caused by the absence of g++, it might be useful to make the error message more specific.

Attachments (4)

config.log_without_g++ (33.9 KB) - added by plb 11 years ago.
config.log_with_g++ (37.1 KB) - added by plb 11 years ago.
config.log_without_g++_coinutils (63.2 KB) - added by plb 11 years ago.
config.log_without_g++_CXX=gcc (32.2 KB) - added by plb 11 years ago.

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by plb

Changed 11 years ago by plb

comment:1 Changed 11 years ago by stefan

Does it work when you specify CXX=gcc as flag for configure?

Can you attach also the config.log from the CoinUtils? subdirectory?

Changed 11 years ago by plb

Changed 11 years ago by plb

comment:2 in reply to: ↑ description Changed 11 years ago by plb

I've added config.log from the coinutils directory. I've also tried configuring with CXX=gcc, but I still get an error (a different one though):

checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

The corresponding config.log is attached.

comment:3 follow-up: Changed 11 years ago by stefan

For the one with CXX=gcc, there seem to be a problem running your C++ preprocessor: From your attached config.log file:

configure:7299: /lib/cpp  conftest.cc
cpp: error trying to exec 'cc1plus': execvp: No such file or directory

Can you make sure that cpp works? Or, if /lib/cpp is not the preprocessor you want the build system to use, then you can overwrite it with the CPP=... configure parameter.

Best, Stefan

comment:4 Changed 11 years ago by stefan

For the configure run without CXX=gcc, it looks like the AC_PROG_CXX macro of autoconf automatically sets CXX to g++ if it cannot find a C++ compiler, see https://projects.coin-or.org/CoinUtils/browser/releases/2.2.5/CoinUtils/configure#L3276

Thus, the lines

AC_PROG_CXX([$comps])
if test -z "$CXX" ; then
  AC_MSG_ERROR([Failed to find a C++ compiler!])
fi

in coin.m4/AC_COIN_PROG_CXX does not catch the error, since $CXX will be g++, even though g++ might not work.
Unfortunately, according to the autoconf manual, this seem to be even a desired behaviour, not a bug.

Any idea how to get around this? Should there be an extra test in AC_COIN_PROG_CXX that tests whether the C++ compiler actually works?

Best, Stefan

comment:5 in reply to: ↑ 3 ; follow-ups: Changed 11 years ago by plb

Can you make sure that cpp works?

I can still compile C code with gcc and it runs as expected, so I suppose cpp works properly. I also used cpp on a dummy file and the output looked preprocessed.

Any idea how to get around this?

An additional test seems like a good idea. Anything that would make the error more specific would be fine :)

Best, P

comment:6 in reply to: ↑ 5 Changed 11 years ago by stefan

Hi,

Can you make sure that cpp works?

I can still compile C code with gcc and it runs as expected, so I suppose cpp works properly. I also used cpp on a dummy file and the output looked preprocessed.

But why did the call to /lib/cpp made a problem then? Is /lib the location of the cpp that you tested? It seem to be a strange place for an exectuable to me.

Stefan

comment:7 follow-up: Changed 11 years ago by plb

$ whereis cpp
cpp: /usr/bin/cpp /lib/cpp /usr/share/man/man1/cpp.1.gz
$ diff /lib/cpp /usr/bin/cpp
$

Both files are identical, and I manually rechecked /lib/cpp . I'm no expert but it seems to work. If configure works with g++, it means than cpp works too, right?

comment:8 in reply to: ↑ 7 Changed 11 years ago by stefan

Replying to plb:

$ whereis cpp
cpp: /usr/bin/cpp /lib/cpp /usr/share/man/man1/cpp.1.gz
$ diff /lib/cpp /usr/bin/cpp
$

Both files are identical, and I manually rechecked /lib/cpp . I'm no expert but it seems to work.

But strange that /lib/cpp then does not work when called from inside configure.
I don't know what to do about the execvp: No such file or directory problem. I don't think it is a problem with configure in this case.
Could $PATH be different when cpp is called from inside configure? Maybe a different shell is used where environment variables are different?

If configure works with g++, it means than cpp works too, right?

Yes, but you don't even have g++. ;-)

Stefan

comment:9 in reply to: ↑ 5 Changed 11 years ago by stefan

Replying to plb:

Any idea how to get around this?

An additional test seems like a good idea. Anything that would make the error more specific would be fine :)

The test whether /lib/cpp works with the message "C++ preprocessor "/lib/cpp" fails sanity check" seem to be sufficient to me. Of course, one need to look into config.log to see what exactly went wrong.

I added a test that checks whether the C++ compiler actually works (https://projects.coin-or.org/BuildTools/changeset/1168), so it should stop with a more meaningful message than "Cannot find integer type with 64 bits". It is currently only in BuildTools/trunk. If it does not seem to break other things, it should make it into stable and releases some day.

Best, Stefan

comment:10 Changed 11 years ago by plb

I do have g++ now, it's just that when I first got the error, I thought I had it installed already, and I didn't see what could be the problem. Each time I have been testing stuff for this ticket, I have removed g++, then tested and installed it back -.- It's just that I don't want future users to spend time figuring out what "cannot find integer type with 64 bits" means :/ It's ok now that it's going to be fixed. Thanks for your time :)

Best, Pierre

comment:11 Changed 10 years ago by andreasw

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.