LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Compiling programs from source and dealing with dependencies on Slackware. (https://www.linuxquestions.org/questions/slackware-14/compiling-programs-from-source-and-dealing-with-dependencies-on-slackware-765914/)

Switch7 11-01-2009 01:45 AM

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)
fluxbox
zsh
firefox
irssi
htop (slackbuilds)
midnight commander
mpd and ncmpcpp (slackbuilds)
mplayer (no vdpau though so I'll need to recompile it)
gqview
nmap
gtk-chtheme (slackbuilds)
xpdf
vim/nano
Programming tools
Virtualbox (slackbuilds)
iptables

However, I'm missing two softwares I needed so it's time to compile programs from source. This is a bit intimidating for a newbie/non-programmer(I'm working on this though) who has only been using linux/unix for 2 months but it'll be a very good experience to understand more about it.

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:

You will want to download the source to the following directory: /usr/local/src
Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downlo...-0.12.5.tar.gz
# tar -zxvf libtorrent-0.12.5.tar.gz
# cd libtorrent
# Read the README
# ./configure
# make
# make test
# make install

Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.7.6.tar.gz
# tar -zxvf rtorrent-0.7.6.tar.gz
# cd rtorrent-0.7.6
# Read the README
# ./configure
# make
# make test
# make install

and I should have rtorrent working on slackware 13.

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
# wget http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-9.06.tar.bz2
# tar -jxvf rxvt-unicode-9.06.tar.bz2
# cd rxvt-unicode-9.06
# Read the README
# patch -p1 < doc/urxvt-9.06-256color.patch  (Applying 256 color patch, it's included with the source)
# ./configure
# make
# make test
# make install

This should be the correct way according to the tutorial but I wanted to confirm if I am on the right track. I never done this before so I'm not sure if there's something I did wrong. I have no plans on uninstalling these so I shouldn't need to worry about dependency hell although I'm quite lost when I need to upgrade these programs. I thnk I just need to locate libtorrent and rtorrent and rm everything that has anything to do with it if a new version of libtorrent and rtorrent is available then follow the same way as above and change the wget to a new version.

saulgoode 11-01-2009 03:00 AM

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:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downlo...-0.12.5.tar.gz
# tar -zxvf libtorrent-0.12.5.tar.gz
# cd libtorrent
# Read the README
# ./configure
# make
# make test
# mkdir /tmp/libtorrent-0.12.5
# make install DESTDIR=/tmp/libtorrent-0.12.5
# cd /tmp/libtorrent-0.12.5
# makepkg /tmp/libtorrent-0.12.5-1.txz
# installpkg /tmp/libtorrent-0.12.5-1.txz

The Slackware package produced won't include a description of the package, nor will it include the documentation, README files, or copyright notices(!). But it will function fine and you will be able to remove or upgrade the package using standard Slackware package management utilities.

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).

Switch7 11-01-2009 03:32 AM

Quote:

Originally Posted by saulgoode (Post 3739810)
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):



The Slackware package produced won't include a description of the package, nor will it include the documentation, README files, or copyright notices(!). But it will function fine and you will be able to remove or upgrade the package using standard Slackware package management utilities.

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).

Thank you! I had no idea that was possible and it's very convenient. I think it's worth the trade and I can just go to the official website if those files are needed.

So if I do

Code:

slackpkg remove libtorrent
slackpkg remove rtorrent

it'll completely wipe off everything and I don't have to worry about dependency because slackware package management utilities will take care of it.

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.

hurry_hui 11-01-2009 04:07 AM

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...:)

Switch7 11-01-2009 04:43 AM

Quote:

Originally Posted by hurry_hui (Post 3739840)
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...:)

Code:

curl>=7.14.3
libtorrent=0.12.5
xmlrpc-c

Slackware 13 x86_64 already has curl 7.19.6 so I guess xmlrpc-c is needed. Thanks for the tip. Their documentation is really good and I been using arch these past days. I did a upgrade and I was unable to boot anymore so I wish it would be more stable but I guess that's what bleeding edge is supposed to be - taking some risks.

saulgoode 11-01-2009 04:50 AM

Quote:

Originally Posted by Switch7 (Post 3739827)
Thank you! I had no idea that was possible and it's very convenient. I think it's worth the trade and I can just go to the official website if those files are needed.

