[Ecls-list] cl_boot and the -dir directive

aaron at pageofswords.net aaron at pageofswords.net
Wed Feb 23 03:50:06 UTC 2011


Hi,

>From the command line, I can call ecl with the -dir directive to set the
"root" directory for the ecl install as follows:

<snip>
~ > ecl -dir /opt/local/lang
ECL (Embeddable Common-Lisp) 11.1.1
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level.
> (require :asdf)

;;; Loading #P"/opt/local/lang/asdf.fas"
;;; Loading #P"/opt/local/lang/cmp.fas"
("ASDF" "CMP")
>
</snip>

All is good. I had previously executed the commands
~ > sudo cp -a /usr/local/lib/ecl-11.1.1 /opt/local/lang
~ > sudo rm -rf /usr/local/lib/ecl-11.1.1

However, this seems to to work when -dir is passed in cl_boot. For
example, consider the following:

#include <ecl/ecl.h>

int main(int argc, char **argv)
{
	cl_object x;
	char* boot_opts[3];

	boot_opts[0] = (char*) argv[0];
	boot_opts[1] = (char*) "-dir";
	boot_opts[2] = (char*) "/opt/local/lang";
	cl_boot(3, boot_opts);

	CL_CATCH_ALL_BEGIN(ecl_process_env()) {

		x = c_string_to_object("(require :asdf)");
		cl_print(1,x);
		x = si_safe_eval(3, x, Cnil, Cnil);
		cl_print(1,x);

	} CL_CATCH_ALL_END;

	cl_shutdown();
}

This was compiled as follows:

gcc -o little-test main.c -I/usr/local/include -L/usr/local/lib -lecl


Now, when you execute "little-test", you get:

~/Desktop > ./little-test

(REQUIRE :ASDF)
NIL


/However/, if I move the ecl directory back to its original position, in
/usr/local/lib, I get the correct result:

~/Desktop > ./little-test

(REQUIRE :ASDF)
;;; Loading #P"/usr/local/lib/ecl-11.1.1/asdf.fas"
;;; Loading #P"/usr/local/lib/ecl-11.1.1/cmp.fas"

("ASDF" "CMP")


I cannot find anything in the cl_boot documentation that would suggest
this does not work. Did I miss something, or have I stumbled onto a bug?

Thanks in advance,

Aaron






More information about the ecl-devel mailing list