tags:

views:

75

answers:

4

hello,

gcc 4.4.4 c89 Fedora 13

I am wondering what is better. To give you a compile of examples: apache runtime portable and log4c.

The apr version in my fedora repository is 1.3.9. The latest stable version on the apr website is 1.4.2.

Questions

  1. Would it be better to download from the website and install, or install using yum?
  2. When you install from yum sometimes it can put things in many directories. When installing from the tarball you can put the includes and libraries where you want.
  3. The log4c the versions are the same, as this is an old project.
  4. I downloaded log4c using yum. I copied all the includes and libraries to my development project directory.

i.e.

project_name/tools/log4c/inc
project_name/tools/log4c/libs

However, I noticed that I had to look for some headers in the /usr/include directory.

Many thanks for any suggestions,

+4  A: 

If the version in your distribution's package repository is recent enough, just use that.

Advantages are automatic updates via your distribution, easy and fast installs (including the automatic fetching and installing of dependencies!) and easy removals of packages.

If you install stuff from .tar.gz by yourself, you have to play your own distribution - keep track of security issues and bugs.

Using distribution packages, you have an eye on security problems as well, but a lot work does the distributor for you (like developing patches, repackaging, testing and catching serious stuff). Of course each distributor has a policy how to deal with different classes of issues for different package repositories. But with your own .tar.gz installs you have nothing of this.

maxschlepzig
+1  A: 

If you want to build something that has to work with the Apache that's included with Fedora, then it's probably best to use the apr version in Fedora. That way you get automatic security updates etc. If you want to develop something new yourself, it might be useful to track upstream instead.

Also, normally the headers that your distro provides should be found by gcc & co. without you needing to copy them, so it doesn't matter where they are stored by yum/rpm.

JanC
+2  A: 

It's an age-old question I think. And it's the same on all Linux distributions.

The package is created by someone - that person has an opinion as to where stuff should go. You may not agree - but by using a package you are spared chasing down all the dependencies needed to compile and install the software.

So for full control: roll your own - but be prepared for the possible work otherwise use the package.

My view: Use packages until it's impossible to do so (conflicts, compile parameters needed, ..) . I'd much rather spend time getting the software to work for me, than spend time compiling.

+1  A: 

I usually use the packages provided by my distribution, if they are of a new enough version. There is two reasons for that:

1) Someone will make sure that I get new packages if security vulnerabilities in the old ones are uncovered.

2) It saves me time.

When I set up a development project, I never create my own include/lib directories unless the project itself is the authorative source for the relevant files I put there.

I use pkg-config to provide the location of necessary libraries and include files to my compiler. pkg-config use some .pc-files as a source of information about where things are supposed to be, and these are maintained by the same people who create the packages for your distribution. Some libraries does not provide this file, but an alternative '-config'-script. I'll provide two examples:

I'm not running Fedora 13, but an example on Ubuntu 10.04 would be;

*) Install liblog4c-dev

*) The command "log4c-config --libs" returns "-L/usr/lib -llog4c" ...

*) The command "log4c-config --cflags" returns "-I/usr/include"

And for an example using pkg-config (I'll use SDL for the example):

*) Install libsdl1.2-dev

*) The command "pkg-config sdl --libs" returns "-lSDL"

*) The command "pkg-config sdl --cflags" returns "-D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL"

... So even if another distribution decides to put things in different paths, there are scripts that are supposed to give you a reliable answer to where things is - so things can be built on most distributions. Autotools (automake, autoconf, and the likes) amd cmake are quite helpful to make sure that you don't have to deal with these problems.

Kvisle