One of the things I've grown to appreciate about building my own Slackware packages is that it forces me to visit the websites of the upstream projects. Not only does this make me realize the sources providing this wonderful software, but there are often links to related projects, or unrelated projects by the same authors; not to mention the occasional serendipitous revelations of intriguing philosophy, humor, and art which would otherwise go completely undiscovered when using a "one-click install" package manager.

Quote:

Originally Posted by Switch7 (Post 3739827)
So if I do

Code:

slackpkg remove libtorrent
slackpkg remove rtorrent

it'll completely wipe off everything and I don't have to worry about dependency because slackware package management utilities will take care of it.

Well, none of the official Slackware package management tools will take care of dependencies -- if you removepkg rtorrent, this will NOT remove libtorrent (or libsigc++, or libcurl). You will want to decide for yourself whether to remove those packages.

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:

Originally Posted by Switch7 (Post 3739827)
Off topic but I can't seem to connect to slackwiki.org

It does seem to be down at the moment.

Quote:

Originally Posted by Switch7 (Post 3739827)
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.

In addition to libtorrent, rtorrent depends on libcurl (included in a default SW installation) and libsigc++ (available on slackbuilds.org). Other distros will often split up the software provided by an upstream project into several smaller packages (providing separate packages for applications, documentation, headers, and libraries), which means that for those distros there are a greater number of dependencies that need to be met. Slackware packages install the full set of software as provided by the upstream project and does not refactor things into lots of little packages. This not only reduces the amount of work required to handle dependencies, but makes it much easier for users -- such as yourself -- to create their own Slackware packages.

Daedra 11-01-2009 05:14 AM

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

Switch7 11-01-2009 05:15 AM

Quote:

Originally Posted by saulgoode (Post 3739862)
One of the things I've grown to appreciate about building my own Slackware packages is that it forces me to visit the websites of the upstream projects. Not only does this make me realize the sources providing this wonderful software, but there are often links to related projects, or unrelated projects by the same authors; not to mention the occasional serendipitous revelations of intriguing philosophy, humor, and art which would otherwise go completely undiscovered when using a "one-click install" package manager.

I noticed that right away as well and I been checking the site out more often. I found it interesting that the developer had the certain hobby or doing certain projects and etc.


Quote:

Originally Posted by saulgoode (Post 3739862)
Well, none of the official Slackware package management tools will take care of dependencies -- if you removepkg rtorrent, this will NOT remove libtorrent (or libsigc++, or libcurl). You will want to decide for yourself whether to remove those packages.

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.

I see, I'll just take note for it. rTorrent and urxvt-256color is the only software missing from slackbuilds and official packages so it's easy to keep track of it and its dependency as well.

Quote:

Originally Posted by saulgoode (Post 3739862)
In addition to libtorrent, rtorrent depends on libcurl (included in a default SW installation) and libsigc++ (available on slackbuilds.org). Other distros will often split up the software provided by an upstream project into several smaller packages (providing separate packages for applications, documentation, headers, and libraries), which means that for those distros there are a greater number of dependencies that need to be met. Slackware packages install the full set of software as provided by the upstream project and does not refactor things into lots of little packages. This not only reduces the amount of work required to handle dependencies, but makes it much easier for users -- such as yourself -- to create their own Slackware packages.

I noticed the dependency is different from the arch. I'm not sure how the experienced Linux users can figure out the correct dependency for the certain distribution. I'm guessing doing ./configure or the README will tell me the needed dependency for slackware? I haven't actually done the compiling yet so I never seen the REAMME or ./configure yet.

And thank you once again for the detailed help.

sahko 11-01-2009 06:02 AM

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.

bgeddy 11-01-2009 09:29 AM

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.

Switch7 11-01-2009 04:13 PM

I made a big mistake on the rxvt-unicode 256 color. I did this instead:

Code:

# cd /usr/local/src
# wget http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-9.06.tar.bz2
# tar -jxvf rxvt-unicode-9.06.tar.bz2
# cd rxvt-unicode-9.06
Read the README
# patch -p1 < doc/urxvt-8.2-256color.patch
# autoconf
# ./configure --enable-xterm-colors
# make
# mkdir /tmp/rxvt-unicode-9.06
# make install DESTDIR=/tmp/rxvt-unicode-9.06
# cd /tmp/rxvt-unicode-9.06
# makepkg /tmp/rxvt-unicode-9.06-1.txz
# installpkg /tmp/rxvt-unicode-9.06-1.txz

