I'd say that's a bug for ECL/Cygwin (which of the two is at fault I do
not know), since the documentation clearly indicates that
(pathname "")
should be valid. See http://ecls.sourceforge.net/ecl/user_2.html#SEC28
However, the error you are quoting above:
In function PATHNAME, the value of the only argument is NIL which is
not of the expected type (OR FILE-STREAM STRING PATHNAME).
indicates something else. (pathname NIL) and (pathname "") are not the
same thing, so what you're seeing might be caused by yet something
else.
I did brew the (asdf:make-build :maxima :type :fasl :move-here ".")
incantation at some point. Maxima needs to be set up with "autoconf"
before this works [there may be other ways too]. Did you try to run it
without the ':move here "." ' part? We can work around the move-here
in some other way if that is the problem.
Did you check that up to (asdf:make-build :maxima :type :fasl :move-
here ".") everything works fine? [i.e., you should have a functional
maxima executable] If there is an error before, then there is very
little chance that asdf:make-build could ever succeed (since it'll try
the same thing and fail again).
That's all I can think of. We could ask Juanjo if he has some insight.
It probably is a cygwin deficiency, but he is at least very familiar
with the ecl internals and might know a workaround.
which tries to define the variable *default-pathname-defaults* . On
linux, it seems to be equal to a path to the current directory, which
is the value one gets from (directory "") . [On one sage install on
linux, I'm just getting #P"" from (pathname ""), which seems to work
there. At least it's not NIL]
Perhaps this variable is unset on cygwin? (meaning its initialization
goes wrong somewhere).
You can see its value by just typing *default-pathname-defaults* at
the ECL prompt.
If its value is inappropriate you might try setting it:
(setf *default-pathname-defaults* #P"/tmp/")
or something like that.
[note that the source for cl_pathname is at line 753 of the same file]
My apologies for the last message. That didn't tell you anything you
didn't already know. A little digging in the source got me to:which tries to define the variable *default-pathname-defaults* . On
linux, it seems to be equal to a path to the current directory, which
is the value one gets from (directory "") . [On one sage install on
linux, I'm just getting #P"" from (pathname ""), which seems to work
there. At least it's not NIL]Perhaps this variable is unset on cygwin? (meaning its initialization
goes wrong somewhere).
You can see its value by just typing *default-pathname-defaults* at
the ECL prompt.
And just removing the ":move-here ..."? The normal behaviour of ASDF
should just place the result somewhere in a local tree. The variable
asdf::*user-cache* specifies where, if I'm not mistaken (we also set
that before building maxima, to avoid filling ~/.cache/common-lisp/...
with building debris).
So basically, you should try to do (in ECL):
(require `asdf)
(load "maxima-build.lisp")
(asdf:make-build :maxima :type :fasl)
If that works, then we can basically build maxima.fas . We just have
to figure out where it is put and/or build/move it to a more
convenient spot.
If it does not work then the problem is to figure out how to build
maxima.fas in the first place. [meaning that either Maxima+ECL+ASDF
+cygwin is broken or that it needs some other incantation and/or
workaround] Producing maxima.fas instead of a stand-alone executable
is essentially a different linking step (by then the required .o files
have been produced). ASDF was the most straightforward way I saw to
achieve that goal, but there may be other ways.
If there is remote access to some cygwin installation somewhere I
would be willing to try some things out to see if I can help.
I guess the root of the problem is here:here is another weirdness, which might explain the PATHNAME error messageOn Cygwin, ECL gives> (directory "")NIL
And on Cygwin directory function is broken in different ways, too - returning wrong contents, e.g.(directory "/tmp/*") should return the list(?) of files in /tmp, but on Cygwin it doesn't.
Hi Dima,I am sorry, but I do not read this group frequently -- too much work to do --. Following your request I just built ECL from CVS/git on a cygwin box and definitely I do not see the problems you seem to experience.
That is weird that you have to do this. Juanjo suggested that he had
made a bunch of changes to totally change how forking works in ECL
this summer, but maybe they weren't merged? I'm cc:ing him on this.
- kcrisman
That is weird that you have to do this. Juanjo suggested that he had
made a bunch of changes to totally change how forking works in ECL
this summer, but maybe they weren't merged? I'm cc:ing him on this.
On Nov 30, 4:40 pm, Juan Jose Garcia-Ripoll
<juanjose.garciarip...@googlemail.com> wrote:
> On Wed, Nov 30, 2011 at 9:32 PM, kcrisman <kcris...@gmail.com> wrote:
> > That is weird that you have to do this. Juanjo suggested that he had
> > made a bunch of changes to totally change how forking works in ECL
> > this summer, but maybe they weren't merged? I'm cc:ing him on this.
>
> I did not change the way fork is used: fork is broken in cyginw, period.
> However, I managed to avoid using fork() altogether, at least when
> compiling programs. This does not solve the problem; it just hides it.
>
Sorry, I misunderstood - as you know, I'm not an expert on ECL or
Cygwin, just a grunt trying to help out. I guess the point is whether
there is a way to avoid this problem when we compile Maxima. Or is
Dima's solution the best one for this?
- kcrisman
On Wed, Nov 30, 2011 at 9:32 PM, kcrisman <kcri...@gmail.com> wrote:That is weird that you have to do this. Juanjo suggested that he had
made a bunch of changes to totally change how forking works in ECL
this summer, but maybe they weren't merged? I'm cc:ing him on this.I did not change the way fork is used: fork is broken in cyginw, period. However, I managed to avoid using fork() altogether, at least when compiling programs. This does not solve the problem; it just hides it.
On Nov 30, 9:38 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
> On Thursday, 1 December 2011 05:40:35 UTC+8, Juanjo wrote:
>
> > On Wed, Nov 30, 2011 at 9:32 PM, kcrisman <kcri...@gmail.com> wrote:
>
> >> That is weird that you have to do this. Juanjo suggested that he had
> >> made a bunch of changes to totally change how forking works in ECL
> >> this summer, but maybe they weren't merged? I'm cc:ing him on this.
>
> > I did not change the way fork is used: fork is broken in cyginw, period.
> > However, I managed to avoid using fork() altogether, at least when
> > compiling programs. This does not solve the problem; it just hides it.
>
> I don't see how you managed to completely avoid it (I hope we talk about
> the same ECL version, do we?! We usehttp://sage.math.washington.edu/home/kcrisman/ecl-11.1.1.p3.spkg).
No, I don't think so! See http://trac.sagemath.org/sage_trac/ticket/11884
and the spkg there, which contains CVS/git/whatever from mid-
November. This is merged in 4.8.alpha3.
- kcrisman
On Nov 30, 9:38 pm, Dima Pasechnik <dim...@gmail.com> wrote:
> On Thursday, 1 December 2011 05:40:35 UTC+8, Juanjo wrote:
>
> > On Wed, Nov 30, 2011 at 9:32 PM, kcrisman <kcr...@gmail.com> wrote:
>
> >> That is weird that you have to do this. Juanjo suggested that he had
> >> made a bunch of changes to totally change how forking works in ECL
> >> this summer, but maybe they weren't merged? I'm cc:ing him on this.
>
> > I did not change the way fork is used: fork is broken in cyginw, period.
> > However, I managed to avoid using fork() altogether, at least when
> > compiling programs. This does not solve the problem; it just hides it.
>
> I don't see how you managed to completely avoid it (I hope we talk about
> the same ECL version, do we?! We usehttp://sage.math.washington.edu/home/kcrisman/ecl-11.1.1.p3.spkg).
No, I don't think so! See http://trac.sagemath.org/sage_trac/ticket/11884
and the spkg there, which contains CVS/git/whatever from mid-
November. This is merged in 4.8.alpha3.
- kcrisman
I don't see how you managed to completely avoid it (I hope we talk about the same ECL version, do we?! We use http://sage.math.washington.edu/home/kcrisman/ecl-11.1.1.p3.spkg).
Without the hack I found, one still often gets things like this one: [...]
3 [main] ecl 2880 C:\cygwin\usr\local\sage\sage-4.7.2\local\bin\ecl.exe: *** fatal error - unable to remap \\?\C:\cygwin\tmp\eclcWIpUD.dll to same address as parent: 0x530000 != 0x810000Stack trace:Frame Function Args0022A118 6102796B (0022A118, 00000000, 00000000, 00000000)0022A408 6102796B (6117EC60, 00008000, 00000000, 61180977)0022B438 61004F1B (611A7FAC, 6124E2FC, 00530000, 00810000)End of stack trace
The reason my hack helps fork() to work is due to these temporary DLLs (I still don't know where they come from, by the way) being placed in memory in a more favourable way, which does not give Windows a reason to move them around (and moving them around is exactly the reason for that "*** fatal error - unable to remap \\?\C:\cygwin\tmp\eclcWIpUD.dll" things)
On Thu, Dec 1, 2011 at 3:38 AM, Dima Pasechnik <dim...@gmail.com> wrote:I don't see how you managed to completely avoid it (I hope we talk about the same ECL version, do we?! We use http://sage.math.washington.edu/home/kcrisman/ecl-11.1.1.p3.spkg).I do not know what stage of change this includes.
What I meant is that ECL does not, by itself, call execve(), fork(), or relatives at all when using Cygwin, and instead relies on "system". What cygwin does under the hood (for instance if it is so unfortunate to use fork() when executing system()) is a mistery to me.Without the hack I found, one still often gets things like this one: [...]3 [main] ecl 2880 C:\cygwin\usr\local\sage\sage-4.7.2\local\bin\ecl.exe: *** fatal error - unable to remap \\?\C:\cygwin\tmp\eclcWIpUD.dll to same address as parent: 0x530000 != 0x810000Stack trace:Frame Function Args0022A118 6102796B (0022A118, 00000000, 00000000, 00000000)0022A408 6102796B (6117EC60, 00008000, 00000000, 61180977)0022B438 61004F1B (611A7FAC, 6124E2FC, 00530000, 00810000)End of stack traceSeems again fork has been used.The reason my hack helps fork() to work is due to these temporary DLLs (I still don't know where they come from, by the way) being placed in memory in a more favourable way, which does not give Windows a reason to move them around (and moving them around is exactly the reason for that "*** fatal error - unable to remap \\?\C:\cygwin\tmp\eclcWIpUD.dll" things)I find that hack questionable. Will it work everywhere with any library loaded? Does it block other user's software from running? Hardcoding memory addresses is what has been pestering all Common Lisp implementations in the history and prevented not only portability but also maintainability.
Regarding the "due to these temporary DLLs (I still don't know where they come from, by the way)", the explanation is simple. Maxima is asking ECL to compile fragments of code via the C compiler, probably using the Common Lisp function COMPILE. A way to circumvent this problem (which makes sense for it also eliminates the use of the C compiler when Sage is used) is to replace this function with the bytecodes compiler, which is cheaper and does not invoke gcc.> (progn(ext:package-lock "CL" nil)(setf (fdefinition 'compile) #'ext::bc-compile)(ext:package-lock "CL" t))#<"COMMON-LISP" package>> #'compile#<compiled-function EXT::BC-COMPILE>> (compile 'foo '(lambda (x) (print x)))FOONILNIL> (foo 2)22> #'foo#<bytecompiled-closure #<bytecompiled-function 00000001039b9000>>The first four lines may be inserted in Maxima's code, probably at the end of ECL's portability section.#+cygwin(progn(ext:package-lock "CL" nil)(setf (fdefinition 'compile) #'ext::bc-compile)(ext:package-lock "CL" t))