swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with first Swarm app


From: Alex Lancaster
Subject: Re: help with first Swarm app
Date: 18 May 1998 15:50:37 -0600

>>>>> "pj" == pauljohn  <address@hidden> writes:

pj> Dear Alex and Everybody:

pj> I was very surprised when I saw this note implying that there is a
pj> programming difference between working with the binary and the
pj> archive.  Was that well known?  How could I miss something like
pj> that (don't answer, that's a rhetorical question).

pj> The only difference is that people who use the binary version
pj> don't all the includes that archive users do?

The nub of the problem is that "-lspace" is included in the binary
distribution library "swarm.x", but is *not* assumed to be part of the
list of libraries in the archived distributions. Thus you have to set
the APPLIBS macro to point to the "-lspace" in your application
Makefile.

So when someone tries to compile an application with "APPLIBS=-lspace"
against a binary distribution, depending on how the Makefile.conf is
set-up to process the APPLIBS macro they will either:

1. not be able to link against their own user-defined libraries if
   APPLIBS is assigned to null in Makefile.conf (as it is in the
   current distribution)

OR:

2. get "multiply defined symbol errors" in the link phase (which they
   won't have against an archive install) if APPLIBS is *not* assigned
   to null when compiling against a binary distribution - because the
   "space" library functions are already defined in "swarm.x".

Basically we have three types of libraries:

  * required libs (all except space)
  * optional libs that are part of the Swarm binary distribution
     (currently only space)
  * optional user-installed libs
     (neuro, ga etc..)

We are working on a solution to this problem.  Most likely we would
make the second and third categories be treated the same by the
linking process.  This has not affected most people so far, for two
reasons:

1. as those folks who choose an archive install should are mostly be
aware of the consequences - a good understanding of how to control
over Makefile.conf parameters to override should be a prerequisite for
all folks wanting to take this road!

2. only a few users have taken the time to create their own libraries
when creating Swarm applications - most write a single application
which they link against the Swarm libraries.  I heartily encourage
more people to go the modular way - it can result in re-usable chunks
that you can contribute back!

However, I agree that this is particulary quirky problem and I think
it is a good time to review the status of the space library and other
interdependencies.  It has concerned me that the space library has
been in kind of limbo for a while.

My idea is to have create a new type of macro, use:

1. keep APPLIBS for optional libraries that are part of the binary
   distribution and;

2. make a new USERLIBS macro (say) for -lneuro, -lga and
   user-developed libraries, to avoid these libraries being undefined at
   link time.

pj> If so, it seems vital that we start telling people who put things
pj> in anarchy (or any ftp site, actually) to put a readme file or at
pj> least comments in the makefile to tell people whether they
pj> compiled against the binary or archive.

Comments like this should generally go in the Makefile.

Remember that we have never advertised that the way that Swarm
applications are currently configured is the best or optimal way to
go.  Until we have a better configuration procedure, a certain amount
of knowledge of how the linking/compilation process will always be
necessary for Swarm developers.  Hence there is always the danger that
a particular developer's "hack" may be mistaken for a high-level
design convention ;-)

Users should always use their discretion when adopting certain
conventions, and often the best place to document these kind of
niggling facts is in the code itself (and unfortunately this means
that they will have to know where to look for it!)

 --- Alex

-- 
  Alex Lancaster         |   e-mail: address@hidden
  Swarm Developer        |      web: http://www.santafe.edu/~alex
  Santa Fe Institute     |      tel: +1-(505) 984-8800 (ext 242)
------------------------------------------------------------------

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]