Begin forwarded message:
> From: mark brethen <mbrethen@...>
> Subject: [Reduce-algebra-developers] Fwd: saveimage.sh error line 81
> Date: December 20, 2011 11:40:46 PM CST
> To: Rainer Schöpf <rainer.schoepf@...>
> Cc: reduce-algebra-developers@...
>
>
>
> Begin forwarded message:
>
>> From: mark brethen <mbrethen@...>
>> Subject: Re: [Reduce-algebra-developers] saveimage.sh error line 81
>> Date: December 20, 2011 11:10:29 PM CST
>> To: Rainer Schöpf <rainer.schoepf@...>
>>
>>
>> On Dec 20, 2011, at 9:08 AM, Rainer Schöpf wrote:
>>
>>> On Tue, 20 Dec 2011, mark brethen wrote:
>>>
>>>>> No, as far as I understand, the script creates the log dir in the dir in which
>>>>> it is executed. You might try to run it with
>>>>>
>>>>> sh -vx saveimage.sh
>>>>>
>>>>> to see exactly what it is doing.
>>>>>
>>>>>
>>>>> Rainer
>>>>
>>>>
>>>> :info:activate + case $a in
>>>> :info:activate + for d in '$PATH'
>>>> :info:activate + test -x /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin/saveimage.sh
>>>> :info:activate + test unknown = unknown
>>>> :info:activate + echo 'Unable to find full path for script. Please re-try'
>>>> :info:activate Unable to find full path for script. Please re-try
>>>> :info:activate + echo 'launching it using a fully rooted path.'
>>>> :info:activate launching it using a fully rooted path.
>>>> :info:activate + exit 1
>>>> :info:activate shell command "cd /opt/local/libexec/reduce-algebra/psl; exec sh -vx saveimage.sh /opt/local/libexec/reduce-algebra/red /opt/local/libexec/reduce-algebra/pslbuild" returned error 1
>>>>
>>>> I have not run your updated script yet, but in 3rd line its not finding the path.
>>>
>>> Hmm, yes, the code at the beginning of the script fails to find the
>>> absolute path to the script. I meant to run, e.g.
>>>
>>> system "exec sh -xv ${worksrcpath}/psl/saveimage.sh \
>>> ${worksrcpath}/libexec/reduce-algebra/red \
>>> ${prefix}/libexec/reduce-algebra/pslbuild"
>>>
>>>
>>> Rainer
>>>
>>> ------------------------------------------------------------------------------
>>> Write once. Port to many.
>>> Get the SDK and tools to simplify cross-platform app development. Create
>>> new or port existing apps to sell to consumers worldwide. Explore the
>>> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
>>> http://p.sf.net/sfu/intel-appdev
>>> _______________________________________________
>>> Reduce-algebra-developers mailing list
>>> Reduce-algebra-developers@...
>>> https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers
>>
>>
>> Here is the output of my last run:
>>
>> :debug:activate Executing proc-post-org.macports.activate-activate-0
>> :info:activate #! /bin/sh
>> :info:activate
>> :info:activate # Extract for buildsh to only save a new image.
>> :info:activate # Takes image file dir and toplevel pslbuild dir pathname as arguments
>> :info:activate #
>> :info:activate # Usage:
>> :info:activate # .../psl/saveimage.sh .../imagedir /usr/lib/reduce/pslbuild
>> :info:activate
>> :info:activate # This script must live in the PSL directory, but it builds things in the
>> :info:activate # current directory.
>> :info:activate
>> :info:activate a=$0
>> :info:activate + a=saveimage.sh
>> :info:activate c=unknown
>> :info:activate + c=unknown
>> :info:activate case $a in
>> :info:activate /* )
>> :info:activate c=$a
>> :info:activate ;;
>> :info:activate */* )
>> :info:activate case $a in
>> :info:activate ./* )
>> :info:activate a=`echo $a | sed -e s+./++`
>> :info:activate ;;
>> :info:activate esac
>> :info:activate c=`pwd`/$a
>> :info:activate ;;
>> :info:activate * )
>> :info:activate for d in $PATH
>> :info:activate do
>> :info:activate if test -x $d/$a
>> :info:activate then
>> :info:activate c=$d/$a
>> :info:activate fi
>> :info:activate done
>> :info:activate if test $c = "unknown" ;then
>> :info:activate echo "Unable to find full path for script. Please re-try"
>> :info:activate echo "launching it using a fully rooted path."
>> :info:activate exit 1
>> :info:activate fi
>> :info:activate ;;
>> :info:activate esac
>> :info:activate + case $a in
>> :info:activate + for d in '$PATH'
>> :info:activate + test -x /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin/saveimage.sh
>> :info:activate + test unknown = unknown
>> :info:activate + echo 'Unable to find full path for script. Please re-try'
>> :info:activate Unable to find full path for script. Please re-try
>> :info:activate + echo 'launching it using a fully rooted path.'
>> :info:activate launching it using a fully rooted path.
>> :info:activate + exit 1
>> :info:activate shell command "cd /opt/local/libexec/reduce-algebra/psl; exec sh -xv saveimage.sh /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0/red /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0" returned error 1
>>
>> I'm using this to exec your script:
>>
>> post-activate {
>> set dir ${prefix}/libexec/reduce-algebra/pslbuild
>> set contents [glob -directory $dir tail *]
>> system "cd ${prefix}/libexec/reduce-algebra/psl; exec sh -xv saveimage.sh \
>> ${contents}/red \
>> ${contents}"
>> }
>>
>> I believe the paths I'm passing to your script are now correct, and as you can see from the output above, it exits with 1 to stderr only because it can't find itself. I would expect this because your script resides in /opt/local/libexec/... which is not in my $PATH env.
>>
>>
>> -Mark
>>
>>
>>
>
>
> I think I have a clue: I made a slight change in my script
>
> post-activate {
> set dir ${prefix}/libexec/reduce-algebra/pslbuild
> set contents [glob -directory $dir tail *]
> system "exec sh -xv ${prefix}/libexec/reduce-algebra/psl/saveimage.sh \
> ${contents}/red \
> ${contents}"
> }
>
> Notice that I exec using the full path instead of cd. Now the test passes but I have a different error: it fails to run bpsl because it can't find it!
>
>
> :info:activate #! /bin/sh
> :info:activate
> :info:activate # Extract for buildsh to only save a new image.
> :info:activate # Takes image file dir and toplevel pslbuild dir pathname as arguments
> :info:activate #
> :info:activate # Usage:
> :info:activate # .../psl/saveimage.sh .../imagedir /usr/lib/reduce/pslbuild
> :info:activate
> :info:activate # This script must live in the PSL directory, but it builds things in the
> :info:activate # current directory.
> :info:activate
> :info:activate a=$0
> :info:activate + a=/opt/local/libexec/reduce-algebra/psl/saveimage.sh
> :info:activate c=unknown
> :info:activate + c=unknown
> :info:activate case $a in
> :info:activate /* )
> :info:activate c=$a
> :info:activate ;;
> :info:activate */* )
> :info:activate case $a in
> :info:activate ./* )
> :info:activate a=`echo $a | sed -e s+./++`
> :info:activate ;;
> :info:activate esac
> :info:activate c=`pwd`/$a
> :info:activate ;;
> :info:activate * )
> :info:activate for d in $PATH
> :info:activate do
> :info:activate if test -x $d/$a
> :info:activate then
> :info:activate c=$d/$a
> :info:activate fi
> :info:activate done
> :info:activate if test $c = "unknown" ;then
> :info:activate echo "Unable to find full path for script. Please re-try"
> :info:activate echo "launching it using a fully rooted path."
> :info:activate exit 1
> :info:activate fi
> :info:activate ;;
> :info:activate esac
> :info:activate + case $a in
> :info:activate + c=/opt/local/libexec/reduce-algebra/psl/saveimage.sh
> :info:activate
> :info:activate cpsldir=`echo $c | sed -e 's+/[^/]*$++'`
> :info:activate echo $c | sed -e 's+/[^/]*$++'
> :info:activate ++ echo /opt/local/libexec/reduce-algebra/psl/saveimage.sh
> :info:activate ++ sed -e 's+/[^/]*$++'
> :info:activate + cpsldir=/opt/local/libexec/reduce-algebra/psl
> :info:activate creduce=$cpsldir/..
> :info:activate + creduce=/opt/local/libexec/reduce-algebra/psl/..
> :info:activate chere=`pwd`
> :info:activate pwd
> :info:activate ++ pwd
> :info:activate + chere=/opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk
> :info:activate cfasl=$chere/red
> :info:activate + cfasl=/opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk/red
> :info:activate
> :info:activate if test -x /usr/bin/cygpath
> :info:activate then
> :info:activate psldir=`cygpath -m "$cpsldir"`
> :info:activate reduce=`cygpath -m "$creduce"`
> :info:activate here=`cygpath -m "$chere"`
> :info:activate fasl=`cygpath -m "$cfasl"`
> :info:activate else
> :info:activate psldir="$cpsldir"
> :info:activate reduce="$creduce"
> :info:activate here="$chere"
> :info:activate fasl="$cfasl"
> :info:activate fi
> :info:activate + test -x /usr/bin/cygpath
> :info:activate + psldir=/opt/local/libexec/reduce-algebra/psl
> :info:activate + reduce=/opt/local/libexec/reduce-algebra/psl/..
> :info:activate + here=/opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk
> :info:activate + fasl=/opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk/red
> :info:activate
> :info:activate imagedir="$1"
> :info:activate + imagedir=/opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0/red
> :info:activate if test -d "$imagedir"
> :info:activate then
> :info:activate :
> :info:activate else
> :info:activate mkdir -p "$imagedir"
> :info:activate fi
> :info:activate + test -d /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0/red
> :info:activate + :
> :info:activate
> :info:activate if test -z "$2"
> :info:activate then
> :info:activate topdir="$here"
> :info:activate else
> :info:activate topdir="$2"
> :info:activate fi
> :info:activate + test -z /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0
> :info:activate + topdir=/opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0
> :info:activate
> :info:activate if test -f psl/64
> :info:activate then
> :info:activate STORE=600
> :info:activate else
> :info:activate STORE=64000000
> :info:activate fi
> :info:activate + test -f psl/64
> :info:activate + STORE=64000000
> :info:activate
> :info:activate export here fasl psldir reduce
> :info:activate + export here fasl psldir reduce
> :info:activate
> :info:activate if test -d "$chere/log"
> :info:activate then
> :info:activate :
> :info:activate else
> :info:activate mkdir -p "$chere/log"
> :info:activate fi
> :info:activate + test -d /opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk/log
> :info:activate + mkdir -p /opt/local/var/macports/build/_Users_marbre_ports_math_reduce-algebra/reduce-algebra/work/trunk/log
> :info:activate
> :info:activate cd psl
> :info:activate + cd psl
> :info:activate
> :info:activate ./bpsl -td $STORE <<XXX > $chere/log/reduce.blg
> :info:activate % This re-starts a bare reduce and loads in the modules compiled
> :info:activate % by the very first step. It then checkpoints a system that can be
> :info:activate % used to rebuild all other modules.
> :info:activate
> :info:activate (setq symbolfilename!* "$here/psl/bpsl")
> :info:activate (setq loaddirectories!* (quote ("" "$here/red/" "$here/psl/")))
> :info:activate
> :info:activate (reclaim)
> :info:activate (setq !*init!-stats!* (list (time) (gtheap nil) (free-bps) nextsymbol))
> :info:activate
> :info:activate (setq !*usermode nil)
> :info:activate (setq !*verboseload t)
> :info:activate (setq !*argnochk t) % Check argument count.
> :info:activate (setq prolog_file 'pslprolo)
> :info:activate (setq rend_file 'pslrend)
> :info:activate
> :info:activate (cond ((filep "symget.b")
> :info:activate (dskin "$reduce/psl/symget.dat")))
> :info:activate
> :info:activate (cond ((filep "addr2id.b")
> :info:activate (load addr2id))) % For debugging purposes.
> :info:activate
> :info:activate (cond ((filep "pipes.b")
> :info:activate (load pipes))) % Unix pipes.
> :info:activate
> :info:activate (load zbig) % PSL bignums.
> :info:activate (errorset '(load compat) nil nil) % Load PSL-based functions if there.
> :info:activate (load module) % Contains definition of load-package.
> :info:activate (load pslprolo) % PSL specific code.
> :info:activate
> :info:activate (load!-package 'rlisp)
> :info:activate (load!-package rend_file)
> :info:activate (load!-package 'poly)
> :info:activate (load!-package 'arith)
> :info:activate (load!-package 'alg)
> :info:activate (load!-package 'mathpr)
> :info:activate (load!-package 'entry)
> :info:activate (setq version!* "REDUCE Experimental Version") (setq date!* (date))
> :info:activate (initreduce)
> :info:activate
> :info:activate (setq !*loadversion t) % Load entry module during BEGIN.
> :info:activate (setq !*verboseload nil) % Inhibit loading messages.
> :info:activate
> :info:activate (cond ((and (memq (quote sparc) lispsystem!*)
> :info:activate (getd (quote supersparc)))
> :info:activate (supersparc)))
> :info:activate
> :info:activate (prog nil
> :info:activate (reclaim)
> :info:activate (terpri)
> :info:activate (prin2 "Time for build: ")
> :info:activate (prin2 (quotient (difference (time) (car !*init!-stats!*)) 1000.0))
> :info:activate (prin2t " secs")
> :info:activate (prin2 "Symbols used: ")
> :info:activate (prin2t (difference nextsymbol (cadddr !*init!-stats!*)))
> :info:activate (prin2 "Heap used: ")
> :info:activate (prin2t (difference (cadr !*init!-stats!*) (gtheap nil)))
> :info:activate (prin2 "BPS used: ")
> :info:activate (prin2t (difference (caddr !*init!-stats!*) (free-bps)))
> :info:activate (prin2 "Heap left: ")
> :info:activate (prin2t (gtheap nil))
> :info:activate (prin2 "BPS left: ")
> :info:activate (prin2t (free-bps))
> :info:activate (setq !*init!-stats!* nil))
> :info:activate
> :info:activate (setq symbolfilename!* "$topdir/psl/bpsl")
> :info:activate (setq loaddirectories!* (quote ("" "$topdir/red/" "$topdir/psl/")))
> :info:activate
> :info:activate (savesystem "REDUCE" "$imagedir/reduce" (quote ((read-init-file "reduce"))))
> :info:activate (bye)
> :info:activate
> :info:activate XXX
> :info:activate + ./bpsl -td 64000000
> :info:activate /opt/local/libexec/reduce-algebra/psl/saveimage.sh: line 93: ./bpsl: No such file or directory
> :info:activate
> :info:activate shell command "exec sh -xv /opt/local/libexec/reduce-algebra/psl/saveimage.sh /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0/red /opt/local/libexec/reduce-algebra/pslbuild/x86_64-mac_10.7_lion-darwin11.2.0" returned error 127
>
> -Mark
>
>
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Reduce-algebra-developers mailing list
> Reduce-algebra-developers@...
> https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers
This works (still using r1534 svn):
post-activate {
set dir ${prefix}/libexec/reduce-algebra/pslbuild
set contents [glob -directory $dir tail *]
system "cd ${contents}; exec sh -xv ${prefix}/libexec/reduce-algebra/psl/saveimage.sh \
${contents}/red \
${contents}"
}
apparently I have to cd to the topdir to make it current and then execute the fullpath to saveimage.sh. Do your most recent changes to the script (svn r1535) change this?
Mark
|