[Ecls-list] ecl include and library directories

Nils Bruin nbruin at cecm.sfu.ca
Sun May 22 08:28:35 UTC 2011

I am having some trouble with figuring out the default choices of the 
values of some of the paths used by the ECL compiler.

I have a fairly vanilla install of ecl, where I think that at least the 
relative positions of the installed files concerning ecl are typical. I 

> (translate-logical-pathname "SYS:")
> (require 'cmp)
;;; Loading #P"/mnt/usb1/scratch/nbruin/4.6.2/local/lib/ecl/cmp.fas"
> c::*ecl-library-directory*
> (c::ecl-library-directory)

This indicates that the value of c::*ecl-library-directory* was vetted and 
found correct. This was done by the test:

   (probe-file (merge-pathnames (compile-file-pathname "ecl" :type
                                             #+dlopen :shared-library
                                             #-dlopen :static-library)

which succeeds with


However, if I do

> (setf c::*ecl-library-directory* nil)
> (c::ecl-library-directory)
> c::*ecl-library-directory*

I see the system has cooked up another default, namely the directory for 
which (probe-file "SYS:BUILD-STAMP") succeeds. However, the file libecl.so 
does not reside there!

This means that c::ecl-library-directory, when presented with a value of 
c::*ecl-library-directory* it thinks is invalid, overwrites it with a 
value that is also invalid by its earlier criterion! That's probably not 
as intended.

Shouldn't the value be initialized to the following ?

(namestring (make-pathname :directory (butlast (pathname-directory
                               (translate-logical-pathname "SYS:")))))

A similar story applies to cc:ecl-include-directory:
> (c::ecl-include-directory)

which was approved because the following succeeds:

> (probe-file (merge-pathnames "ecl/config.h" c::*ecl-include-directory*))

Should that fail, then the routine tries if "SYS:" would be a reasonable 
candidate via

> (probe-file "SYS:ecl;config.h")

I don't think that will succeed in any sane installation. The value that 
would probably be OK is "SYS:..;..;include", given that:

> (probe-file "SYS:..;..;include;ecl;config.h")

so probably the thing to try would be:

(namestring (make-pathname :directory (append (butlast (pathname-directory 
(translate-logical-pathname "SYS:")) 2) '("include"))))

Most of this doesn't normally matter because ECL captures reasonable 
default values for *ecl-library-directory* and *ecl-include-directory* at 

However, would you be interested in using reasonable defaults derived from 
runtime information (being "SYS:") instead? It would mean that ECL 
continues to work if its installation is moved after build, as long as the 
relative position of headers and libraries is as usual.

Best wishes,


More information about the ecl-devel mailing list