Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-20-2004, 11:54 AM   #1
LQ Newbie
Registered: Dec 2004
Location: Philippines
Distribution: Slackware v10.1 and Ubuntu v5.04
Posts: 27

Rep: Reputation: 15
Question error installing perl - c compiler not working

hi, everybody!

i have been trying to install perl on slackware v10.

after doing the following:

root@zipslack:~# gzip -d perl-5.8.1.tar.gz [ENTER]

root@zipslack:~# cp -i perl-5.8.1.tar /usr/src [ENTER]

root@zipslack:~# cd /usr/src [ENTER]

root@zipslack:/usr/src# tar xvf perl-5.8.1.tar [ENTER]

root@zipslack:/usr/src# cd perl-5.8.1 [ENTER]

root@zipslack:/usr/src/perl-5.8.1# rm -f [ENTER]

root@zipslack:/usr/src/perl-5.8.1# sh Configure [ENTER]

... I get the following error:

"... the C compiler 'cc' doesn't seem to be working. You need to find a working C compiler."

i already checked my installation of gcc. looks fine after i ran "gcc -v".

i can install using an slackware package but i want to install/compile from a compressed archive.

thanks in advance!
Old 12-20-2004, 12:36 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Ummmm ... why on earth are you trying to
install perl 5.8.1 from source when slack
comes with 5.8.4 as a tgz?

Old 12-20-2004, 12:37 PM   #3
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
Just out of curiosity, why do you remove the and scripts from the source tree?

As for the error, for some reason the configure script is looking for a C compiler called 'cc', when I believe that it *should* be looking for 'gcc'. Interesting error. I'm wondering if perl's source tree is OS independant, and you may need to tweak the configure script (or an environment variable) to get it to work properly.

Out of curiosity, why are you trying to build from source? I know slack packages exist for perl, and there is probably little to be gained out of compiling from source, other than the experience.

Old 12-20-2004, 03:59 PM   #4
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Symlink "cc" to "gcc". Probably

ln -s /usr/bin/gcc /usr/bin/cc

But it should already be there, so make sure /usr/bin is in you path as well.
Old 12-20-2004, 05:06 PM   #5
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
Here is how Slackware compiles Perl

# Build and install Perl on Slackware
# originally by:  David Cantrell <>
# maintained by:  <>


# IMPORTANT: also update -Dinc_version_list in ./configure below!


# Additional required modules:

if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then

if [ -x /usr/bin/perl ]; then
  echo "Perl detected."
  echo "It's a good idea to remove your existing perl first."
  sleep 15

# Clear build location:
rm -rf $PKG
mkdir -p $PKG

# Extract the source code:
cd $TMP
rm -rf perl-$VERSION
tar xjvf $CWD/perl-$VERSION.tar.bz2

# Change into the source directory:
cd perl-$VERSION

# Adjust owner/perms to standard values:
chown -R root.root .
find . -perm 555 -exec chmod 755 {} \;
find . -perm 444 -exec chmod 644 {} \;

# It is often suggested that we add this to the ./Configure:
#     -Dusethreads -Duseithreads \
# However, this option is considered experimental, and is not
# recommended for production systems.  As such, we can't add
# to our default perl build.  If you want the option anyway,
# just uncomment the lines below and rebuild perl.
# Update:  while it's no longer considered experimental (and
# yes, other vendors do ship threaded perl by default), enabling
# threads causes a huge (>20%) performance hit, and I've seen
# other reports of instability.  A few things "need" perl threads
# but usually that's simply because they were compiled against
# a threaded libperl... not any real need.  IMHO, shipping a
# threaded perl by default would not be a good idea.  It's only
# because everyone else does it that it's continually
# reconsidered here.
#USE_THREADS="-Dusethreads -Duseithreads"

# We no longer include suidperl.  To quote the INSTALL file:
#   Because of the buggy history of suidperl, and the difficulty
#   of properly security auditing as large and complex piece of
#   software as Perl, we cannot recommend using suidperl and the feature
#   should be considered deprecated.
#   Instead use for example 'sudo':

# Configure perl:
./Configure -de \
  -Dprefix=/usr \
  -Dcccdlflags='-fPIC' \
  -Dinstallprefix=/usr \
  -Doptimize="$SLKCFLAGS" \
  -Dinc_version_list='5.8.4 5.8.3 5.8.2 5.8.1 5.8.0' \

