LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-05-2006, 08:55 AM   #1
teoz
LQ Newbie
 
Registered: Jan 2006
Location: San Grato
Distribution: Slackware, Debian, SuSe, FreeBSD
Posts: 7

Rep: Reputation: 0
red hat as 3 compiling problem


Hi, I got a VPS with RedHat AS 3 on it.
I want to compile and install programs from sources, but I didn't find any SRPM's for the specific program. So I tried compile directly from program's web-site downloaded sources, but it doesn't work.
uname states that mine is a i386 i686 arch, and the source supports it.

When I try to configure that is the output:
./configure
-bash: ./configure: /bin/sh: bad interpreter: Permission denied
but permissions are ok

So I tried:
/bin/sh configure
and that's work for a while then it stops:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
creating target.h - canonical system defines
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

After that configure and other file with execute permissions simply vanish.

Did I miss something?

Maybe it's a silly question but at the moment I can't understand why it doesn't work.

Thanx in advance!
 
Old 06-05-2006, 03:41 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Some ideas.
What's the output of ' ls -la /bin/sh ' minus the '' of course?
I know you have limited use of posting weblinks but post what you can to a file you are working on.

Brian1
 
Old 06-06-2006, 02:26 AM   #3
teoz
LQ Newbie
 
Registered: Jan 2006
Location: San Grato
Distribution: Slackware, Debian, SuSe, FreeBSD
Posts: 7

Original Poster
Rep: Reputation: 0
ls -al /bin/sh
lrwxr-xr-x 1 root root 4 Mar 31 23:22 /bin/sh -> bash

I tried with some SRPM packet of another program and it works. But since I didn't find any SRPM's about this one I need I have to use the sources.

Any ideas?

Quote:
Originally Posted by Brian1
Some ideas.
What's the output of ' ls -la /bin/sh ' minus the '' of course?
I know you have limited use of posting weblinks but post what you can to a file you are working on.

Brian1
 
Old 06-06-2006, 05:10 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try
Code:
ls -la /bin/bash
ls -la /path/to/configure
where you change the second path to match that of the "configure" tool you're having trouble with.
Also please paste the line starting with #! at the top of "configure".

By "VPS" do you mean "Virtual Private Server", ie some kind of virtualization technology?
Maybe you need special compilation options for such a system. Not sure though, since I've never used one myself.
 
Old 06-06-2006, 10:07 AM   #5
teoz
LQ Newbie
 
Registered: Jan 2006
Location: San Grato
Distribution: Slackware, Debian, SuSe, FreeBSD
Posts: 7

Original Poster
Rep: Reputation: 0
ls -al /bin/bash
-rwxr-xr-x 1 root root 610488 Feb 21 2005 /bin/bash

ls -al configure
-rwxr-xr-x 1 1000 1000 478167 Apr 29 22:00 configure

I changed owner and group to root and it compile for a while then stops for errors.
But I compiled program from source before and I've never had to change owner and group...
However this is not the point. The actual problem is that it doesn't compile!
Even before changing permission i managed to start compilig by running:
/bin/sh configure.
But it stops compiling.

Yes VPS = Virtual Private Server. I don't know if there are option to compile under that system.
But does a source RPM know whether or not the system is a VPS or a "real" server, and "normal" source code not designed specifically for this system doesn't know that at all?
Actually is a friend of mine's problem. He asked me to solve this problem, I'm an average linux user, my distro is Slack and I've never had problems compiling from source, at least some config paramethers or missing libraries, but not:
"checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details."

Here there is the config.log file:
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by -bash, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ -bash 

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

hostname = 213-215-227-36.vps.dnshosting.it
uname -m = i686
uname -r = 2.6.8-022stab070.9-enterprise
uname -s = Linux
uname -v = #1 SMP Thu Apr 20 10:48:12 MSD 2006

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

/bin/arch              = i686
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/kerberos/sbin
PATH: /usr/kerberos/bin
PATH: //sbin
PATH: //bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /root/bin


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

-bash:1531: checking build system type
-bash:1549: result: i686-pc-linux-gnu
-bash:1557: checking host system type
-bash:1571: result: i686-pc-linux-gnu
-bash:1579: checking target system type
-bash:1593: result: i686-pc-linux-gnu
-bash:1664: result: creating target.h - canonical system defines
-bash:1808: checking for a BSD-compatible install
-bash:1863: result: /usr/bin/install -c
-bash:1874: checking whether build environment is sane
-bash:1917: result: yes
-bash:1941: WARNING: `missing' script is too old or missing
-bash:1982: checking for gawk
-bash:1998: found //bin/gawk
-bash:2008: result: gawk
-bash:2018: checking whether make sets $(MAKE)
-bash:2038: result: yes
-bash:2219: checking for gawk
-bash:2245: result: gawk
-bash:2301: checking for gcc
-bash:2317: found /usr/bin/gcc
-bash:2327: result: gcc
-bash:2571: checking for C compiler version
-bash:2574: gcc --version </dev/null >&5
gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
Copyright (C) 2004 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.

-bash:2577: $? = 0
-bash:2579: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.5/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
-bash:2582: $? = 0
-bash:2584: gcc -V </dev/null >&5
gcc: `-V' option must have argument
-bash:2587: $? = 1
-bash:2610: checking for C compiler default output file name
-bash:2613: gcc    conftest.c  >&5
-bash:2616: $? = 0
-bash:2662: result: a.out
-bash:2667: checking whether the C compiler works
-bash:2673: ./a.out
-bash: ./a.out: Permission denied
-bash:2676: $? = 126
-bash:2685: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

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

