LinuxQuestions.org
Review your favorite Linux distribution.
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 01-01-2012, 04:27 PM   #1
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Rep: Reputation: 4
Clang/LLVM Install Within Slackware?


I would like to install the Clang/LLVM compiler suite within Slackware since I use it as my default C compiler for my C programming assignments. I am currently building it within a build directory inside /usr/local/src (/usr/local/src/build) and wish to install it after compiling. I am following the build instructions on the Clang website:

http://clang.llvm.org/get_started.html

./configure and make are doing what I expect but there are no instructions for "make install" on the clang website at the end. Should I run make install and if yes within the build directory or elsewhere? The actual source code is in /usr/local/src/llvm. Should I have created the build directory in /usr/local/bin instead? Can I just move it to /usr/local/bin after make finishes?

Slackware newbie here. I mostly installed prepackaged software in other distros before (Debian/Ubuntu and Fedora).

Thanks.

Last edited by haziz; 01-01-2012 at 04:53 PM.
 
Old 01-01-2012, 04:51 PM   #2
BlackRider
Member
 
Registered: Aug 2011
Posts: 295

Rep: Reputation: 101Reputation: 101
You can use an SlackBuild to automatically make a package from the source code.

Read this:

http://slackbuilds.org/howto/

And then head here:

http://slackbuilds.org/repository/13...elopment/llvm/

And download the source and the SlackBuild script.

Last edited by BlackRider; 01-01-2012 at 04:52 PM.
 
Old 01-01-2012, 06:04 PM   #3
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by BlackRider View Post
You can use an SlackBuild to automatically make a package from the source code.

Read this:

http://slackbuilds.org/howto/

And then head here:

http://slackbuilds.org/repository/13...elopment/llvm/

And download the source and the SlackBuild script.
Thanks. When the SlackBuilds insctructions tells me to:

"This optionally builds with the clang compiler. In order to
enable building clang you have to pass CLANG=yes to the script."

How do I pass CLANG=yes to the script? Should I pass it at the command line:

./llvm.SlackBuild CLANG=yes

or more likely alter this line in the shell script from:

CLANG=${CLANG:-no}

to:

CLANG=${CLANG:-yes}

or should I just have a:

CLANG=yes

line near the top of the script? If the latter is true, should I also comment out the "CLANG=${CLANG:-no}" line from the script?

Also any harm to rerunning the script since I did not run it with CLANG=yes initially?

Sorry for my newbie level questions.

Thanks.
 
Old 01-01-2012, 09:03 PM   #4
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Here's what you want:
Code:
CLANG=yes sh llvm.SlackBuild
No modifications to the script at all.
 
Old 01-01-2012, 10:20 PM   #5
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by rworkman View Post
Here's what you want:
Code:
CLANG=yes sh llvm.SlackBuild
No modifications to the script at all.
Thanks. Any issues with rerunning it since I have already tried to modify the script and installed clang? It seemed to install both clang and llvm but I am still unable to access them. They are in /usr/bin as best as I can tell which is within my path.

Thanks.

Sincerely,

Hany.
 
Old 01-02-2012, 01:44 AM   #6
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
If you modified the script to say "CLANG=yes" then you shouldn't need to re-run it.

Did you actually install the resulting package after it built?
 
Old 01-02-2012, 03:56 AM   #7
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by rworkman View Post
If you modified the script to say "CLANG=yes" then you shouldn't need to re-run it.

Did you actually install the resulting package after it built?
Thanks.

So I still have to invoke pkgtool or installpkg on the generated tarball in the /tmp directory?

I presumed that the script ran a make install (or equivalent) step at the end.