# Build perl
make -j3
make test

# Install perl (needed to build modules):
make install
( cd /usr/bin
  ln -sf perl$VERSION perl
  ln -sf c2ph pstruct
  ln -sf s2p psed

# Install perl package:
make install DESTDIR=$PKG

# Add additional modules:
( cd ext
  ( tar xzvf $CWD/DBI-${DBI}.tar.gz
    cd DBI-${DBI}
    chown -R root.root .
    perl Makefile.PL
    make test
    make install
    make install DESTDIR=$PKG
    mkdir -p $PKG/usr/doc/perl-$VERSION/DBI-${DBI}
    cp -a README $PKG/usr/doc/perl-$VERSION/DBI-${DBI}
    chmod 644 $PKG/usr/doc/perl-$VERSION/DBI-${DBI}/README
  ( tar xzvf $CWD/DBD-mysql-${DBDMYSQL}.tar.gz
    cd DBD-mysql-${DBDMYSQL}
    chown -R root.root .
    perl Makefile.PL
    make test
    make install
    make install DESTDIR=$PKG
    mkdir -p $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}
    cp -a INSTALL.html README TODO $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}
    chmod 644 $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}/*
  ( tar xzvf $CWD/XML-Parser-${XMLPARSER}.tar.gz
    cd XML-Parser-${XMLPARSER}
    chown -R root.root .
    perl Makefile.PL
    make test
    make install
    make install DESTDIR=$PKG
    mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}
    cp -a README $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}
    chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}/*

# Strip everything:
( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

# There are also miniperl and microperl.
# I haven't had any requests for them, but would be willing
# to consider adding one or both to the package if anyone
# actually needs them for some reason.
#make microperl

# Symlinks that replace hard links
( cd $PKG/usr/bin
  ln -sf perl$VERSION perl
  ln -sf c2ph pstruct
  ln -sf s2p psed )

# Install documentation
mkdir -p $PKG/usr/doc/perl-$VERSION
cp -a \

# We follow LSB with symlinks in /usr/share:
( cd $PKG/usr/share
  mv man .. )
( cd $PKG/usr/man/man1
  mkdir foo
  cp *.1 foo
  rm *.1
  mv foo/* .
  rmdir foo
  gzip -9 *
  ln -sf c2ph.1.gz pstruct.1.gz
  ln -sf s2p.1.gz psed.1.gz )
( cd $PKG/usr/man/man3
  gzip -9 * )

chown -R root.bin $PKG/usr/bin
chmod 755 $PKG/usr/bin/*
chmod 644 $PKG/usr/man/man?/*
rmdir $PKG/usr/share

# Insert the slack-desc:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Build the package:
cd $PKG
makepkg -l y -c n $TMP/perl-$VERSION-$ARCH-$BUILD.tgz
Hope you can makeout what's wrong with your method...
Old 01-09-2005, 12:06 AM   #6
LQ Newbie
Registered: Dec 2004
Location: Philippines
Distribution: Slackware v10.1 and Ubuntu v5.04
Posts: 27

Original Poster
Rep: Reputation: 15
ok now

1. thanks for the replies.

2. i traced the problem to dependencies. to remedy this, i re-installed make. in addition, i installed binutils and kernel-headers. the source did compile thereafter.

3. on why compile from the source when a slack package is available. i use slack packages most of the time. in fact, aside from the base components, i installed everything using packages i downloaded from the slack website. but it helps to know how to compile from the source because (1) the foss community as a whole moves faster than slackware and slackware may not have the components we need in packages we can use with installpkg the moment we think of installing them and (2) perl is one of two scripting languages i am now using. there are bonuses to learning to compile it.

4. again, many thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
installing cgi perl to get lynx working hypnotiks Linux - Newbie 1 12-19-2004 03:06 PM
I getting the error you must set the environmnet variable to a working compiler Devo174 Linux - Laptop and Netbook 1 06-08-2004 12:40 PM
Installing Gtk-Perl from Source Error AceTech747 Linux - Software 0 01-27-2004 10:18 PM
Urgent Help Needed! Error: Must set the environment variable CC to a working compiler MrCarl Linux - Software 3 09-23-2003 12:42 AM
Error - no gcc3 or cc compiler when installing source code bshelton Linux - General 1 09-16-2003 03:26 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:02 PM.

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