On Thu, 26 Jul 2007, Yeo Eng Hee wrote:
> I understand the need to put in the header and library using the
> CPPFLAGS and LDFLAGS parameter, but if all dependencies need a little
> something in these parameters, then the setting of these CPPFLAGS and
> LDFLAGS become complicated.
Only if you install every package in a separate directory. Generally you
will install all of your dependencies either via
* prebuilt packages for your OS (e.g. .rpm files for Fedora), which
install into standard directories like /usr where the compiler
looks automatically, OR
* for dependencies you compile yourself, you generally want to install
*all* of the self-compiled packages into a single directory, e.g.
$HOME/install. In this case you only need to put a single directory
in CPPFLAGS and a single directory in LDFLAGS.
Of course, if you install every package in its own directory, scattered
all over your hard disk, then you will need to specify all of these
directories separately and the configure command will get quite long. You
reap what you sow.
> I expect that the configure script should be able to handle this.
> Since the directory hierachy of libctl is quite fixed, why not let the
> configure script figure out everything by just specifying the top
> directory of libctl?
First, because the directory hierarchy of libctl is not fixed. It is
perfectly possible to specify completely independent places to install the
library, header, and other data files (using --libdir, --includedir, etc.
in configure). Perhaps you mean the *source* directory of libctl is not
fixed, but you should not be linking to libctl in its *source* directory.
You should always run 'make install' to install it somewhere and link to
that. This is true for essentially every Unix program.
Second, because LDFLAGS and CPPFLAGS are the standard for specifying where
to find library and header files. They are used for every other package,
and libctl should be no different.
> Anyway, I managed to build by installing libctl in the standard
> /usr/local/lib directory. However, this is less than ideal in my case,
> as I have more than 60 compute nodes, and I have to install on each one
> (normally, I would just install on a shared directory via NFS).
First of all, it is perfectly possible to share your /usr/local directory
via NFS. (This is what we do on our compute cluster.) Note that sharing
/usr/local does not require you to share /usr. In fact, if you read the
Linux Filesystem Hierarchy Standard, this is precisely what /usr/local is
intended for:
http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY
Second, there is no reason why you can't install libctl (along with any
other dependencies) into a shared directory and tell the configure script
where to find it with CPPFLAGS and LDFLAGS.
Regards,
Steven G. Johnson
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss