Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ports VS Source Compiling -- HELP!!

9 views
Skip to first unread message

Lynn L.

unread,
Oct 31, 2002, 11:28:08 PM10/31/02
to
Thanks in advance...this question is a little long...

I am fairly new to FreeBSD on the software install side. I have been using
it for around 7 months now pretty much with standard installed software,
using the packages and ./sysinstall.

I am trying to build a couple of servers. Both using FreeBSD, one doing
webserving with Apache and PHP, the other using PostgreSQL and PL/Perl. I
am not sure that you need to know exactly what the packages I am using are
to answer the question, but just in case...
BSD4.6.2 or 4.7 (trying both to see which works best)

I have been successful in compiling the configuration I want from just using
the .gz source code downlaods from the respective sites. I have no real
complaints about how the systems were working. However...always looking for
a better way to do things, I started reading about the "ports system" and
now am thouroghly confused!

What does a port do exactly that is better than using the source code if the
source code "appears to work ok so far"?

I have a couple of books, the "Absolute BSD" (love this book so far) and
"FreeBSD Unleashed", and have looked online a bit, but can't really find an
adequate answer to this to satisfy my curiousity. Noone says "DON'T USE
SOURCE" but then again noone says "USE ONLY PORTS" either...

My current opinion is that, until shown otherwise, compiling from source
code is perfectly fine...but then when I read something else I have
doubts...so I thought I would put this question to the GURU's!!

I know this was long and thanks again for reading through this!

-Lynn L.
"Infinite monkeys with typewriters...'War and Peace'...you know the rest"


bomberboy

unread,
Nov 1, 2002, 4:12:55 AM11/1/02
to
Lynn L. wrote:

[...]


> I have been successful in compiling the configuration I want from just
> using the .gz source code downlaods from the respective sites. I have
> no real complaints about how the systems were working. However...always
> looking for a better way to do things, I started reading about the
> "ports system" and now am thouroghly confused!
>
> What does a port do exactly that is better than using the source code if
> the source code "appears to work ok so far"?

[...]


> My current opinion is that, until shown otherwise, compiling from source
> code is perfectly fine...but then when I read something else I have
> doubts...so I thought I would put this question to the GURU's!!

I'm far from being a GURU, but I think I might be able to answer yout
question anyway :-)

Installing software from the ports _IS_ compiling from source.
Whe you install a port this is what happens : the source-tarball gets
autmaticly fetched from the web, the ports checks if all dependecies are
fulfilled, if not it will first automagicly install those to. When all
dependecies are ok, it will compile the source, maybe apply a few patches
first, and later on install it for you.

So installing software from the ports is compiling the source AND it
makes sure all dependencies are ok. Everything happens automagically.

So why use the ports instead of compiling and installling it manually?

-it's much easier :) (Just cd to the port, type 'make' and 'make
install' Or when using portupgrade use 'portinstall name-of-port'
-you don't have to worry about any dependencies
-some patches are applied that might be necessary for it to compile on
BSD
-it lets you check easily if your software is still up to date (cvsup
your ports-tree and run pkg_version)
-if you use portupgrade (I would really suggest that, it's in the ports
ofcourse :)), it's really easy to upgrade your ports, and it first makes
a backup of the existing instal of the port before it install's the new
one so u can always fall back on that in case something went wrong.
-and probably much more :-)

I think using the ports-tree has lot's of advantages, compared to
compiling it manually.

Just for the record, you can also install (precompiled) software from
packages using pkg_add. If you speciafy the -r opion it will also
automagicly fetch the packages and dependent packages and install them.

I hope I explained it good enough :)

--
Bruno

me

unread,
Nov 1, 2002, 10:08:07 AM11/1/02
to

"bomberboy" <newsb...@pandora.be> wrote in message
news:pan.2002.11.01.09...@pandora.be...
> Lynn L. wrote:

> I'm far from being a GURU, but I think I might be able to answer yout
> question anyway :-)
>

Any info at this point is helpful, so yes, thank you!

> Installing software from the ports _IS_ compiling from source.
> Whe you install a port this is what happens : the source-tarball gets
> autmaticly fetched from the web, the ports checks if all dependecies are
> fulfilled, if not it will first automagicly install those to. When all
> dependecies are ok, it will compile the source, maybe apply a few patches
> first, and later on install it for you.
>
> So installing software from the ports is compiling the source AND it
> makes sure all dependencies are ok. Everything happens automagically.
>

This is one of the things I was wondering about, I did install the setup
with Apache and PHP, however, Apache seemed to install a LOT of .so
dependencies in the httpd.conf file that were apparently NOT installed when
using the port. I had to # out alot of .so module lines and then finally
gave up after the first 7 were not installed on my machine...and apachectl
would not start. So I was wondering if this was a fluke or not?

> -it's much easier :) (Just cd to the port, type 'make' and 'make
> install' Or when using portupgrade use 'portinstall name-of-port'
> -you don't have to worry about any dependencies
> -some patches are applied that might be necessary for it to compile on
> BSD

Have not even heard of "portinstall" yet, will have to look into that one...
Does this imply that if the software compiled fine from source that the
patches were not needed? Or would the patches be installed to optimize
software as well?

> -it lets you check easily if your software is still up to date (cvsup
> your ports-tree and run pkg_version)
> -if you use portupgrade (I would really suggest that, it's in the ports
> ofcourse :)), it's really easy to upgrade your ports, and it first makes
> a backup of the existing instal of the port before it install's the new
> one so u can always fall back on that in case something went wrong.
> -and probably much more :-)
>

The only problem I have had with using 'pkg_add' is that it appears to be
precompiled with set options. The options I am looking for usually are
pretty non-standard...such as PHP with Postgres support and Postgres with
PL/Perl installed. The only way I have been able to do this so far
successfully is with source code...however I still want to make sure I do it
the right way (whatever that means... ;-) )
Again this is just my current example, but also pretty much the only thing I
have to compare at the moment...not exactly the prestine beginning I had
hoped to using ports though... lol

>
> Just for the record, you can also install (precompiled) software from
> packages using pkg_add. If you speciafy the -r opion it will also
> automagicly fetch the packages and dependent packages and install them.
>

Only problem with packages is setting the configure options. But I have not
tried the -r option, I will look into that one. Thanks.

>
> I hope I explained it good enough :)
>

It does help confirm some other stuff that I have been hearing...but the
answers I still have, or questions that you raised are above. Thanks
again...any information at this point is good information as far as I am
concerned! :-)

-Lynn L.
"A million monkeys with typewriters...Windows Source Code...you know the
rest!"

> --
> Bruno


Ean Kingston

unread,
Nov 1, 2002, 10:07:13 AM11/1/02
to
I'm not exactly what you would call a GURU either but there are a couple
more advantages to the ports you should think about in deciding to use
them.

- First, using ports and/or packages allows you to keep track of what
software you have installed and easily remove/upgrade it. Check out
pkg_info(1).

- You can build your own packages from ports with 'make ; make package'.
This allows you to copy the package to your destination system and install
it with pkg_add. If you are running servers in a production environment it
is a really good idea to not install anything you don't need so you
shouldn't have the ports installed on your production servers. Also,
hardening your system is really good for improving security. You would, of
course, remove the c compiler.

You can learn more about hardening your systems by searching on
UNIX/BSD/FreeBSD and harden/hardening in your favourite search engine.

bomberboy wrote:

--
-----
Please remove the NOSPAM from my e-mail addres when replying directly.

Peter da Silva

unread,
Nov 1, 2002, 2:45:22 PM11/1/02
to
In article <spnw9.183080$md1.40045@sccrnsc03>,

