LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-18-2014, 11:36 AM   #1
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Rep: Reputation: Disabled
gcc -O missing?


I installed a new version of Slackware, installed GCC:

Code:
 slackpkg install gcc-4.8.2-x86_64-1
Then, when trying to install ocaml with:

Code:
sbopkg -i "ocaml ocaml-findlib"
the install fails with this message:
Code:
	ocaml-4.01.0/yacc/symtab.c
	ocaml-4.01.0/yacc/verbose.c
	ocaml-4.01.0/yacc/warshall.c
	patching file configure
	Configuring for a x86_64-slackware-linux-gnu ...
	gcc found
	Unable to compile the test program.
	Make sure the C compiler gcc -O  is properly installed.

I'm new to Slackware and cannot discern where the GCC package is located to see if the optimize capability for GCC was turned off.

Is optimization for GCC usually turned off? Is there a global setting I can use to activate it?
 
Old 12-18-2014, 12:01 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Was this a clean install or an upgrade from a previous system? Did you do a full install? Slackware works best when you do a full install. All Slackbuilds have been tested against the version of Slackware they are cleared for to make sure it works. Something is off with your box.
 
Old 12-18-2014, 12:11 PM   #3
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
It was an image from stacklet.com that I installed on my Debian Xen server.

Code:
Xen 3/Xen 4 	Slackware 	14.1 	242 	x86-64 	Slackware 14.1 Lightweight for Xen on x86-64
I had tried installing arch-linux and frankly in the last two days, I have found it difficult to segregate what distribution offers what. Given your suggestion about a "full" installation and that the image above is titled "Lightweight", I wonder if there is a method one can use to take a minimial install and load it up? I think it was arch-linux that had various flavors you could upgrade to, e.g. Emacs, "X" &etc., but I didn't find such categorization for Slackware. Is there such?
 
Old 12-18-2014, 01:13 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Just use slackpkg to upgrade and/or install all the packages. You'll need to edit /etc/slackpkg/mirrors and pick a mirror that holds Slackware64 14.1 (make sure you select a 64bit version!). To use that mirror, just remove the "#" in front of it. Then run the following. Once you're done and install-new is completed, you should be able to compile that program.

Code:
slackpkg update gpg       #only needed to run the first time you use the program
slackpkg update           #updates the internal system to know what packages and versions are available
slackpkg upgrade-all      #upgrades any outdated packages with the latest version
slackpkge install-new     #installs any packages in the official repo that aren't currently installed
One big difference between Arch and Slackware is Arch operates on a rolling release, which means they'll update various packages at various times never culminating in a release. Slackware has a -current tree which will run newer programs and is generally the testing ground for Slackware users, but it'll eventually lead to a release, the latest being 14.1. There is speculation that 14.2 is on the horizon, but only Pat knows when that may happen.

Slackware does have various categories that software falls into. You can see it during installation. But they not designed to be like Arch's. The categories include kernel, kde, xorg, libraries, development, etc
 
Old 12-18-2014, 02:22 PM   #5
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thank you. I was doing just what you had suggested when I found your posting. Just to be thorough, I have only one repository selected:
Code:
root@localhost:/usr/local/src# cat /etc/slackpkg/mirrors |egrep ^[^\#]
http://mirrors.us.kernel.org/slackware/slackware64-14.1/
root@localhost:/usr/local/src#
(I had selected several and then found the instruction that said "ONLY ONE" -- this differs from Gentoo's approach.)

I then executed the steps you provided and tried installing ocaml and got the same error message that caused me to create this posting. Perhaps the problem is with the installer sbopkg? Where would I find the packages being staged so I can go in and manually try ./configure and make to duplicate the error?
 
Old 12-18-2014, 02:52 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
That's weird, I just checked remotely (I love JuiceSSH on my phone) and both packages compiled successfully using the command you posted. Something is still wrong with your box :/ (I'm running 14.1 64bit)