I have since tried to build version 3.0 by downloading the source tarball from the Clang/LLVM website and even after altering the VERSION=2.9 to VERSION=3.0 in the script and changing the name of the actual source tarball slightly (it was named llvm-3.0.tar.gz when the script expected llvm-3.0.tgz) the script hangs up after initially starting and running briefly. I presume this is secondary to the tarball being arranged in a way it did not expect. The LLVM team originally implied that the Clang source be placed in a llvm/tools directory within the extracted llvm source while the Slackware Builds seems to place both as gzipped tarballs in the same directory as the extracted SlackBuilds script. Just to clarify this attempt to build version 3.0 is a 3rd attempt after having run (and rerun) the build on the 2.9 source tarball downloded via the link in SlackBuilds.

Is there a particular trick to trying to be on the bleeding edge with some Slackware builds? Should I be fetching the source tarballs from a particular location? Or just wait for the sources to be linked to from SourceBuilds. What I am asking is how tied am I to running the version stated in the SlackBuilds site?

The SlackBuilds script seems to create one tarball that presumably has both LLVM and Clang. Will test it later. I have not "installed" yet if I understood you correctly.

Sorry for my stream of questions. I am learning a lot in the process.

Thanks again.

Last edited by haziz; 01-02-2012 at 04:59 AM.
 
Old 01-02-2012, 04:04 AM   #8
BlackRider
Member
 
Registered: Aug 2011
Posts: 295

Rep: Reputation: 101Reputation: 101
Quote:
So I still have to invoke pkgtool or installkg on the generated tarball in the /tmp directory?
Yes. The script makes the package, but it does not install it.

Quote:
Is there a particular trick to trying to be on the bleeding edge with some Slackware builds? Should I be fetching the source tarballs from a particular location? Or just wait for the sources to be linked to from SourceBuilds. What I am asking is how tied am I to running the version stated in the SlackBuilds site?
If you want to be bleeding edge, most of the times you only need to get the source from the original web site and edit the SlackBuild so it points to the new version. Usually, there is no problem in running the newest software in the last stable Slackware release, but you might face some rare cases when you'll have to update estrange libraries or even patch rebellious code. The good thing about SlackBuilds.org is that the maintainers have already tested the software and patched it if necessary, so the error factor is reduced and installation is fool-proof. You are not tied, however, to the SlackBuild versions, and you will be able to use without trouble different ones more than not.

Last edited by BlackRider; 01-02-2012 at 04:12 AM.
 
Old 01-03-2012, 03:46 AM   #9
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Quote:
Originally Posted by haziz View Post
I have since tried to build version 3.0 by downloading the source tarball from the Clang/LLVM website and even after altering the VERSION=2.9 to VERSION=3.0 in the script and changing the name of the actual source tarball slightly (it was named llvm-3.0.tar.gz when the script expected llvm-3.0.tgz) the script hangs up after initially starting and running briefly.
I presume you haven't changed the tarball name for the clang source yet. Either way you can save that effort as llvm-3.0 does not compile on stock Slackware because of a gcc compiler bug. That's why there's still only 2.9 on SlackBuilds.org.

Quote:
Originally Posted by haziz View Post
The LLVM team originally implied that the Clang source be placed in a llvm/tools directory within the extracted llvm source while the Slackware Builds seems to place both as gzipped tarballs in the same directory as the extracted SlackBuilds script.
Where you download the tarball to does not matter. It is extracted in that folder later on by the script.
 
  


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
LXer: LLVM/Clang On The ARMv7 PandaBoard ES LXer Syndicated Linux News 0 12-29-2011 09:50 PM
LXer: GCC 4.6, LLVM/Clang 3.0, Open64 Benchmarks LXer Syndicated Linux News 0 11-07-2011 12:50 PM
LXer: LLVM/Clang Can Build LibreOffice LXer Syndicated Linux News 0 10-22-2011 02:21 PM
LXer: LLVM project's 2.7 release out with a Clang LXer Syndicated Linux News 0 04-28-2010 09:31 PM
LXer: LLVM 2.6 Released, Clang Is Now Production Ready LXer Syndicated Linux News 0 10-25-2009 05:00 PM

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

All times are GMT -5. The time now is 04:01 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