Lynn L. <lazar_R...@attbi.REMOVE.com> wrote:
> What does a port do exactly that is better than using the source code if the
> source code "appears to work ok so far"?

Nothing, really. 90% of the advantage of ports is that they make install
and deinstall easier. The other 10% is that installing things like glib
from ports is strongly recommended because there's been a lot of care put
into letting your system work properly with glib1 and glib2 both installed,
to allow for programs that need one particular version...

--
I've seen things you people can't imagine. Chimneysweeps on fire over the roofs
of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All
these things will be lost in time, like chalk-paintings in the rain. `-_-'
Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`

Lynn L.

unread,
Nov 2, 2002, 12:13:47 AM11/2/02
to

"Ean Kingston" <eanki...@NOSPAM.rogers.com> wrote in message
news:BMww9.141580$Q3S....@news01.bloor.is.net.cable.rogers.com...

> I'm not exactly what you would call a GURU either but there are a couple
> more advantages to the ports you should think about in deciding to use
> them.
>
> - First, using ports and/or packages allows you to keep track of what
> software you have installed and easily remove/upgrade it. Check out
> pkg_info(1).
>
> - You can build your own packages from ports with 'make ; make package'.
> This allows you to copy the package to your destination system and install
> it with pkg_add. If you are running servers in a production environment it
> is a really good idea to not install anything you don't need so you
> shouldn't have the ports installed on your production servers. Also,
> hardening your system is really good for improving security. You would, of
> course, remove the c compiler.
>
> You can learn more about hardening your systems by searching on
> UNIX/BSD/FreeBSD and harden/hardening in your favourite search engine.
>

I like the ideas about the building packages for my servers while using a
test machine to do the builds. I hadn't thought of that one at
all...Thanks!

I guess my main plight now is how to do my specific configuration options
using the ports tree. instead of "./configure --with-xxxxx --enable-yyyyy"
with the direct source compilation. I get a big confused about. Is there
some secret to enabling options using ports? I have read through the
Makefile on several apps and just get more confused. Am I supposed to set
the options using the argument variables the porter is using in the
Makefile? Does this make sense??

I can see the benefit of using ports from a install/remove and allow package
building. I guess my bewonderment now is with actually gettign them to
perform the same as a ./configure and make from source code. Thanks again
for the help.

-Lynn L.
"Something about monkeys and typewriters..."

Lynn L.

unread,
Nov 2, 2002, 12:25:09 AM11/2/02
to

"Peter da Silva" <pe...@abbnm.com> wrote in message
news:apulki$8...@web.eng.baileynm.com...

> In article <spnw9.183080$md1.40045@sccrnsc03>,
> Lynn L. <lazar_R...@attbi.REMOVE.com> wrote:
> > What does a port do exactly that is better than using the source code if
the
> > source code "appears to work ok so far"?
>
> Nothing, really. 90% of the advantage of ports is that they make install
> and deinstall easier. The other 10% is that installing things like glib
> from ports is strongly recommended because there's been a lot of care put
> into letting your system work properly with glib1 and glib2 both
installed,
> to allow for programs that need one particular version...
>

Cool, that kind of confirms what I was thinking, however, I have seen some
good points about them from Ean in another thread of my original post...so I
have to think about the ports once again in a different light.

As I posted in another thread of this, however, do you have any suggestions
about how to do the ./configure --<options> with a port? It is a bit
confusing and I am slow learner sometimes...this seems to be one of those
times unfortunately...

Now I need to look into what glib is...gee thanks, more studying... ;-)
Just kidding, I really am not sure what it is, I do have to study, but will
be glad to learn about it...thanks for the advice!

-Lynn L.
"#include <iostream.h> void main() { out >> << "I always forget which way
to go"; return 0; }"


Nikolay Gorylenko

unread,
Nov 2, 2002, 5:51:11 AM11/2/02
to
153079036

> What does a port do exactly that is better than using the source code if the
> source code "appears to work ok so far"?