Unless you changed the defaults, sbopkg programs are decompressed and compiled under /tmp/SBo/$PROGRAM-$VERSION and then the packages are "installed" under /tmp/SBo/package-$PROGRAM which is then used to create the package you install. The packages are then stored in the root /tmp directory (they'll be labelled as $PROGRAM-$VERSION-$ARCH-1_SBo.txz

If you continue to have issues, it may be worth just installing a full version of Slackware in your VM from the DVD iso. It isn't too difficult (contrary to popular belief -- text-based =/= difficult), and if you run into any issues, we can certainly help you out. See the wiki for a good tutorial (http://docs.slackware.com/slackware:install)
 
Old 12-18-2014, 08:16 PM   #7
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
You need gcc-g++ as well
It would be easier if you install all packages in d/

Last edited by willysr; 12-18-2014 at 08:17 PM.
 
Old 12-18-2014, 09:29 PM   #8
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by willysr View Post
You need gcc-g++ as well
It would be easier if you install all packages in d/
Without doing anything more, I installed gcc-g++-4.8.2-x86_64-1.txz and tried:
Code:
sbopkg -i "ocaml "
and got the same error message.

It looks like I'm going to have to do a full VN install. <grimace>
 
Old 12-18-2014, 10:59 PM   #9
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
jlpoole,
please see /tmp/SBo/ocaml-4.01.0/status.log for real cause of error, this file usually has the test source which doesn't compile, the full compile command and the compiler error message.

Often it is missing binutils package or something similar from d/.

Last edited by bormant; 12-18-2014 at 11:00 PM.
 
Old 12-18-2014, 11:09 PM   #10
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bormant View Post
jlpoole,
please see /tmp/SBo/ocaml-4.01.0/status.log for real cause of error, this file usually has the test source which doesn't compile, the full compile command and the compiler error message.

Often it is missing binutils package or something similar from d/.
Thank you, at least I now know where things are happening -- that is very helpful.
The Sbo session log shows (nothing new):
Code:
root@localhost:/tmp# tail -n 30 /var/log/sbopkg/sbopkg-build-log
patching file configure
Configuring for a x86_64-slackware-linux-gnu ...
gcc found
Unable to compile the test program.
Make sure the C compiler gcc -O  is properly installed.

ocaml:
Would you like to continue processing the rest of the
queue or would you like to abort?  If this failed
package is a dependency of another package in the queue
then it may not make sense to continue.

(Y)es to continue, (N)o to abort, (R)etry the build?: n

+++++++++++++++++++++++++++++++++++++++++++
SUMMARY LOG
Using the SBo repository for Slackware 14.1
Queue Process:  Download, build, and install

ocaml:
  MD5SUM check for ocaml-4.01.0.tar.xz ... OK
  MD5SUM check for ocaml-4.01-refman-html.tar.gz ... OK
  Error occurred with build.  Please check the log.

+++++++++++++++++++++++++++++++++++++++++++

###########################################
          Queue process complete!
###########################################

root@localhost:/tmp#
There are no logs under /tmp:

Code:
root@localhost:/tmp# pwd
/tmp
root@localhost:/tmp# find . -type f -name "*.log"
root@localhost:/tmp# ls
SBo/
root@localhost:/tmp# ls SBo/
ocaml-4.01.0/  package-ocaml/
root@localhost:/tmp#
 
Old 12-18-2014, 11:34 PM   #11
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Further Inspection Results

Armed with the helpful leads from other posters, I now know where the work area is and can commence a meaningful inquiry.

Here's the possible code sections that are complaining:

Code:
root@localhost:/tmp/SBo/ocaml-4.01.0# cat configure |grep -n -B 15 -A 3 Unable
351-esac
352-
353-# Configure compiler to use in further tests
354-
355-cc="$bytecc -O $bytecclinkopts"
356-export cc cclibs verbose
357-
358-# Check C compiler
359-
360-sh ./runtest ansi.c
361-case $? in
362-  0) echo "The C compiler is ANSI-compliant.";;
363-  1) echo "The C compiler $cc is not ANSI-compliant."
364-     echo "You need an ANSI C compiler to build OCaml."
365-     exit 2;;
366:  *) echo "Unable to compile the test program."
367-     echo "Make sure the C compiler $cc is properly installed."
368-     exit 2;;
369-esac
370-
371-# Check the sizes of data types
372-
373-echo "Checking the sizes of integers and pointers..."
374-set `sh ./runtest sizes.c`
375-case "$2,$3" in
376-  4,4) echo "OK, this is a regular 32 bit architecture."
377-       echo "#undef ARCH_SIXTYFOUR" >> m.h
378-       arch64=false;;
379-  *,8) echo "Wow! A 64 bit architecture!"
380-       echo "#define ARCH_SIXTYFOUR" >> m.h
381-       arch64=true;;
382-  *,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
383-       echo "OCaml won't run on this architecture."
384-       exit 2;;
385:    *) echo "Unable to compile the test program."
386-       echo "Make sure the C compiler $cc is properly installed."
387-       exit 2;;
388-esac
root@localhost:/tmp/SBo/ocaml-4.01.0#
So I tried this and see now what may be the cause of the problem:
Code:
root@localhost:/tmp/SBo/ocaml-4.01.0# ./configure --verbose
Configuring for a x86_64-unknown-linux-gnu ...
gcc found
runtest: gcc -O  -o tst ansi.c
/usr/libexec/gcc/x86_64-slackware-linux/4.8.2/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
Unable to compile the test program.
Make sure the C compiler gcc -O  is properly installed.
root@localhost:/tmp/SBo/ocaml-4.01.0#
Turns out the GNU Multiprecision library is required and was not installed on my system. So I installed it:
Code:
slackpkg install libmpc
That seems to have fixed that error/ommission, to wit the error that brought me to creating this thread. Now I have another hurdle to face:

