help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Where to find readlink for Mac OS 10.3.9?


From: Neil.Francis
Subject: RE: Where to find readlink for Mac OS 10.3.9?
Date: Thu, 27 Sep 2007 10:43:23 +0800

Hi Thomas,

I'm pretty sure it doesn't appear on the 10.3.9 machines that I'm using,
and definitely isn't in my path at the moment:

jadzia:~ fra256$ which readlink
no readlink in /bin /sbin /usr/bin /usr/sbin
/usr/local/teTeX/bin/powerpc-apple-darwin-current /sw/bin /usr/local/bin

My message yesterday wasn't entirely correct - it seems I forgot that a
few days before I had tried to fix something by having octave in
/usr/local/bin symlink to another script in the same directory which
contained the line

exec '/Applications/Octave/Octave.app/Contents/Resources/bin/octave'

Which would be why my command line arguments to octave are being dropped
(oops - it's been a busy week!).  Now changing /usr/local/octave to
point to what is being exec'ed above, as I claimed I was doing
yesterday:

jadzia:/usr/local/bin fra256$ sudo ln -s
/Applications/Octave/Octave.app/Contents/Resources/bin/octave octave

And returning to my home directory and trying to start octave I get:

jadzia:/usr/local/bin fra256$ cd ~
jadzia:~ fra256$ octave
/usr/local/bin/octave: line 1: readlink: command not found
/usr/local/bin/octave: line 69: /usr/local/bin/octave-2.9.13: No such
file or directory

But creating an alias does seem to work, with and without arguments.
(though with the readlink error, of course).

Also, when starting up octave using the full path, command line
arguments are fine (but w/ the usual readlink error).  I've edited my
cron job to do this and all is well.  (Apart from that those warnings I
was ignoring from 2.1.73 about gset being deprecated seem to have become
relevant to me)

Thanks,
Neil



> -----Original Message-----
> From: Thomas Treichl [mailto:address@hidden
> Sent: Thursday, 27 September 2007 12:57 AM
> To: Francis, Neil (Minerals, Waterford)
> Cc: address@hidden
> Subject: Re: Where to find readlink for Mac OS 10.3.9?
> 
> Neil,
> 
> readlink should be part of the OS (but I can see that it isn't for
10.3
> and this
> is a problem). I can find readlink of my 10.4.9 system as
> 
>    /usr/bin/readlink
> 
> Maybe another idea would be to set an alias in .profile or .bashrc
> (depends on
> whether you prefer to use Terminal.app or xterm)
> 
>    alias
octave="/Applications/Octave.app/Contents/Resources/bin/octave"
> 
> Does this work for you?
> 
>    Thomas
> 
> address@hidden schrieb:
> > Hello,
> >
> > I've been trying to update my 2.1.73 to the SourceForge.net binaries
for
> > 2.9.13 and 2.9.14 on PPC Mac OS X 10.3.9, but am running into a
problem
> > with the startup script that they supply.  It expects to find a
program
> > called readlink, which isn't present on my machine, so I get an
error
> > message whenever I start octave.  This would only be mildy annoying,
but
> > it also seems to mean that I can't start octave with command link
> > arguments - they seem to be ignored.  This breaks a cron job I run,
> > which runs a script, which calls octave with command line arguments.
> >
> > I've tried googling for readlink, but haven't found a PPC binary for
it.
> > I've noticed there is a man page for readlink on my machines, but
they
> > are referring to a C function in unistd.h, not something that can be
run
> >>from the shell.
> >
> > If it makes a difference, I've symlinked to the installed location
> > (/Applications/Octave/Octave.app/Contents/Resources/bin/octave) from
> > /usr/local/bin, which is in my path.
> >
> > I see -
> >
> > /Applications/Octave/Octave.app/Contents/Resources/bin/octave: line
1:
> > readlink: command not found
> > GNU Octave, version 2.9.13
> > Copyright (C) 2007 John W. Eaton and others.
> > This is free software; see the source code for copying conditions.
> > There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
> > FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
> >
> > Octave was configured for "powerpc-apple-darwin7.9.1".
> >
> > Additional information about Octave is available at
> > http://www.octave.org.
> >
> > Please contribute if you find this software useful.
> > For more information, visit http://www.octave.org/help-wanted.html
> >
> > Report bugs to <address@hidden> (but first, please read
> > http://www.octave.org/bugs.html to learn how to write a helpful
report).
> >
> > For information about changes from previous versions, type `news'.
> >
> > octave-2.9.13:1>
> >
> >
> > The startup script looks like this:
> >
> > #!/bin/sh
> > # Copyright (C) 2007, Thomas Treichl and Paul Kienzle
> > # This program is free software; you can redistribute it and/or
modify
> > # it under the terms of the GNU General Public License as published
by
> > # the Free Software Foundation; either version 2 of the License, or
> > # (at your option) any later version.
> > #
> > # This program is distributed in the hope that it will be useful,
but
> > # WITHOUT ANY WARRANTY; without even the implied warranty of
> > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > # General Public License for more details.
> > #
> > # You should have received a copy of the GNU General Public License
> > # along with this program; if not, write to the Free Software
> > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > # 02110-1301 USA
> >
> > # Checks if Octave is started from a file that is a link or if this
> > # file has been taken directly to startup the Octave program.
> > LINK=`readlink "${0}"`
> >
> > if [ -z "${LINK}" ]; then
> >   BASE="${0%/bin/octave}"
> > else
> >   BASE="${LINK%/bin/octave}"
> > fi
> >
> >
#BASE="/Applications/Octave/Octave.app/Contents/Resources/bin/octave"
> >
> > ROOT=`(cd "${BASE}" 2>/dev/null && pwd)`
> > # echo LINK: ${LINK}
> > # echo BASE: ${BASE}
> > # echo ROOT: ${ROOT}; exit
> >
> > # Check if Gnuplot.app is installed in /Applications. Other
> > # directories could be added in a similiar way.
> > if [ -d "/Applications/Gnuplot.app" ]; then
> >   PATH="/Applications/Gnuplot.app/Contents/Resources/bin:$PATH"
> > fi
> >
> > # Setting up various path information variables that are needed to
> > # startup the Octave program.
> > OCTAVE_HOME="${ROOT}"
> > PATH="${ROOT}/bin:${PATH}"
> > DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"
> > DYLD_LIBRARY_PATH="${ROOT}/lib/octave-2.9.13:${DYLD_LIBRARY_PATH}"
> > # Setting up various path information variables that are needed to
run
> > # the "mkoctfile" and "mex" commands from within the Octave program.
> > CFLAGS="-I'${ROOT}/include/curl' -I'${ROOT}/include/readline'
${CFLAGS}"
> > CPPFLAGS="${CFLAGS}"
> > CXXFLAGS="${CXXFLAGS}"
> > LDFLAGS="-L${ROOT}/lib -L${ROOT}/lib/octave-2.9.13 ${LDFLAGS}"
> > # These default include paths are set by mkoctfile-2.9.12
automatically
> > # CFLAGS="-I'${ROOT}/include' -I'${ROOT}/include/octave-2.9.13'"
> >
> > # Setting up other variables that are needed to run the octave
program
> > # or mkoctfile.
> > DL_LDFLAGS="-bundle -bundle_loader '${ROOT}/bin/octave-2.9.13'"
> > SED="/usr/bin/sed"
> >
> > # Export the variables that have been defined before so that the
> > # Octave program gets knowledge about them.
> > export OCTAVE_HOME PATH DYLD_LIBRARY_PATH
> > export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
> > export DL_LDFLAGS SED
> >
> > # Invoke octave, preserving spaces in all the input arguments.
> > "${ROOT}/bin/octave-2.9.13" "$@"
> >
> > Any assistance appreciated!
> >
> > Neil
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >




reply via email to

[Prev in Thread] Current Thread [Next in Thread]