As for me, some ports in FreeBSD comes with one purpose: it have to exist
in ports. Quality does not matter :)

> I have a couple of books, the "Absolute BSD" (love this book so far) and
> "FreeBSD Unleashed", and have looked online a bit, but can't really find an
> adequate answer to this to satisfy my curiousity. Noone says "DON'T USE
> SOURCE" but then again noone says "USE ONLY PORTS" either...

Authors have their own opinions. They _must_ give such an advices
only with comment IMHO or smth. else (IMHO<=>In My Honest Opinion ).

> My current opinion is that, until shown otherwise, compiling from source
> code is perfectly fine...but then when I read something else I have
> doubts...so I thought I would put this question to the GURU's!!

I'm not a GURU but practice shows that is you have an information
about working distfile - install it with clean mind!

Bye!
--
How do you own your disorder? (C) System of a down
mailto:n0...@mail.ru ICQ#: 152050597

Lynn L.

unread,
Nov 2, 2002, 7:43:48 PM11/2/02
to
Thanks for the info. I think that as long as it works I will stick with it.
Will probably try the port first then go with straight source if that
doesn't do what I like.

I guess I have gotten the confirmation, in a sense, about the general saftey
of installing directly from source using BSD.

Thanks again!

-Lynn L.


"Nikolay Gorylenko" <ma...@hosix.ntu-kpi.kiev.ua> wrote in message
news:aq0amv$2s0n$1...@igloo.uran.net.ua...

Lynn L.

unread,
Nov 2, 2002, 7:50:27 PM11/2/02
to
WHoops hit the wrong button and hadn't typed anything in an accidental post
just a minute ago...
My Bad!

Thanks for the information. I will have to check out the Makefile and see
what they do, as you suggested. I guess the main thing about it is that you
have to figure out what seomenone else had in store with the port and may
need to disable some things that were originally disabled with the source.
Or at least that is the problem I ran into with the apache port the other
day.

I have learned alot from the previous posters, if not just confirmation of
my previous thoughts on the matter.

Thanks! Now on to the Makefile expeditions...

-Lynn L.


"Ulrich 'Q' Spoerlein" <q...@uni.de> wrote in message
news:0ab8su4kgkgr5tcgd...@4ax.com...


> "Lynn L." <lazar_R...@attbi.REMOVE.com> wrote:
>
> >As I posted in another thread of this, however, do you have any
suggestions
> >about how to do the ./configure --<options> with a port? It is a bit
> >confusing and I am slow learner sometimes...this seems to be one of those
> >times unfortunately...
>

> most ports will print something on the screen that tells you how to
> enable some of these flags. take audio/xmms for example:
>
> pre-extract:
> .if !defined(WITHOUT_MIKMOD) || !defined(WITHOUT_VORBIS) || (
> !defined(WITHOUT_3DNOW) && ${OSVERSION} >= 400
> 021 ) || ${HAVE_GNOME:Mesound}!=""
> @${ECHO_MSG}
> .if !defined(WITHOUT_MIKMOD)
> @${ECHO_MSG} "You can disable support for mikmod by defining
> WITHOUT_MIKMOD."
> .endif
> .if !defined(WITHOUT_VORBIS)
> @${ECHO_MSG} "You can disable support for vorbis by defining
> WITHOUT_VORBIS."
> .endif
> .if !defined(WITHOUT_3DNOW) && ${OSVERSION} >= 400021
> @${ECHO_MSG} "You can disable 3DNow! optimized decoding routines by
> defining WITHOUT_3DNOW."
> .endif
> .if ${HAVE_GNOME:Mesound}!=""
> @${ECHO_MSG} "You can disable support for esound by defining
> WITHOUT_GNOME=esound."
> .endif
> @${ECHO_MSG}
> .endif
>
> that means, if you didn't define WITHOUT_3DNOW, it will use it like this:
>
> .if !defined(WITHOUT_3DNOW) && ${OSVERSION} >= 400021
> CONFIGURE_ARGS+= --enable-3dnow
> .endif
>
> so you can just make the port like this: make WITHOUT_3DNOW
> and it will NOT appen --enable-3dnow to the configure arguments. well,
> this example is about disabling stuff, but enabling works just the same.
> justa take a look at the Makefile and see what env. variables get
> checked, and what they do. of course you could also append your own
> configure args.
>
> hth


