[kepler-dev] Environment Variables

Slavisa Garic sgaric at gmail.com
Tue Jun 10 03:06:22 PDT 2014


That works fine. Can we use this somehow in External Execution actors? I
tried and failed.

What we need is a way to use environment variables to locate executables,
e.g. FSLDIR=/opt/local/bet, so that I can execute $FSLDIR/bin/bet. I
understand that if added to PATH these will be accessible by simply by
executing 'bet' but we'd still like to have access to environment variables
to locate specific versions etc.

Slavisa


On Tue, Jun 10, 2014 at 11:56 AM, Michal Owsiak <michalo at man.poznan.pl>
wrote:

> Try following instead.
>
> Inside expression actor use following:
>
> getenv("YOUR_VARIABLE_GOES_HERE")
>
> Michal
>
>
>  Hi,
>>
>> Could someone explain to me if there is a bug or I am doing something
>> wrong
>> that my workflows can't access environment variables.
>>
>> I tried setting them up in usual ways (profile scripts) and by using
>> environment.txt but no actor has access to them.
>>
>> For example I tried setting up TESTVAR and then accessing it in constant
>> actor but it raises an error as if it was not there. Top of the exception
>> stack is just below.
>>
>> Regards,
>> Slavisa Garic
>> PS. I can see this being set with kepler-2.4.0/module-info/
>> environment.txt
>> when Kepler is launched by kepler.sh and I get messages such as
>>
>> ....
>> Set environment variable: TESTVAR = mymessage
>> Set environment variable: R_HOME = /Library/Frameworks/R.
>> framework/Resources
>> ....
>>
>>
>> ptolemy.kernel.util.IllegalActionException: Error evaluating expression:
>>
>>> $TESTVAR
>>>    in .Unnamed1.Constant.value
>>> Because:
>>> Error parsing expression "$TESTVAR"
>>> Because:
>>> Encountered "" at line 1, column 1.
>>> Was expecting one of:
>>>
>>> Because:
>>> Error evaluating expression: $TESTVAR
>>>    in .Unnamed1.Constant.value
>>> Because:
>>> Error parsing expression "$TESTVAR"
>>> Because:
>>> Encountered "" at line 1, column 1.
>>> Was expecting one of:
>>>
>>> at ptolemy.data.expr.Variable.validate(Variable.java:1491)
>>> at ptolemy.moml.MoMLParser.endDocument(MoMLParser.java:802)
>>> at com.microstar.xml.XmlParser.doParse(XmlParser.java:162)
>>> at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
>>> at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1540)
>>> at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1512)
>>> at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1668)
>>> at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289)
>>> at ptolemy.actor.gui.PtolemyQuery$3._execute(PtolemyQuery.java:824)
>>> at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171)
>>> at ptolemy.kernel.util.NamedObj._executeChangeRequests(
>>> NamedObj.java:2559)
>>> at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:725)
>>> at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1776)
>>> at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1957)
>>> at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1761)
>>> at ptolemy.actor.gui.PtolemyQuery.changed(PtolemyQuery.java:885)
>>> at ptolemy.gui.Query._notifyListeners(Query.java:1928)
>>> at ptolemy.gui.Query$QueryFocusListener.focusLost(Query.java:2515)
>>> at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:213)
>>> at java.awt.Component.processFocusEvent(Component.java:6306)
>>> at java.awt.Component.processEvent(Component.java:6170)
>>> at java.awt.Container.processEvent(Container.java:2084)
>>> at java.awt.Component.dispatchEventImpl(Component.java:4776)
>>> at java.awt.Container.dispatchEventImpl(Container.java:2142)
>>> at java.awt.Component.dispatchEvent(Component.java:4604)
>>> at
>>> java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:
>>> 1856)
>>> at
>>> java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(
>>> DefaultKeyboardFocusManager.java:920)
>>> at
>>> java.awt.DefaultKeyboardFocusManager.dispatchEvent(
>>> DefaultKeyboardFocusManager.java:578)
>>>
>>
>> .....
>>
>>> .....
>>>
>>
>>
>>
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>
>>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20140610/ca130ca3/attachment-0001.html>


More information about the Kepler-dev mailing list