Code:
root@localhost:/tmp/SBo/ocaml-4.01.0# ./configure --verbose
Configuring for a x86_64-unknown-linux-gnu ...
gcc found
runtest: gcc -O  -o tst ansi.c
gcc: error trying to exec 'as': execvp: No such file or directory
Unable to compile the test program.
Make sure the C compiler gcc -O  is properly installed.
root@localhost:/tmp/SBo/ocaml-4.01.0#
 
Old 12-18-2014, 11:56 PM   #12
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
Please note that gcc cannot execute "as", and it is part of binutils, as I remember. If
ls /var/adm/packages/binutils-*
says that no this file,
# slackpkg install binutils
does the trick.
 
Old 12-19-2014, 12:10 AM   #13
jlpoole
LQ Newbie
 
Registered: Dec 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
Bingo! The problem is, indeed, my environment is incomplete.

bormant's suggestion proved valuable:
Code:
root@localhost:/tmp/SBo/ocaml-4.01.0/config/auto-aux# slackpkg search binutil

Looking for binutil in package list. Please wait... DONE

The list below shows all packages with name matching "binutil".

[uninstalled] - binutils-2.23.52.0.1-x86_64-2

You can search specific files using "slackpkg file-search file".


root@localhost:/tmp/SBo/ocaml-4.01.0/config/auto-aux# slackpkg install binutils
...
I then proceeded with the original install:

Code:
root@localhost:/tmp# sbopkg -i "ocaml ocaml-findlib"

... [good things happening] ...

** OCaml configuration completed successfully **

ocaml.SlackBuild.build: line 80: make: command not found

ocaml:
Shoot... not even "make" was installed. At this point I'm going to roll up my sleeves and do what had been earlier suggested: build a complete environment from scratch. <sigh, but at least I've determined the problem thanks to the collective help of everyone who contributed here.>

Thank you all!
 
Old 12-19-2014, 12:21 AM   #14
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
Quote:
Originally Posted by jlpoole View Post
Shoot... not even "make" was installed. At this point I'm going to roll up my sleeves and do what had been earlier suggested: build a complete environment from scratch.
Why from scratch?

# slackpkg install d
and unselect unneeded, may be objc, ada, cobol and so on if you know what are you doing :-)

# slackpkg install l
and don't unselect anything, if you know what I mean.

PS. "l" is lowcase L, not i. d and l is the series names, so slackpkg will offer uninstalled packages from these series. If you feel brave you can specify more than one series (or package name) at a time and sort things out by hands...

Last edited by bormant; 12-19-2014 at 12:26 AM.
 
Old 12-19-2014, 03:15 AM   #15
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
or even better,
Code:
slackpkg install slackware
 
  


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
What happens if GCC is missing in Linux Ragunath Linux - Newbie 7 11-22-2012 09:33 AM
GCC missing? me! Linux - Software 11 09-01-2006 09:52 AM
Gcc Missing???? dj9928 Linux - Software 2 04-16-2005 11:02 AM
missing gcc, cc, and cl hpglow Linux - Newbie 3 07-23-2003 01:07 PM
gcc missing?? cmoloney Linux - Software 3 05-18-2003 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:09 AM.

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