octave-maintainers
[Top][All Lists]
Advanced

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

Re: New optics functions, was: Re: Contributing to octave-forge


From: Philip Nienhuis
Subject: Re: New optics functions, was: Re: Contributing to octave-forge
Date: Sat, 18 Jan 2014 06:53:38 -0800 (PST)

Martin Vogel-2 wrote
> One more question: The canonical place to add directories upon package
> installation to the path is the PKG_ADD file, right? Or is there some
> automation built into the common Makefiles?

Directories required for OF package are added to the path at package *load*
time rather than install time.
During loading of packages the package install directories are added to
Octave's search path automatically (the inverse happens at unload time).
AFAIK, PKG_ADD (actually a regular script with a special name) is only
called at installation time too when you ask pkg.m to have the package
auto-loaded (at Octave startup time).

As to adding other directories to the path, that depends on those
directories' contents:

- Extra directories (outside a package's installation directories)
containing m-files and .oct files required by your package should be
specified in addpath statements in PKG_ADD (and deleted by rmpath statements
in PKG_DEL).

- I'm not sure if directories containing non-Octave files, like executables,
libraries and shell scripts/batch files (e.g., on Windows: .exe, .dll and
.bat) can be added to the PATH from within Octave; you might need to
experiment if a statement like:

setenv ("PATH", [<'dirs-to-add,-each-separated-by-pathsep-character'>
pathsep getenv("PATH")])

would work from within Octave (note: no space between 'getenv' and '(' ).
If not, the safest w.r.t. executables/libraries is to prepare the PATH
before starting Octave (possibly in a shell of batch script used to start
Octave).

One more thing: PKG_ADD and PKG_DEL are scripts. The important thing here is
that these scripts don't "clean up after themselves" (they're run in
"foreground scope") so any scratch variables created by them should be
explicitly deleted using a final "clear" statement to avoid cluttering up
the workspace.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Contributing-to-octave-forge-tp4658334p4661159.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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