ac_cv_build=i686-pc-linux-gnu
ac_cv_build_alias=i686-pc-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_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_exeext=
ac_cv_host=i686-pc-linux-gnu
ac_cv_host_alias=i686-pc-linux-gnu
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
ac_cv_target=i686-pc-linux-gnu
ac_cv_target_alias=i686-pc-linux-gnu

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

ACLOCAL='aclocal-1.9'
ADDITIONAL_LIBS=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='tar'
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.9'
AWK='gawk'
BUILD_CLAMD_FALSE=''
BUILD_CLAMD_TRUE=''
CC='gcc'
CCDEPMODE=''
CFGDIR=''
CFLAGS=''
CLAMAVGROUP=''
CLAMAVUSER=''
CLAMAV_MILTER_LIBS=''
CLAMD_LIBS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DBDIR=''
DEFS=''
DEPDIR=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FRESHCLAM_LIBS=''
GETENT=''
HAVE_MILTER_FALSE=''
HAVE_MILTER_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LIBCLAMAV_LIBS=''
LIBCLAMAV_VERSION='1:17:0'
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO='makeinfo'
OBJEXT=''
PACKAGE='clamav'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
TH_SAFE=''
VERSION='0.88.2'
ac_ct_CC='gcc'
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/tmp/clamav-0.88.2/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sendmailprog=''
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='i686-pc-linux-gnu'
target_alias=''
target_cpu='i686'
target_os='linux-gnu'
target_vendor='pc'

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

#define PACKAGE "clamav"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define VERSION "0.88.2"

-bash: exit 1
That's it. I changed owner and group at every file in the program's directory.
Thanx again for help, hope not boring you.

Quote:
Originally Posted by timmeke
Try
Code:
ls -la /bin/bash
ls -la /path/to/configure
where you change the second path to match that of the "configure" tool you're having trouble with.
Also please paste the line starting with #! at the top of "configure".

By "VPS" do you mean "Virtual Private Server", ie some kind of virtualization technology?
Maybe you need special compilation options for such a system. Not sure though, since I've never used one myself.
 
Old 06-07-2006, 03:11 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
-bash:2613: gcc conftest.c >&5
-bash:2616: $? = 0
-bash:2662: result: a.out
-bash:2667: checking whether the C compiler works
-bash:2673: ./a.out
-bash: ./a.out: Permission denied
So, gcc works just fine and it produces an "a.out" file. Only problem seems that "a.out" won't run.
Compiling as root should make it run, at least if it has execute (x) permission.

Can you do an "ls -l" on the a.out file (if it wasn't thrown away)?

What is your umask setting?
 
Old 06-07-2006, 07:55 AM   #7
teoz
LQ Newbie
 
Registered: Jan 2006
Location: San Grato
Distribution: Slackware, Debian, SuSe, FreeBSD
Posts: 7

Original Poster
Rep: Reputation: 0
umask -S
u=rwx,g=rx,o=rx
umask
0022

a.out doesn't exist!
For sake of knowledge I tried to compile another program and it gave me the same error, but I found the same program's version as SRPM e it compile! (and install as well)
I diff the two configure and are the same! No differences!
How can you explain that?
Next step I will try to autoconf-automake my program's sources to test if doing so it works. I will see this evening 'cause now I'm at work and for security reasons door are closed. (my friend has run commands above, I gave him instructions by phone!)

Quote:
Originally Posted by timmeke
So, gcc works just fine and it produces an "a.out" file. Only problem seems that "a.out" won't run.
Compiling as root should make it run, at least if it has execute (x) permission.

Can you do an "ls -l" on the a.out file (if it wasn't thrown away)?

What is your umask setting?
 
Old 06-08-2006, 03:03 AM   #8
teoz
LQ Newbie
 
Registered: Jan 2006
Location: San Grato
Distribution: Slackware, Debian, SuSe, FreeBSD
Posts: 7

Original Poster
Rep: Reputation: 0
Now it works, the problem is that I was compiling sources on a partition with noexec set (according to /etc/mtab)!
Sorry, I thought it was something stupid!
Thanx again!

Quote:
Originally Posted by teoz
umask -S
u=rwx,g=rx,o=rx
umask
0022

a.out doesn't exist!
For sake of knowledge I tried to compile another program and it gave me the same error, but I found the same program's version as SRPM e it compile! (and install as well)
I diff the two configure and are the same! No differences!
How can you explain that?
Next step I will try to autoconf-automake my program's sources to test if doing so it works. I will see this evening 'cause now I'm at work and for security reasons door are closed. (my friend has run commands above, I gave him instructions by phone!)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling modules issues. Red Hat 8.0 Rtl8139.c silverbear Programming 1 02-24-2004 02:06 AM
Compiling Kernel in Red Hat 9 quovadismaximus Linux - Newbie 2 09-29-2003 11:02 AM
red hat 9.0.93. -beta red hat 10-xmms problem ronss Red Hat 1 09-08-2003 04:00 AM
compiling c++ on red hat linux 9 eschneid Linux - Software 5 05-11-2003 11:45 AM
compiling red hat 8.0 kernel? menahem Linux - Software 1 03-22-2003 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration