LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Clang/LLVM Install Within Slackware? (http://www.linuxquestions.org/questions/slackware-14/clang-llvm-install-within-slackware-921526/)

haziz 01-01-2012 04:27 PM

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.

BlackRider 01-01-2012 04:51 PM

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.

haziz 01-01-2012 06:04 PM

Quote:

Originally Posted by BlackRider (Post 4563379)
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.

rworkman 01-01-2012 09:03 PM

Here's what you want:
Code:

CLANG=yes sh llvm.SlackBuild
No modifications to the script at all.

haziz 01-01-2012 10:20 PM

Quote:

Originally Posted by rworkman (Post 4563478)
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.

rworkman 01-02-2012 01:44 AM

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?

haziz 01-02-2012 03:56 AM

Quote:

Originally Posted by rworkman (Post 4563575)
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.

BlackRider 01-02-2012 04:04 AM

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.

ppr:kut 01-03-2012 03:46 AM

Quote:

Originally Posted by haziz (Post 4563622)
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 (Post 4563622)
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.


All times are GMT -5. The time now is 06:31 PM.