Compiling programs from source and dealing with dependencies on Slackware.
When I first moved to Linux from windows 2 months ago, I wrote out the equivalent of the softwares I'm going to need so I would never miss microsoft windows again. Slackware comes with almost everything I first wrote out which is:
Code:
awesome tiling windows manager (slackbuilds) The two softwares I'm missing is rtorrent and rxvt-unicode-256color. Although rxvt-unicode exists, it has no 256 color support and I read that the maintainer isn't planning on adding it because it's not officially supported. rtorrent exists for 12.2 on slackbuids but there hasn't been any update for 13. Reading the LQwiki, here and another good tutorial here, it seems very simple. rtorrent only requires one dependency which is libtorrent. I learned from my other thread that I need to build the dependency first which is libtorrent from the official website. So all I do is download the libtorrent and follow the tutorial: Quote:
Code:
# cd /usr/local/src Code:
# cd /usr/local/src Fortunately, there's a slackbuild for the dependency called libafterimage for the urxvt so I'll just use sbopkg for this. After that: For urxvt 256 color support, Code:
# cd /usr/local/src |
Your approach should work fine and you are definitely on the right track; however, I would propose that instead of installing the software directly (via 'make install'), you should consider building a Slackware package and installing that. Installing with a SW package is generally not much more difficult, and it makes system maintenance easier in the long run (you will know what packages are installed, and can easily remove or upgrade the software).
Using libtorrent as an example, you can create a Slackware package from the source using the following steps (italic bold text is used to highlight the differences from your original approach): Quote:
The above approach will work for the vast majority of Autotools-based source code compiling (i.e., the './configure && make && make install' stuff), but I would also recommend that you eventually learn more about writing your own slackbuild scripts and adding the Slack-desc description files (a good tutorial for this is available at slackbuilds.org). |
Quote:
So if I do Code:
slackpkg remove libtorrent I will work on the slackbuilds so I can help myself and be able to contribute back to the community one day and I hope I can make slackbuilds in the future for the missing softwares that are popular and contribute. After I get everything working and the system is stable, I'm planning on learning sh so I can write slackbuilds scripts. Off topic but I can't seem to connect to slackwiki.org Edit: I been reading another thread about compiling rtorrent and it seems that there's much more depedency I needed. This is strange since I always thought rtorrent had only one dependency. |
Hi,
To find out dependencies required by a package for Slackware, I always consult archlinux package, since it always lists 'clean' dependencies. NB: Sorry, I think 'clean' is not really correct term here, I do not know how to say it correctly in English...:) |
Quote:
Code:
curl>=7.14.3 |
Quote:
Quote:
In general, it does no harm to have an unused package installed on your system, other than the space taken up on your harddrive (which nowadays is of little concern). It has been my experience that in those rare instances when conflicts arise because of unused (or outdated) packages being installed, the package managers which purport to automate dependency handling do a fairly poor job of it; creating much greater problems than caused by having to manually manage dependencies. Quote:
Quote:
|
You should also look into gnashley's src2pkg program, I prefer to use slackbuilds but if there isn't one available I use it. It's saved me many times. It basically automates the ./configure make make install process. Most times just running the default results in a perfect package.
src2pkg -VV Path-to-rtorrent.tar.gz The resulting package will be in /tmp |
Quote:
Quote:
Quote:
And thank you once again for the detailed help. |
Libtorrent requires some other c++ library though.
I don't see your problem TBH. All the applications you need are in SlackBuilds.org and the extra packages (dependencies) required by them are documented in the READMEs. |
Well maybe it's just a personal thing but my initial comment is not to use /usr/local/src as a working directory. I use a dedicated directory off my home - /home/bgeddy/sources - to build packages. You could alternatively use someting in /tmp. The main reason is that using a /usr/local/src directory requires you to work as root for the download/build etc when this isn't neccesary.
It best to stay away from root privileges as much as possible for a safety net. It's only when you install stuff (or the final stages of a build) when you have to be root. Everyone has their own preferences but staying away from root when possible is good advice. It's when you ignorantly issue an "rm -rf *" in the wrong place that you'll REALLY regret running as root ;) As already mentioned it's advisable to build a Slackware package from source then installpkg that. You may do this either yourself or via src2pkg/Slackbuild/sbopkg/etc.This makes it much easier to manage packages. |
I made a big mistake on the rxvt-unicode 256 color. I did this instead:
Code:
# cd /usr/local/src Doing pkgtool, I found rxvt-unicode-9.06-1 located in there so I think this was my first success? Just a screenshot of pkgtool and using urxvt: http://i37.tinypic.com/sdil4x.png http://i34.tinypic.com/2mrnd.jpg And 256colors: http://i37.tinypic.com/28vx20j.png |
I put thread as solved but took it back since I thought these would work. For the rtorrent, doing ./configure and I'm getting:
Quote:
Code:
# export PKG_CONFIG_PATH=/tmp/libtorrent-0.12.5 Code:
bash-3.1$ echo $PATH=libtorrent Code:
# export PKG_CONFIG_PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.=libtorrent |
AFAIK urxvt doesnt have an --enable-xterm-colors configure option. If it does, it doesnt do what you use it for.
As for the rest i suggest you follow the slackbuilds.org documentation and use the scripts exactly as they are (and dont install in /usr/local) |
Quote:
|
Quote:
I'll go ahead and read slackbuilds.org and try to follow it. I'm trying to access slackwiki.org since slackbuilds.org mentions to take a look there but it still seems to be down. One of the main reasons why I wanted to compile programs from source was because instead of having everything done automated, I wanted to take my time learning how to compile it from source so I don't have to resort to slackbuilds all the time. I been always running away and looking for alternatives if there's no automated tool that will do it for me automatically. One of my primary goal is to learn more about Linux and I have a feeling I might be missing out on something important if I keep avoiding on how to compile programs from source. Quote:
Quote:
Doing a make after gives tons of error: Code:
bash-3.1# make |
Do not overwrite whole PKG_CONFIG_PATH envvar. Better way is to install libtorrent into /usr prefix, or export PKG_CONFIG_PATH=/usr/local/src/libtorrent-0.12.5/:${PKG_CONFIG_PATH} .
If You overwrite this var, the pkg-config will not be able to find necessary basic packages other, than libtorrent ;). |
Quote:
|
I have just successfully compiled rtorrent in Slackware64 with the following
Build order Code:
libsigc++-2.2.4.2 http://ftp.gnome.org/pub/GNOME/sourc....2.4.2.tar.bz2 Code:
./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux |
Quote:
Quote:
Wouldn't it be painful if you ever need to get rid of it without making slackware package? I'm thinking of adding "./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux" whenever I need to compile a program then just make a slackware package. Whenver I google search the '--prefix=/usr', '--libdir=/usr/lib64', etc. I'm getting directed to pre-made scripts and I'm not understanding it but I'm guessing the --prefix=/usr will install it in /usr, libdir=/usr/lib64 would put the libs (like libtorrent) in there. No idea about infodir=/usr/info and I think --build=x86_64-slackware-linux will build it optimized for x86_64. I'm probably completely wrong since I'm guessing on everything. I apologize in advance, I'm probably annoying people at this point but it's a extremely steep learning curve as someone who has been using windows for my entire life and only recently switched to linux 2 months ago. |
Quote:
Code:
make uninstall Quote:
Code:
./configure --help I tried to find something like a "configure for dummies" guide online but resources are lacking and some sites are linking to hideously out of date documentation. If demand for such is wanted I could knock something up. |
Quote:
Quote:
Code:
# cd /usr/local/src |
Quote:
|
Quote:
I did more search on how to uninstall it but wanted to confirm it before I make some sort of mistake and create dependency hell. I saved the tar in /usr/local/src as root (su) because I can trust this source and know it doesn't include rm. I have three directory in here called "libsigc++-2.2.4.2" "libtorrent-0.12.5" and "rtorrent-0.8.5" To uninstall these and the file associated with it, I just simply go the directory (ex: cd /usr/local/src/libtorrent-0.12.5) and type "make uninstall" while I'm in the directory. Then I just do this for all dependency and the actual software. Is this correct? Quote:
Code:
./configure Quote:
|
Quote:
You can invoke this variable in installation command like this: Code:
./configure [your options] Next go back into previous path, and type command: Code:
makepkg ../packagename-version-arch-build_no.txz Code:
uninstallpkg packagename |
Quote:
Everything was smooth until making a rtorrent slackware package. This is how I did it before failing at the final part at the 'make.' I got the first depedency from slackbuilds. (just a note but for the other one where I suceeded on the rtorrent, I did a simple Code:
./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux Continuing on with the slackware package creation, I proceeded with: Code:
# cd /usr/local/src Code:
# cd /usr/local/src Code:
# make all Doing the above without making a slackware package succeeds flawlessly so I'm not too sure where I messed up. |
make all is the default option of make utility, so invokin' "make" You invoke de facto "make all" ;)
The problem of tons of errors is due missing dependencies. Even, If You thing otherwise ;) Probably wrong version of software, maybe missing features (i.e. default installation, that don't enrich the software with special capabilities needed by desired programm)... A lot of possibilities. Read carefuly README and INSTALL, or see the web for compiled packages (even in RPM, or DEB) and grab them, unpack and search for dependencies info (i.e. ldd program, read installation script routines, or special information files). |
Quote:
It's getting late here so I'll try it out using this instead for the slackware packages tomorrow: Code:
./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux |
Quote:
I have one question... Do You have installed multilib packages? If so, You may need to pass proper LDFLAGS for gcc compilator. Currently, I always set LDFLAGS, when running configure script: Code:
LDFLAGS="-L/usr/lib64" ./configure [options] That's my digression, but it's worth to be mention ;) |
Quote:
Quote:
I'll try out other './configure' and the latest release of libsigc++ and see how it goes. |
I finally succeeded in making a slackware package for rtorrent. I'm running it now and it's working great. Download speed is a lot higher than the other torrents I used in the past. However, I'm still worried about what I saw earlier which was:
Code:
Creating Slackware package: /tmp/rtorrent-0.8.5-1.txz Code:
Slackware package maker, version 3.14159. This is what my usr/share/man looks like: Code:
bash-3.1$ cd /usr/share/man && ls -a And for the symbolic links, I think I made the right choice and it was alright to remove the symbolic links correct? |
Quote:
Quote:
|
Quote:
|
Switch7: You have ommited one important thing - in the name of slackware package, You should set info about arch, to which is the package designed.
The name of package should be made with this schema: packagename-version-arch-build.txz Name and version can contain multiple "-" signs, but two last sections must be only alphanumeric signs without extra "-" signs. Regards :) |
Quote:
libsigc++-2.2.4.2-x86_64-1.txz rtorrent-0.8.5-x86_64-1.txz Something like this? I seen different numbers in the build number. Instead of -1, I seen something like -29 (ex: libtorrent-0.12.5-x86_64-29.txz) but that's only when the package is a bundle and I wouldn't need anything other than -1 for normal packages? |
Quote:
Quote:
Eric |
Quote:
|
Well, the slackbuild scripts are the official way to produce official packages ;) Slackbuilds save time for future releases, and rebuilds.
And I appologize for my mistake. Eric has always right ;) Only name of the package can contain multiple dashes. |
All times are GMT -5. The time now is 11:41 PM. |