After makepkg, it prompted me if I wanted to reset all directory permissions to 755 but I picked [n]o.

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

Switch7 11-01-2009 11:32 PM

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:

No package 'libtorrent' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Doing a google search, I think I found the solution which is

Code:

# export PKG_CONFIG_PATH=/tmp/libtorrent-0.12.5
# ./configure

I already have libtorrent installed and did it as saulgoode mentioned. The above didn't work so I tried other things like:
Code:

bash-3.1$ echo $PATH=libtorrent
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.=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
# ./configure

But none of it seems to be working.

sahko 11-02-2009 12:12 AM

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)

saulgoode 11-02-2009 12:13 AM

Quote:

Originally Posted by Switch7 (Post 3740766)
Doing a google search, I think I found the solution which is

Code:

# export PKG_CONFIG_PATH=/tmp/libtorrent-0.12.5
# ./configure

I already have libtorrent installed and did it as saulgoode mentioned. The above didn't work ...

The configure script (for rtorrent) is looking for a file named "libtorrent.pc". This file was generated when you compiled the libtorrent package and there will be a copy of it in the original source directory (/usr/local/src/libtorrent), in the compiled (DESTDIR) tree (/tmp/libtorrent-0.12.5/usr/local/lib/pkgconfig), and -- after you install the package -- in /usr/local/lib/pkgconfig. It may be that the pkgconfig directory is in "lib64" for Slackware64, or it may be that this is the cause of the problem (I don't have a SW64 setup and am not sure whether libtorrent handles 64-bit properly). But basically you need to set PKG_CONFIG_PATH to a directory which contains the "libtorrent.pc" file.

Switch7 11-02-2009 12:47 AM

Quote:

Originally Posted by sahko (Post 3740798)
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)

I see. I'll redo urxvt later. I just followed the guide here but I'll do more search later. It looks like I don't need to add anything after ./configure since 256colors seems to be working.

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:

