LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   C++ compiler cannot create executables (http://www.linuxquestions.org/questions/linux-software-2/c-compiler-cannot-create-executables-866801/)

adam_hartlepool 03-06-2011 01:53 PM

C++ compiler cannot create executables
 
Hi there, i'm trying to compile a programme (a library of particle data) for a third year project at university. However I am receiving the above error after using: ./configure --prefix /Applications/CLHEP

I have very little experience with this system so any help would be greatly appreciated.


Below is all the text contained within the config.log. So sorry if not all is needed however like I said I have very little experience.

Thanks :)

Quote:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by CLHEP configure 2.0.4.5, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ ./configure --prefix /Applications/CLHEP

## --------- ##
## Platform. ##
## --------- ##

hostname = nas56-34.york.ac.uk
uname -m = i386
uname -r = 10.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386

/usr/bin/uname -p = i386
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = Mach kernel version:
Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 2.00 gigabytes
Default processor set: 53 tasks, 228 threads, 2 processors
Load average: 0.40, Mach factor: 1.59
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1318: checking build system type
configure:1336: result: i686-apple-darwin10.5.0
configure:1344: checking host system type
configure:1358: result: i686-apple-darwin10.5.0
configure:1366: checking target system type
configure:1380: result: i686-apple-darwin10.5.0
configure:1409: checking for a BSD-compatible install
configure:1464: result: /usr/bin/install -c
configure:1475: checking whether build environment is sane
configure:1518: result: yes
configure:1583: checking for gawk
configure:1612: result: no
configure:1583: checking for mawk
configure:1612: result: no
configure:1583: checking for nawk
configure:1612: result: no
configure:1583: checking for awk
configure:1599: found /usr/bin/awk
configure:1609: result: awk
configure:1619: checking whether make sets $(MAKE)
configure:1639: result: yes
configure:1820: checking for a BSD-compatible install
configure:1875: result: /usr/bin/install -c
configure:1886: checking whether ln -s works
configure:1890: result: yes
configure:1938: checking for ranlib
configure:1954: found /usr/bin/ranlib
configure:1965: result: ranlib
configure:2142: checking for cl
configure:2171: result: no
configure:2142: checking for g++
configure:2158: found /usr/bin/g++
configure:2168: result: g++
configure:2184: checking for C++ compiler version
configure:2187: g++ --version </dev/null >&5
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2190: $? = 0
configure:2192: g++ -v </dev/null >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
configure:2195: $? = 0
configure:2197: g++ -V </dev/null >&5
g++-4.2: argument to `-V' is missing
configure:2200: $? = 1
configure:2223: checking for C++ compiler default output file name
configure:2226: g++ conftest.cc >&5
cc1plus: error: /usr/local/include: Permission denied
configure:2229: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "CLHEP"
| #define PACKAGE_TARNAME "clhep"
| #define PACKAGE_VERSION "2.0.4.5"
| #define PACKAGE_STRING "CLHEP 2.0.4.5"
| #define PACKAGE_BUGREPORT "http://savannah.cern.ch/projects/clhep/ "
| #define PACKAGE "clhep"
| #define VERSION "2.0.4.5"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2268: error: C++ compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-apple-darwin10.5.0
ac_cv_build_alias=i686-apple-darwin10.5.0
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-apple-darwin10.5.0
ac_cv_host_alias=i686-apple-darwin10.5.0
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_make_make_set=yes
ac_cv_target=i686-apple-darwin10.5.0
ac_cv_target_alias=i686-apple-darwin10.5.0

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run aclocal-1.9'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run tar'
AM_CXXFLAGS=''
AM_LDFLAGS=''
AR=''
ARFLAGS=''
AUTOCONF='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run autoconf'
AUTOHEADER='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run autoheader'
AUTOMAKE='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run automake-1.9'
AWK='awk'
BUILD_SHARED_FALSE=''
BUILD_SHARED_TRUE=''
BUILD_STATIC_FALSE=''
BUILD_STATIC_TRUE=''
BUILD_VISUAL_FALSE=''
BUILD_VISUAL_TRUE=''
COPY_P=''
CPPFLAGS=''
CXX='g++'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DIFF_Q=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKEINFO='${SHELL} /Applications/CLHEP/2.0.4.5/CLHEP/missing --run makeinfo'
MY_LD=''
MY_SHEXTRA=''
MY_SHFLAGS=''
MY_SHLINK=''
MY_SHNAME=''
OBJEXT=''
PACKAGE='clhep'
PACKAGE_BUGREPORT='http://savannah.cern.ch/projects/clhep/ '
PACKAGE_NAME='CLHEP'
PACKAGE_STRING='CLHEP 2.0.4.5'
PACKAGE_TARNAME='clhep'
PACKAGE_VERSION='2.0.4.5'
PATH_SEPARATOR=':'
RANLIB='ranlib'
SET_MAKE=''
SHELL='/bin/sh'
SHEXT=''
STRIP=''
USE_GMAKE_FALSE=''
USE_GMAKE_TRUE=''
VERSION='2.0.4.5'
ac_ct_CXX='g++'
ac_ct_RANLIB='ranlib'
ac_ct_STRIP=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-apple-darwin10.5.0'
build_alias=''
build_cpu='i686'
build_os='darwin10.5.0'
build_vendor='apple'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-apple-darwin10.5.0'
host_alias=''
host_cpu='i686'
host_os='darwin10.5.0'
host_vendor='apple'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/Applications/CLHEP/2.0.4.5/CLHEP/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='$(install_sh) -d'
oldincludedir='/usr/include'
prefix='/Applications/CLHEP'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=' Units Vector Evaluator GenericFunctions Geometry Random Matrix RandomObjects RefCount Cast Exceptions'
sysconfdir='${prefix}/etc'
target='i686-apple-darwin10.5.0'
target_alias=''
target_cpu='i686'
target_os='darwin10.5.0'
target_vendor='apple'
use_exceptions='#undef ENABLE_ZOOM_EXCEPTIONS'

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "clhep"
#define PACKAGE_BUGREPORT "http://savannah.cern.ch/projects/clhep/ "
#define PACKAGE_NAME "CLHEP"
#define PACKAGE_STRING "CLHEP 2.0.4.5"
#define PACKAGE_TARNAME "clhep"
#define PACKAGE_VERSION "2.0.4.5"
#define VERSION "2.0.4.5"

configure: exit 77

paulsm4 03-06-2011 11:32 PM

As if you expect *anything* running on any Apple product to work in a standard, conformant way. Or play nice with any non-Apple hardware or software of any kind. Hah ;)

The problem is that your script expects a standard Gnu environment: like *nix, Linux, NetBSD, Solaris, MinGW ... just about *anything* besides OSX.

Suggestion: see if there's a mail group or some kind of forum from the site where you got this software, and see if anybody's ever built it successfully on a Mac. The basic problem is that the Mac's g++ build environment appears to be too alien for the configure script (and, quite probably, for any subsequent makefile) to deal with.

Sorry .. PSM

PS:
Another alternative is maybe you can find a pre-built binary for your Mac, e.g. here.

comp_brad1136 03-07-2011 12:06 AM

I tend to kill apples, but there is ONE LINE in all that stuff that makes me want to investigate...
Code:

cc1plus: error: /usr/local/include: Permission denied
I would take a look to see what cc1plus does, to see what include does, then find out why permission is denied. I would likely bet that this has to do with the linker being a pain.

As far as compiler not making executables... can it make hello world?

paulsm4 03-07-2011 12:53 AM

Hi, comp_brad1136 -

That's precisely what his "configure" script is attempting to do: compile a "hello world". And it's failing. Probably for several different reasons - all of them having to do with idiosyncrasies in the Mac environment.

"cc1plus" is part of the g++ c compiler.

I did a Google for "/usr/local/include: Permission denied". And guess what - I only came up with Mac-related hits ;)

I remember when the movie "Independence Day" came out (it's on continuous replay on cable these days). Audiences were amazed at how easily Jeff Goldblum was able to hack into the alien mothership with his Mac iBook. Because there was no such thing as a Mac interfacing to any *terrestrial* computer ;)

comp_brad1136 03-07-2011 07:27 AM

why would hello world be running a configure?

what I had in mind was gcc -o hello hello.c

I also found the same thing about include. But, how is a budding programmer to learn if we all simply hand out answers w/o giving them a starting point to look for? That's just my take on things. Either way, it's a rotten apple. :-D

prushik 03-07-2011 08:30 AM

Quote:

Originally Posted by comp_brad1136 (Post 4281445)
why would hello world be running a configure?

what I had in mind was gcc -o hello hello.c

I also found the same thing about include. But, how is a budding programmer to learn if we all simply hand out answers w/o giving them a starting point to look for? That's just my take on things. Either way, it's a rotten apple. :-D

One of the things that most configure scripts do is compile a "hello world" program and run it to check that the compiler is working, it will skip that step if it detects that it is cross-compiling however.

If /usr/local/include does not have the right permissions, that would not affect the linker, but the compiler instead, it would explain why configure is failing to build its test executable.

adam_hartlepool 03-08-2011 05:09 AM

Quote:

Originally Posted by paulsm4 (Post 4281114)
As if you expect *anything* running on any Apple product to work in a standard, conformant way. Or play nice with any non-Apple hardware or software of any kind. Hah ;)

Yes I'm starting to think that this is the case. What i'm actually trying to do is compile and install CLHEP which is a library of partile information for a physics project. I know it should work as I am following a tutorial designed for the MAC OSX system. But as you can see i'm having problems! I shall try and run a simple bit of code like 'hello world' and see what happens!

I think I can bypass his problem with 'sudo' but should I really have to!? Seems a bit annoying. Thanks for all of the suggestions so far!


EDIT: Ok I have logged in as the root user and now everything works fine. So I guess I will have to make do with that unless anyone knows how to get around this annoying permissions problem? Thanks!

prushik 03-08-2011 08:30 AM

Quote:

Originally Posted by adam_hartlepool (Post 4282566)
Yes I'm starting to think that this is the case. What i'm actually trying to do is compile and install CLHEP which is a library of partile information for a physics project. I know it should work as I am following a tutorial designed for the MAC OSX system. But as you can see i'm having problems! I shall try and run a simple bit of code like 'hello world' and see what happens!

I think I can bypass his problem with 'sudo' but should I really have to!? Seems a bit annoying. Thanks for all of the suggestions so far!


EDIT: Ok I have logged in as the root user and now everything works fine. So I guess I will have to make do with that unless anyone knows how to get around this annoying permissions problem? Thanks!

Now, I'm not a mac user or owner or anything, I don't like them nor the company that created them. So I don't have any experience really with how they work (besides Darwin). So this is from a pure Linux user's perspective:
I see no problem with changing the permissions on /usr/local/include
That should solve your problems. In some Linux distributions, /usr/local/include is only for software compiled by the user, so maybe if you installed some library from source as root by mistake one time it could have set the permissions on /usr/local/include like that, or maybe it's the standard OS X way, I don't know.


All times are GMT -5. The time now is 04:08 PM.