Peter da Silva

unread,
Nov 3, 2002, 2:10:04 PM11/3/02
to
In article <VkJw9.208270$qM2.67555@sccrnsc02>,

Lynn L. <lazar_R...@attbi.REMOVE.com> wrote:
> As I posted in another thread of this, however, do you have any suggestions
> about how to do the ./configure --<options> with a port? It is a bit
> confusing and I am slow learner sometimes...this seems to be one of those
> times unfortunately...

If I need a non-standard install, I typically do a "make" on the port to
take advantage of any FreeBSD-specific patches I mightn't know about
then I go down to the work/whatever directory and reconfigure and rebuild
it there.

I've found, though, that you're generally better off not installing
site-specific tweaks on production systems if you can possibly help it.

Lynn L.

unread,
Nov 3, 2002, 10:59:43 PM11/3/02
to


"Peter da Silva" <pe...@abbnm.com> wrote in message

news:aq3sac$d...@web.eng.baileynm.com...


> In article <VkJw9.208270$qM2.67555@sccrnsc02>,
> Lynn L. <lazar_R...@attbi.REMOVE.com> wrote:
>
> If I need a non-standard install, I typically do a "make" on the port to
> take advantage of any FreeBSD-specific patches I mightn't know about
> then I go down to the work/whatever directory and reconfigure and rebuild
> it there.
>
> I've found, though, that you're generally better off not installing
> site-specific tweaks on production systems if you can possibly help it.
>

Hadn't thought of doing it that way. Will have to see what that does as
well. I love news groups, you get a lot of good advice to try.

I am not sure what you mean by "site-specific tweaks". I doubt you mean
./configure --option-of-choice but not too sure what you do mean.

Thanks for the recomendations!

-Lynn L.
"Can't think of anything clever today..."


Peter da Silva

unread,
Nov 5, 2002, 3:23:27 PM11/5/02
to
In article <Pgmx9.485$ar4.101749@sccrnsc03>,

Lynn L. <lazar_R...@attbi.REMOVE.com> wrote:
> I am not sure what you mean by "site-specific tweaks". I doubt you mean
> ../configure --option-of-choice but not too sure what you do mean.

Anything that has to be documented or automated for an upgrade. Yes, that
can include configure options.

me

unread,
Nov 5, 2002, 6:22:42 PM11/5/02
to
Ah...ok, I will watch out for that. Thanks for the information. I am
currently trying a bunch of different options with the Ports configurations
to see what I can make/break. Experience seems to count for alot in this
area as well...I think I have rebuilt my test machine about 4 times just
today after screwing thigns up...luckily it is a quick install ;-)

I am trying the different options you have all suggested and thanks for
those suggestions...

Off I go into the wild BSD yonder...thanks again.

-Lynn L.


"Peter da Silva" <pe...@abbnm.com> wrote in message

news:aq99bv$j...@web.eng.baileynm.com...

Peter da Silva

unread,
Nov 6, 2002, 12:06:04 PM11/6/02
to
In article <4pYx9.48$Vc2....@news.uswest.net>,

me <biga...@hotmail.com> wrote:
> I think I have rebuilt my test machine about 4 times just
> today after screwing thigns up...luckily it is a quick install ;-)

And let's give a great big "thanks" to Jordan Hubbard and the rest of the
core for that. I'm grateful every time I have to reinstall a Windows box
and are forcibly reminded of how the other half lives.

0 new messages