Originally Posted by saulgoode (Post 3740800)
The configure script (for rtorrent) is looking for a file named "libtorrent.pc". This file was generated when you compiled the libtorrent package and there will be a copy of it in the original source directory (/usr/local/src/libtorrent), in the compiled (DESTDIR) tree (/tmp/libtorrent-0.12.5/usr/local/lib/pkgconfig), and -- after you install the package -- in /usr/local/lib/pkgconfig. It may be that the pkgconfig directory is in "lib64" for Slackware64, or it may be that this is the cause of the problem (I don't have a SW64 setup and am not sure whether libtorrent handles 64-bit properly). But basically you need to set PKG_CONFIG_PATH to a directory which contains the "libtorrent.pc" file.

Quote:

# export PKG_CONFIG_PATH=/usr/local/src/libtorrent-0.12.5/
# ./configure
Thank you, the above worked. I found libtorrent.pc and libtorrent.pc.in located in this directory.

Doing a make after gives tons of error:

Code:

bash-3.1# make
make  all-recursive
make[1]: Entering directory `/usr/local/src/rtorrent-0.7.6'
Making all in doc
make[2]: Entering directory `/usr/local/src/rtorrent-0.7.6/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/rtorrent-0.7.6/doc'
Making all in src
make[2]: Entering directory `/usr/local/src/rtorrent-0.7.6/src'
Making all in core
make[3]: Entering directory `/usr/local/src/rtorrent-0.7.6/src/core'
if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I./.. -I../..    -O2 -Wall -g -DDEBUG -I/usr/local/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include  -MT curl_get.o -MD -MP -MF ".deps/curl_get.Tpo" -c -o curl_get.o curl_get.cc; \
        then mv -f ".deps/curl_get.Tpo" ".deps/curl_get.Po"; else rm -f ".deps/curl_get.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I./.. -I../..    -O2 -Wall -g -DDEBUG -I/usr/local/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include  -MT curl_stack.o -MD -MP -MF ".deps/curl_stack.Tpo" -c -o curl_stack.o curl_stack.cc; \
        then mv -f ".deps/curl_stack.Tpo" ".deps/curl_stack.Po"; else rm -f ".deps/curl_stack.Tpo"; exit 1; fi
if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I./.. -I../..    -O2 -Wall -g -DDEBUG -I/usr/local/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include  -MT download.o -MD -MP -MF ".deps/download.Tpo" -c -o download.o download.cc; \
        then mv -f ".deps/download.Tpo" ".deps/download.Po"; else rm -f ".deps/download.Tpo"; exit 1; fi
download.cc: In constructor 'core::Download::Download(torrent::Download)':
download.cc:64: error: no matching function for call to 'torrent::TrackerList::TrackerList(torrent::TrackerList*)'
/usr/local/include/torrent/tracker_list.h:146: note: candidates are: torrent::TrackerList::TrackerList(const torrent::TrackerList&)
/usr/local/include/torrent/tracker_list.h:82: note:                torrent::TrackerList::TrackerList(torrent::TrackerManager*)
download.cc: In member function 'void core::Download::enable_udp_trackers(bool)':
download.cc:86: error: conversion from 'torrent::TrackerList*' to non-scalar type 'torrent::TrackerList' requested
download.cc:89: error: 'class torrent::TrackerList' has no member named 'get'
download.cc:91: error: 'class torrent::TrackerList' has no member named 'get'
download.cc:93: error: 'class torrent::TrackerList' has no member named 'get'
download.cc:89: warning: suggest explicit braces to avoid ambiguous 'else'
make[3]: *** [download.o] Error 1
make[3]: Leaving directory `/usr/local/src/rtorrent-0.7.6/src/core'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/rtorrent-0.7.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/rtorrent-0.7.6'
make: *** [all] Error 2


Martinezio 11-02-2009 02:25 AM

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 ;).

sahko 11-02-2009 02:29 AM

Quote:

Originally Posted by Switch7 (Post 3740831)
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.

Yeah its down for the time being. You can access slackwiki.info in the meantime.

wildwizard 11-02-2009 02:49 AM

I have just successfully compiled rtorrent in Slackware64 with the following

Build order
Build commands for each
Code:

./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux
make
make install

There were no errors and no extra libs are required other than libsigc++ and libtorrent

Switch7 11-02-2009 03:06 AM

Quote:

Originally Posted by Martinezio (Post 3740904)
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 ;).

I guess I royally messed up. Time to clean everything and retry.

Quote:

Originally Posted by wildwizard (Post 3740927)
I have just successfully compiled rtorrent in Slackware64 with the following

Build order
Build commands for each
Code:

./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux
make
make install

There were no errors and no extra libs are required other than libsigc++ and libtorrent


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.

wildwizard 11-02-2009 03:55 AM

Quote:

Originally Posted by Switch7 (Post 3740936)
Wouldn't it be painful if you ever need to get rid of it without making slackware package?

If you don't touch the source directory after installation you can do this with most software :-

Code:

make uninstall
Quote:

Originally Posted by Switch7 (Post 3740936)
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

If you do
Code:

./configure --help
You can get a list of options that configure will accept for that particular project as well as a short description of what each option does.

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.

Switch7 11-02-2009 04:33 AM

Quote:

Originally Posted by wildwizard (Post 3740974)
If you don't touch the source directory after installation you can do this with most software :-

Code:

make uninstall


If you do
Code:

./configure --help
You can get a list of options that configure will accept for that particular project as well as a short description of what each option does.

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.

The --help is good enough, thank you. I remember seeing that command but forgot about it.

Quote:

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

--libdir=DIR object code libraries [EPREFIX/lib]

--infodir=DIR info documentation [DATAROOTDIR/info]

--build=BUILD configure for building on BUILD [guessed]
I think something like this build command for each software and every dependency would get the job done:
Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downlo...-0.12.5.tar.gz
# tar -zxvf libtorrent-0.12.5.tar.gz
# cd libtorrent
# Read the README
# ./configure --prefix=/usr --build=x86_64-slackware-linux
# make
# make test
# mkdir /tmp/libtorrent-0.12.5
# make install DESTDIR=/tmp/libtorrent-0.12.5
# cd /tmp/libtorrent-0.12.5
# makepkg /tmp/libtorrent-0.12.5-1.txz
# installpkg /tmp/libtorrent-0.12.5-1.txz

Looking at the explanation above, I have a feeling doing --infodir=DIR might cause problem when I make a slackware package. The same for --libdir=DIR. I might be making another newbie misconception though.

slackd 11-02-2009 04:42 AM

Quote:

Originally Posted by Switch7 (Post 3741006)
I think something like this build command for each software and every dependency would get the job done:
Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downlo...-0.12.5.tar.gz
# tar -zxvf libtorrent-0.12.5.tar.gz
# cd libtorrent
# Read the README
# ./configure --prefix=/usr --build=x86_64-slackware-linux
# make
# make test
# mkdir /tmp/libtorrent-0.12.5
# make install DESTDIR=/tmp/libtorrent-0.12.5
# cd /tmp/libtorrent-0.12.5
# makepkg /tmp/libtorrent-0.12.5-1.txz
# installpkg /tmp/libtorrent-0.12.5-1.txz

Looking at the explanation above, I have a feeling doing --infodir=DIR might cause problem when I make a slackware package. The same for --libdir=DIR. I might be making another newbie misconception though.

try this, its the best option.

Switch7 11-02-2009 07:33 PM

Quote:

Originally Posted by wildwizard (Post 3740927)
I have just successfully compiled rtorrent in Slackware64 with the following

Build order
Build commands for each
Code:

./configure --prefix=/usr --libdir=/usr/lib64 infodir=/usr/info --build=x86_64-slackware-linux
make
make install

There were no errors and no extra libs are required other than libsigc++ and libtorrent

Thank you. The way you did it worked flawlessly and I have rtorrent running now. Before I did it the same way as you did, I tried making a slackware pkg (doing a: ./configure --prefix=/usr) but I still got the same error.

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:

If you don't touch the source directory after installation you can do this with most software :-
I noticed in another thread that it mentioned that not all includes something convenient command like "make uninstall" When this happens, do I just delete the files one by one? I read there that I should do something like:

Code:

./configure
make
check install

if it doesn't include "make uninstall"

Quote:

Originally Posted by slackd (Post 3741011)
try this, its the best option.

I think I got how compiling from source works so I'll move on to slackbuilds and try to understand what each command is doing. This is all for learning linux and understanding more about it (not just installing a program and feel relieved about it). I'm trying to learn deeper but maybe I'm rushing it a little too much (didn't even know what dependency was a week ago). Thank you for the link.

Martinezio 11-03-2009 02:12 AM

Quote:

Originally Posted by Switch7 (Post 3741989)
I noticed in another thread that it mentioned that not all includes something convenient command like "make uninstall" When this happens, do I just delete the files one by one? I read there that I should do something like:

Code:

./configure
make
check install

if it doesn't include "make uninstall"

So the best way is to build slackware package - this give You an easy opportunity to make uninstall :) Most of makefiles have the ability, to redirect installation process into other directory. It uses mostly DESTDIR environment variable, or INSTALL_ROOT, sometimes INSTALL_DIR, or so - You can find it by viewing Makefile generated by configure script - check the installation routines.
You can invoke this variable in installation command like this:
Code:

./configure [your options]
make all
make install DESTDIR=/full/path/to/install/redirect

After that, You may go to $DESTDIR directory, and build slackware package. To do this, just make a directory named "install" and place into it a file called slack-desc with package description. All lines, that You need to shown as description, must be started by package name and semicolon.
Next go back into previous path, and type command:
Code:

makepkg ../packagename-version-arch-build_no.txz
At the end, You can installpkg this TXZ package created by You, and You can start using binaries from package :) If the package doesn't satisfy You, You can perform
Code:

uninstallpkg packagename
and You be clean :)

Switch7 11-03-2009 03:03 AM

Quote:

Originally Posted by Martinezio (Post 3742259)
So the best way is to build slackware package - this give You an easy opportunity to make uninstall :)

Thank you for the reply. I done it in a similar fashion but for some odd reason, doing a 'make' will cause tons of error. This is not the case for anything that does not rely on dependencies. The urxvt slackware package I succeeded on, actually had no dependencies. It was optional. There is no 'make uninstall' for urxvt so the slackware package is really convenient and I hope I could solve this issue.

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
make
make install

for all three of it (libsigc++, libtorrent, and rtorrent. I noticed the libsigc++ slackbuild's version is 2.2.3 and the latest is 2.4.2. I'm not too sure if this matters at all but I think it's worth noting.)

Continuing on with the slackware package creation, I proceeded with:
Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.5.tar.gz
# tar -zxvf libtorrent-0.12.5.tar.gz
# cd libtorrent-0.12.5
# ./configure --prefix=/usr
# make
# mkdir /tmp/libtorrent-0.12.5
# make install DESTDIR=/tmp/libtorrent-0.12.5
# cd /tmp/libtorrent-0.12.5
# makepkg libtorrent-0.12.5-1.txz
# installpkg /tmp/libtorrent-0.12.5-1.txz

Code:

# cd /usr/local/src
# wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.5.tar.gz
# tar -zxvf rtorrent-0.8.5.tar.gz
# cd rtorrent-0.8.5
# ./configure --prefix=/usr
# make

After make, I get errors. I noticed you said:

Code:

# make all
Instead of 'make' Maybe this could be the problem for me?

Doing the above without making a slackware package succeeds flawlessly so I'm not too sure where I messed up.

Martinezio 11-03-2009 03:55 AM

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).

Switch7 11-03-2009 04:05 AM

Quote:

Originally Posted by Martinezio (Post 3742357)
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).

I read the README very carefully. It was stated in the README on which dependencies I needed and those were it. I'll keep trying it and will take a look at debian's packages. I thought someone might spot a error on the way I installed it for slackware packages but it seems like I'm doing it correctly since no one commented on it. Maybe it could be the version or some special capabilities needed by the program but since it worked when I never made a slackware packages, I don't think that's the case. Maybe it's worth a try though.

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
You're probably wondering why I'm still at this but I'd really like to expand my knowledge with these technical things instead of running and looking for alternatives. But I'm actually having lots of fun learning it.

Martinezio 11-03-2009 06:32 AM

Quote:

Originally Posted by Switch7 (Post 3742367)
You're probably wondering why I'm still at this but I'd really like to expand my knowledge with these technical things instead of running and looking for alternatives. But I'm actually having lots of fun learning it.

Well, I'm not ;) It's Your choice, but I'm trying to help You. Human learn all life long ;)
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]
It's because libtool try's to find required libraries during compilation process in default path, when no LDFLAGS is set, and this path is set to /usr/lib. In multilib environment, this path is pointing to 32-bit libraries, and compiling for default build, You compile 64-bit app. But You cannot mix two different architectures - ldd will not load 32-bit libraries for 64-bit app.
That's my digression, but it's worth to be mention ;)

Switch7 11-03-2009 06:47 AM

Quote:

Originally Posted by Martinezio (Post 3742492)
Well, I'm not ;) It's Your choice, but I'm trying to help You. Human learn all life long ;)
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]
It's because libtool try's to find required libraries during compilation process in default path, when no LDFLAGS is set, and this path is set to /usr/lib. In multilib environment, this path is pointing to 32-bit libraries, and compiling for default build, You compile 64-bit app. But You cannot mix two different architectures - ldd will not load 32-bit libraries for 64-bit app.
That's my digression, but it's worth to be mention ;)

Unless multilib is installed by default, no. The softwares that I listed in the first post of this thread is everything I have except virtualbox since I no longer need that and didn't install it. I think that used the multilib but I didn't install it after all.

Quote:

Originally Posted by Martinezio (Post 3742492)
Well, I'm not ;) It's Your choice, but I'm trying to help You. Human learn all life long ;)

Thank you very much. I have no plans on giving up so this thread might be alive for awhile. :cool:

I'll try out other './configure' and the latest release of libsigc++ and see how it goes.

Switch7 11-03-2009 03:58 PM

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

./
usr/
usr/share/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/rtorrent.1
usr/bin/
usr/bin/rtorrent
WARNING:  /usr/share/man (with possibly not gzipped man pages) detected

Slackware package /tmp/rtorrent-0.8.5-1.txz created.

bash-3.1# installpkg /tmp/rtorrent-0.8.5-1.txz
Verifying package rtorrent-0.8.5-1.txz.
Installing package rtorrent-0.8.5-1.txz:
PACKAGE DESCRIPTION:
Package rtorrent-0.8.5-1.txz installed.

Code:

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib64/libtorrent.so.11 -> libtorrent.so.11.0.5
usr/lib64/libtorrent.so -> libtorrent.so.11.0.5

Making symbolic link creation script:
( cd usr/lib64 ; rm -rf libtorrent.so.11 )
( cd usr/lib64 ; ln -sf libtorrent.so.11.0.5 libtorrent.so.11 )
( cd usr/lib64 ; rm -rf libtorrent.so )
( cd usr/lib64 ; ln -sf libtorrent.so.11.0.5 libtorrent.so )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y



Removing symbolic links:
removed `./usr/lib64/libtorrent.so.11'
removed `./usr/lib64/libtorrent.so'

Creating your new ./install/doinst.sh...

I'm not sure what the warning is and I'm a bit worried about it. Doing a quick search brought me to several people with the same warning but it didn't look like anyone commented on that. Doing a 'man rtorrent' will give me a normal man page that I normally get with everything else.

This is what my usr/share/man looks like:

Code:

bash-3.1$ cd /usr/share/man && ls -a
.                bg    cat5  catn  es            hr            it.UTF-8                man-pages-3.22.lsm  man4  man9          pl.UTF-8  ru.KOI8-R    sr
..              cat1  cat6  cs    fi            hu            ja                      man1                man5  mann          pt        ru.UTF-8      whatis
Changes          cat2  cat7  da    fr            id            jp                      man2                man6  nl            pt_BR    ru_RU.KOI8-R
POSIX-COPYRIGHT  cat3  cat8  de    fr.ISO8859-1  it            ko                      man3                man7  pl            ro        sk
README          cat4  cat9  el    fr.UTF-8      it.ISO8859-1  man-pages-3.22.Announce  man3p              man8  pl.ISO8859-2  ru        sl

I did more searches but it turns out there's absolutely no information regarding this warning.

And for the symbolic links, I think I made the right choice and it was alright to remove the symbolic links correct?

saulgoode 11-04-2009 12:29 AM

Quote:

Originally Posted by Switch7 (Post 3743186)
I'm not sure what the warning is and I'm a bit worried about it.

It is just a warning that your man pages aren't compressed, thereby wasting a little bit of disk space. No real worry (but if you ever write a Slackbuild, you should go the extra mile and gzip your man pages).

Quote:

Originally Posted by Switch7 (Post 3743186)
And for the symbolic links, I think I made the right choice and it was alright to remove the symbolic links correct?

You made the correct choice.

Switch7 11-04-2009 01:45 AM

Quote:

Originally Posted by saulgoode (Post 3743690)
It is just a warning that your man pages aren't compressed, thereby wasting a little bit of disk space. No real worry (but if you ever write a Slackbuild, you should go the extra mile and gzip your man pages).


You made the correct choice.

Thank you very much! Now that I overcame my biggest obstacle, slackware is defiantly going to be my main desktop distribution. I was still testing around to see if it was for me or not. Looks like I'll go subscribe to the Slackware CD/DVD now.:)

Martinezio 11-04-2009 03:06 AM

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 :)

Switch7 11-04-2009 04:04 AM

Quote:

Originally Posted by Martinezio (Post 3743852)
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 :)

libtorrent-0.12.5-x86_64-1.txz
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?

Alien Bob 11-04-2009 04:39 AM

Quote:

Name and version can contain multiple "-" signs
This is not completely true. The name may contain dashes (the "-" characters) but the version must not have any dashes! So, if a source package has a version of "1.2.3-4" your package version must be changed to something like "1.2.3_4" - Slackware usually replaces dashes in a VERSION with underscores.

Quote:

Originally Posted by Switch7 (Post 3743915)
libtorrent-0.12.5-x86_64-1.txz
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?

Perhaps you should read http://www.slackwiki.org/Writing_A_SlackBuild_Script

Eric

Switch7 11-04-2009 04:57 AM

Quote:

Originally Posted by Alien Bob (Post 3743952)
This is not completely true. The name may contain dashes (the "-" characters) but the version must not have any dashes! So, if a source package has a version of "1.2.3-4" your package version must be changed to something like "1.2.3_4" - Slackware usually replaces dashes in a VERSION with underscores.



Perhaps you should read http://www.slackwiki.org/Writing_A_SlackBuild_Script

Eric

Thank you. I never had any idea this was supposed to be the official way it's used in slackware. I always thought slackbuilds was just third party packages. I'll defiantly take a look here.

Martinezio 11-04-2009 05:08 AM

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.