Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Kenneth Hoste

On 08/01/2018 13:58, Caspar van Leeuwen wrote:

I disagree, because the requirement that the variable 'BAR_BIN' that is set is 
a requirement from Foo, not a 'feature' from Bar. Bar knows absolutely nothing 
about this variable, and is very happy to run without it - thus it has no place 
in a Bar module. To illustrate that more: what if someone tomorrow develops a 
Foo2, which requires another environment variable 'WHERE_CAN_FOO2_FIND_BAR' to 
point to the Bar executable, would you reinstall Bar and put this additional 
variable also in the module file of Bar, just because Foo2 needs it?

In my view, BAR_BIN, and WHERE_CAN_FOO2_FIND_BAR are things that are specific 
to Foo and Foo2 respectively, and should be set in their modules. The 
commonality is that I would want to use $EBROOTBAR - which is of course set by 
Bar -, to set BAR_BIN/WHERE_CAN_FOO2_FIND_BAR. I agree that this requires the 
additional assumption within the Foo module that the Bar module installs in the 
$EBROOTBAR/bin folder, which is not very nice. However, I think this is a far 
more generic assumption than when the Foo/Foo2 module has to assume that Bar 
sets BAR_BIN/WHERE_CAN_FOO2_FIND_BAR itself.

Thus, while I understand the 'if it references the tree of Bar, it should be 
set by Bar' sentiment, I think that the alternative here (setting environment 
variables required by Foo, Foo2, or whichever package comes next, in the Bar 
module) is simply worse.


+1, $BAR_BIN should be defined by the Foo module, ideally, since it's a 
runtime setting for Foo. But... (see below).



So, my question remains: is it correct that I cannot access the EBROOT of 
dependencies from within modextravars? And is there an elegant way to achieve 
this?


The problem is not so much that $EBROOTBAR isn't defined when the module 
is generated (it actually is), but that $EBROOTBAR is a construct not 
known by Tcl or Lua module files.
EasyBuild does not resolve environment variables specfied through 
modextravars, it just injects the values into the generated module file 
(and then does a test-load to make sure the module works).



My current, not-so-elegant way is:

modextravars = {'BAR_BIN': '$::env(EBROOTBAR)/bin'}

This works, but $::env (which reads EBROOTBAR at the time the module is loaded) 
is - as far as I know - specific for Tcl modules. Also, things like module disp 
Foo get messed up, because EBROOTBAR is not set then. Thus, I'm not very much 
in favor of this solution and looking for a way to have EasyBuild set the path 
for BAR_BIN at installation time.


You could use the modtclfooter/modluafooter easyconfig parameters to 
inject the Tcl/Lua specific code to define $BAR_BIN, but then you still 
how the problem about "module disp Foo".


A construct like this:

import os
modextravars = {'BAR_BIN': '%s/bin' % os.getenv('EBROOTBAR')}

will not work either, because the Bar dependency will not be loaded yet 
when the easyconfig file is being parsed (how could it, EB doesn't know 
what the dependencies are before it parses the easyconfig file...).


A (dirty) workaround for that could be to manually load the Bar module 
first, and then ask EB to install Foo.



The real fix for this issue is to add support in EasyBuild to resolve an 
environment variable whenever the string value containing it is used, so 
you can do something like:


modextravars = {'BAR_BIN': '%(env:EBROOTBAR)s/bin'}

This basically boils down to enhancing the existing templating support 
to pick up stuff from the environment and define the required %(env:...) 
template values.


If this works, it has a downside too: the installation prefix of Bar 
will be hardcoded in the Foo module (which is probably what Åke doesn't 
like).



Another option is to include a modloadmsg to instruct the user to run 
"export BAR_BIN=$EBROOTBAR/bin".


But then try you're moving the problem to explaining to your end users 
why the module can't do that for them... ;-)



regards,

Kenneth



Regards,

Caspar


- Original Message -
From: "Åke Sandgren" 
To: "Caspar van Leeuwen" 
Sent: Monday, 8 January, 2018 13:20:47
Subject: Re: [easybuild] Use of EBROOT of a dependency as modextravar

Any env variable that references the installation tree of Bar should be
set in the module file for Bar!

Foo can then use it. It just needs to depend on Bar.

Foo should NOT set any env variables related to Bar!

That is how modules are supposed to work.

On 01/08/2018 01:17 PM, Caspar van Leeuwen wrote:

I'm sorry, maybe I should have clarified: Foo requires BAR_BIN to be
present /at runtime/, so yes, I really do want it to be set in the
module file of Foo. Foo provides a (GUI) wrapper for Bar, but it needs
to know the location of the Bar binary. Rather than searching the path -
as other programs might have done -, Foo uses the BAR_BIN environment
variable to locate and call Bar (in fact, the installation instructions
for Foo list that you have to set 

Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Kenneth Hoste



On 08/01/2018 14:09, Mikael Öhman wrote:

Alans answer is probably the best, but
`BAR_BIN`: '`which bar`'
might work as an alternativ to the Tcl specific hack (untested).


This won't work: `which bar` has no meaning in a module file (which is 
not a shell script).



K.


On Mon, Jan 8, 2018 at 2:01 PM, Alan O'Cais > wrote:


Hi Caspar,

You can use
modextravars = { 'BAR_BIN': '%(installdir)s/bin'}
in the Bar easyconfig. If Bar is a dep of Foo, then when Foo is
loaded Bar will be too and the value will be set. If you /only
/want this to be set if Foo is loaded then that is custom
behaviour and you will need to write a custom easyblock for the
wrapper software (I don't see another way around it).

Kind regards,

Alan

On 8 January 2018 at 13:17, Caspar van Leeuwen
> wrote:

I'm sorry, maybe I should have clarified: Foo requires BAR_BIN
to be present /at runtime/, so yes, I really do want it to be
set in the module file of Foo. Foo provides a (GUI) wrapper
for Bar, but it needs to know the location of the Bar binary.
Rather than searching the path - as other programs might have
done -, Foo uses the BAR_BIN environment variable to locate
and call Bar (in fact, the installation instructions for Foo
list that you have to set BAR_BIN).

Regards,

Caspar


*From: *"Alan O'Cais" >
*To: *"easybuild" >
*Sent: *Monday, 8 January, 2018 12:38:32
*Subject: *Re: [easybuild] Use of EBROOT of a dependency as
modextravar

I think you are misunderstanding the scope of modextravars, it
is there to set additional variables in the resultant module
file from the installation (it is not relevant to the install
process of the software, only the final module file that is
written). The modextravars should be set in the Bar easyconfig
if you wish to leverage it in Foo? Otherwise you just use
something like

preconfigopts = 'BAR_BIN=$EBROOTBAR/bin '

in the Foo easyconfig.

On 8 January 2018 at 12:29, Caspar van Leeuwen
> wrote:

Dear EasyBuilders,


Question: I have a Package Foo that provides a wrapper for
a software package Bar. Thus, in the EasyConfig for Foo, I
list Bar as a dependency.


Now, Foo requires an environment variable BAR_BIN to be
set that points to the Bar binary. Thus, what I would like
to do in the Foo EasyConfig is something like:


modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’}


This doesn’t work: I get an error (something like ‘no
variable EBROOTBAR’). I presume the reason is that in the
modextravars step for 'Foo', the 'Bar' module isn’t
actually loaded - thus EBROOTBAR is not set.


I could use $root (which points to the FOO root, and
//does exist when modextravars is executed) and peal off
the …/Foo/(version)-(toolchain), then add
.../Bar/(version)-(toolchain), but this feels like a very
dirty solution.


Does anyone know of an elegant way to achieve this? And
just to check: is it correct that the dependencies are not
loaded when modextravars is executed?


Best regards,


Caspar van Leeuwen




-- 
Dr. Alan O'Cais

E-CAM Software Manager
Juelich Supercomputing Centre
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone: +49 2461 61 5213 
Fax: +49 2461 61 6656 
E-mail: a.oc...@fz-juelich.de 
WWW: http://www.fz-juelich.de/ias/jsc/EN







Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR
B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
(Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt

Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Kenneth Hoste



On 08/01/2018 15:07, Åke Sandgren wrote:


On 01/08/2018 01:58 PM, Caspar van Leeuwen wrote:

I disagree, because the requirement that the variable 'BAR_BIN' that is set is 
a requirement from Foo, not a 'feature' from Bar. Bar knows absolutely nothing 
about this variable, and is very happy to run without it - thus it has no place 
in a Bar module. To illustrate that more: what if someone tomorrow develops a 
Foo2, which requires another environment variable 'WHERE_CAN_FOO2_FIND_BAR' to 
point to the Bar executable, would you reinstall Bar and put this additional 
variable also in the module file of Bar, just because Foo2 needs it?

Yes, I would re-make the module file for Bar with that env added.


I agree with Caspar on this one: this is a (stupid, but fine) runtime 
configuration variable for Foo, it just happens to point to something 
provided by another module.


So, it should be included in the module generated for Foo, not for Bar, 
for the exact reason that Caspar outlined.


We shouldn't go and let the Bar module jump through hoops because the 
latest hype of the month decides it wants to reinvent how the 
environment works...



regards,

Kenneth



Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Mikael Öhman
On Mon, Jan 8, 2018 at 3:07 PM, Åke Sandgren 
wrote:

>
>
> On 01/08/2018 01:58 PM, Caspar van Leeuwen wrote:
> > I disagree, because the requirement that the variable 'BAR_BIN' that is
> set is a requirement from Foo, not a 'feature' from Bar. Bar knows
> absolutely nothing about this variable, and is very happy to run without it
> - thus it has no place in a Bar module. To illustrate that more: what if
> someone tomorrow develops a Foo2, which requires another environment
> variable 'WHERE_CAN_FOO2_FIND_BAR' to point to the Bar executable, would
> you reinstall Bar and put this additional variable also in the module file
> of Bar, just because Foo2 needs it?
>
> Yes, I would re-make the module file for Bar with that env added.
>
>
If FOO needed "PYTHON_BINARY", I don't think FOO's poor decisions should be
allowed to pollute the Python module.
So then FOOs easyconfig couldn't make it upstream (unless it relied on
everyone doing manual local modifications).
If BAR is almost always used in conjunction with FOO, and there might be
user compiled versions of FOO that depend on BAR and need the same
environment variable etc, then the situation would be different.


Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Åke Sandgren


On 01/08/2018 01:58 PM, Caspar van Leeuwen wrote:
> I disagree, because the requirement that the variable 'BAR_BIN' that is set 
> is a requirement from Foo, not a 'feature' from Bar. Bar knows absolutely 
> nothing about this variable, and is very happy to run without it - thus it 
> has no place in a Bar module. To illustrate that more: what if someone 
> tomorrow develops a Foo2, which requires another environment variable 
> 'WHERE_CAN_FOO2_FIND_BAR' to point to the Bar executable, would you reinstall 
> Bar and put this additional variable also in the module file of Bar, just 
> because Foo2 needs it?

Yes, I would re-make the module file for Bar with that env added.

-- 
Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden
Internet: a...@hpc2n.umu.se   Phone: +46 90 7866134 Fax: +46 90-580 14
Mobile: +46 70 7716134 WWW: http://www.hpc2n.umu.se


Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Mikael Öhman
Alans answer is probably the best, but
`BAR_BIN`: '`which bar`'
might work as an alternativ to the Tcl specific hack (untested).

On Mon, Jan 8, 2018 at 2:01 PM, Alan O'Cais  wrote:

> Hi Caspar,
>
> You can use
> modextravars = { 'BAR_BIN': '%(installdir)s/bin'}
> in the Bar easyconfig. If Bar is a dep of Foo, then when Foo is loaded Bar
> will be too and the value will be set. If you *only *want this to be set
> if Foo is loaded then that is custom behaviour and you will need to write a
> custom easyblock for the wrapper software (I don't see another way around
> it).
>
> Kind regards,
>
> Alan
>
> On 8 January 2018 at 13:17, Caspar van Leeuwen <
> caspar.vanleeu...@surfsara.nl> wrote:
>
>> I'm sorry, maybe I should have clarified: Foo requires BAR_BIN to be
>> present *at runtime*, so yes, I really do want it to be set in the
>> module file of Foo. Foo provides a (GUI) wrapper for Bar, but it needs to
>> know the location of the Bar binary. Rather than searching the path - as
>> other programs might have done -, Foo uses the BAR_BIN environment variable
>> to locate and call Bar (in fact, the installation instructions for Foo list
>> that you have to set BAR_BIN).
>>
>> Regards,
>>
>> Caspar
>>
>> --
>> *From: *"Alan O'Cais" 
>> *To: *"easybuild" 
>> *Sent: *Monday, 8 January, 2018 12:38:32
>> *Subject: *Re: [easybuild] Use of EBROOT of a dependency as modextravar
>>
>> I think you are misunderstanding the scope of modextravars, it is there
>> to set additional variables in the resultant module file from the
>> installation (it is not relevant to the install process of the software,
>> only the final module file that is written). The modextravars should be set
>> in the Bar easyconfig if you wish to leverage it in Foo? Otherwise you just
>> use something like
>>
>> preconfigopts = 'BAR_BIN=$EBROOTBAR/bin '
>>
>> in the Foo easyconfig.
>>
>> On 8 January 2018 at 12:29, Caspar van Leeuwen <
>> caspar.vanleeu...@surfsara.nl> wrote:
>>
>>> Dear EasyBuilders,
>>>
>>>
>>> Question: I have a Package Foo that provides a wrapper for a software
>>> package Bar. Thus, in the EasyConfig for Foo, I list Bar as a dependency.
>>>
>>>
>>> Now, Foo requires an environment variable BAR_BIN to be set that points
>>> to the Bar binary. Thus, what I would like to do in the Foo EasyConfig is
>>> something like:
>>>
>>>
>>> modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’}
>>>
>>>
>>> This doesn’t work: I get an error (something like ‘no variable
>>> EBROOTBAR’). I presume the reason is that in the modextravars step for
>>> 'Foo', the 'Bar' module isn’t actually loaded - thus EBROOTBAR is not set.
>>>
>>>
>>> I could use $root (which points to the FOO root, and does exist when
>>> modextravars is executed) and peal off the …/Foo/(version)-(toolchain),
>>> then add .../Bar/(version)-(toolchain), but this feels like a very dirty
>>> solution.
>>>
>>>
>>> Does anyone know of an elegant way to achieve this? And just to check:
>>> is it correct that the dependencies are not loaded when modextravars is
>>> executed?
>>>
>>>
>>> Best regards,
>>>
>>>
>>> Caspar van Leeuwen
>>>
>>
>>
>>
>> --
>> Dr. Alan O'Cais
>> E-CAM Software Manager
>> Juelich Supercomputing Centre
>> Forschungszentrum Juelich GmbH
>> 52425 Juelich, Germany
>>
>> Phone: +49 2461 61 5213 <02461%20615213>
>> Fax: +49 2461 61 6656 <02461%20616656>
>> E-mail: a.oc...@fz-juelich.de
>> WWW:http://www.fz-juelich.de/ias/jsc/EN
>>
>>
>> 
>> 
>> 
>> 
>> Forschungszentrum Juelich GmbH
>> 52425 Juelich
>> Sitz der Gesellschaft: Juelich
>> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
>> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
>> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
>> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
>> Prof. Dr. Sebastian M. Schmidt
>> 
>> 
>> 
>> 
>>
>>
>>
>
>
> --
> Dr. Alan O'Cais
> E-CAM Software Manager
> Juelich Supercomputing Centre
> Forschungszentrum Juelich GmbH
> 52425 Juelich, Germany
>
> Phone: +49 2461 61 5213 <+49%202461%20615213>
> Fax: +49 2461 61 6656 <+49%202461%20616656>
> E-mail: a.oc...@fz-juelich.de
> WWW:http://www.fz-juelich.de/ias/jsc/EN
>


Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Alan O'Cais
Hi Caspar,

You can use
modextravars = { 'BAR_BIN': '%(installdir)s/bin'}
in the Bar easyconfig. If Bar is a dep of Foo, then when Foo is loaded Bar
will be too and the value will be set. If you *only *want this to be set if
Foo is loaded then that is custom behaviour and you will need to write a
custom easyblock for the wrapper software (I don't see another way around
it).

Kind regards,

Alan

On 8 January 2018 at 13:17, Caspar van Leeuwen <
caspar.vanleeu...@surfsara.nl> wrote:

> I'm sorry, maybe I should have clarified: Foo requires BAR_BIN to be
> present *at runtime*, so yes, I really do want it to be set in the module
> file of Foo. Foo provides a (GUI) wrapper for Bar, but it needs to know the
> location of the Bar binary. Rather than searching the path - as other
> programs might have done -, Foo uses the BAR_BIN environment variable to
> locate and call Bar (in fact, the installation instructions for Foo list
> that you have to set BAR_BIN).
>
> Regards,
>
> Caspar
>
> --
> *From: *"Alan O'Cais" 
> *To: *"easybuild" 
> *Sent: *Monday, 8 January, 2018 12:38:32
> *Subject: *Re: [easybuild] Use of EBROOT of a dependency as modextravar
>
> I think you are misunderstanding the scope of modextravars, it is there to
> set additional variables in the resultant module file from the installation
> (it is not relevant to the install process of the software, only the final
> module file that is written). The modextravars should be set in the Bar
> easyconfig if you wish to leverage it in Foo? Otherwise you just use
> something like
>
> preconfigopts = 'BAR_BIN=$EBROOTBAR/bin '
>
> in the Foo easyconfig.
>
> On 8 January 2018 at 12:29, Caspar van Leeuwen <
> caspar.vanleeu...@surfsara.nl> wrote:
>
>> Dear EasyBuilders,
>>
>>
>> Question: I have a Package Foo that provides a wrapper for a software
>> package Bar. Thus, in the EasyConfig for Foo, I list Bar as a dependency.
>>
>>
>> Now, Foo requires an environment variable BAR_BIN to be set that points
>> to the Bar binary. Thus, what I would like to do in the Foo EasyConfig is
>> something like:
>>
>>
>> modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’}
>>
>>
>> This doesn’t work: I get an error (something like ‘no variable
>> EBROOTBAR’). I presume the reason is that in the modextravars step for
>> 'Foo', the 'Bar' module isn’t actually loaded - thus EBROOTBAR is not set.
>>
>>
>> I could use $root (which points to the FOO root, and does exist when
>> modextravars is executed) and peal off the …/Foo/(version)-(toolchain),
>> then add .../Bar/(version)-(toolchain), but this feels like a very dirty
>> solution.
>>
>>
>> Does anyone know of an elegant way to achieve this? And just to check: is
>> it correct that the dependencies are not loaded when modextravars is
>> executed?
>>
>>
>> Best regards,
>>
>>
>> Caspar van Leeuwen
>>
>
>
>
> --
> Dr. Alan O'Cais
> E-CAM Software Manager
> Juelich Supercomputing Centre
> Forschungszentrum Juelich GmbH
> 52425 Juelich, Germany
>
> Phone: +49 2461 61 5213 <02461%20615213>
> Fax: +49 2461 61 6656 <02461%20616656>
> E-mail: a.oc...@fz-juelich.de
> WWW:http://www.fz-juelich.de/ias/jsc/EN
>
>
> 
> 
> 
> 
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
> 
> 
> 
> 
>
>
>


-- 
Dr. Alan O'Cais
E-CAM Software Manager
Juelich Supercomputing Centre
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone: +49 2461 61 5213
Fax: +49 2461 61 6656
E-mail: a.oc...@fz-juelich.de
WWW:http://www.fz-juelich.de/ias/jsc/EN


Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Caspar van Leeuwen
I disagree, because the requirement that the variable 'BAR_BIN' that is set is 
a requirement from Foo, not a 'feature' from Bar. Bar knows absolutely nothing 
about this variable, and is very happy to run without it - thus it has no place 
in a Bar module. To illustrate that more: what if someone tomorrow develops a 
Foo2, which requires another environment variable 'WHERE_CAN_FOO2_FIND_BAR' to 
point to the Bar executable, would you reinstall Bar and put this additional 
variable also in the module file of Bar, just because Foo2 needs it?

In my view, BAR_BIN, and WHERE_CAN_FOO2_FIND_BAR are things that are specific 
to Foo and Foo2 respectively, and should be set in their modules. The 
commonality is that I would want to use $EBROOTBAR - which is of course set by 
Bar -, to set BAR_BIN/WHERE_CAN_FOO2_FIND_BAR. I agree that this requires the 
additional assumption within the Foo module that the Bar module installs in the 
$EBROOTBAR/bin folder, which is not very nice. However, I think this is a far 
more generic assumption than when the Foo/Foo2 module has to assume that Bar 
sets BAR_BIN/WHERE_CAN_FOO2_FIND_BAR itself.

Thus, while I understand the 'if it references the tree of Bar, it should be 
set by Bar' sentiment, I think that the alternative here (setting environment 
variables required by Foo, Foo2, or whichever package comes next, in the Bar 
module) is simply worse.

So, my question remains: is it correct that I cannot access the EBROOT of 
dependencies from within modextravars? And is there an elegant way to achieve 
this?

My current, not-so-elegant way is:

modextravars = {'BAR_BIN': '$::env(EBROOTBAR)/bin'}

This works, but $::env (which reads EBROOTBAR at the time the module is loaded) 
is - as far as I know - specific for Tcl modules. Also, things like module disp 
Foo get messed up, because EBROOTBAR is not set then. Thus, I'm not very much 
in favor of this solution and looking for a way to have EasyBuild set the path 
for BAR_BIN at installation time.

Regards,

Caspar


- Original Message -
From: "Åke Sandgren" 
To: "Caspar van Leeuwen" 
Sent: Monday, 8 January, 2018 13:20:47
Subject: Re: [easybuild] Use of EBROOT of a dependency as modextravar

Any env variable that references the installation tree of Bar should be
set in the module file for Bar!

Foo can then use it. It just needs to depend on Bar.

Foo should NOT set any env variables related to Bar!

That is how modules are supposed to work.

On 01/08/2018 01:17 PM, Caspar van Leeuwen wrote:
> I'm sorry, maybe I should have clarified: Foo requires BAR_BIN to be
> present /at runtime/, so yes, I really do want it to be set in the
> module file of Foo. Foo provides a (GUI) wrapper for Bar, but it needs
> to know the location of the Bar binary. Rather than searching the path -
> as other programs might have done -, Foo uses the BAR_BIN environment
> variable to locate and call Bar (in fact, the installation instructions
> for Foo list that you have to set BAR_BIN).
> 
> Regards,
> 
> Caspar
> 
> 
> *From: *"Alan O'Cais" 
> *To: *"easybuild" 
> *Sent: *Monday, 8 January, 2018 12:38:32
> *Subject: *Re: [easybuild] Use of EBROOT of a dependency as modextravar
> 
> I think you are misunderstanding the scope of modextravars, it is there
> to set additional variables in the resultant module file from the
> installation (it is not relevant to the install process of the software,
> only the final module file that is written). The modextravars should be
> set in the Bar easyconfig if you wish to leverage it in Foo? Otherwise
> you just use something like
> 
> preconfigopts = 'BAR_BIN=$EBROOTBAR/bin '
> 
> in the Foo easyconfig.
> 
> On 8 January 2018 at 12:29, Caspar van Leeuwen
> >
> wrote:
> 
> Dear EasyBuilders,
> 
> 
> Question: I have a Package Foo that provides a wrapper for a
> software package Bar. Thus, in the EasyConfig for Foo, I list Bar as
> a dependency.
> 
> 
> Now, Foo requires an environment variable BAR_BIN to be set that
> points to the Bar binary. Thus, what I would like to do in the Foo
> EasyConfig is something like:
> 
> 
> modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’}
> 
> 
> This doesn’t work: I get an error (something like ‘no variable
> EBROOTBAR’). I presume the reason is that in the modextravars step
> for 'Foo', the 'Bar' module isn’t actually loaded - thus EBROOTBAR
> is not set.
> 
> 
> I could use $root (which points to the FOO root, and //does exist
> when modextravars is executed) and peal off the
> …/Foo/(version)-(toolchain), then add .../Bar/(version)-(toolchain),
> but this feels like a very dirty solution.
> 
> 
> Does anyone know of an elegant way to achieve this? And just to
> 

Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Caspar van Leeuwen
I'm sorry, maybe I should have clarified: Foo requires BAR_BIN to be present at 
runtime , so yes, I really do want it to be set in the module file of Foo. Foo 
provides a (GUI) wrapper for Bar, but it needs to know the location of the Bar 
binary. Rather than searching the path - as other programs might have done -, 
Foo uses the BAR_BIN environment variable to locate and call Bar (in fact, the 
installation instructions for Foo list that you have to set BAR_BIN). 

Regards, 

Caspar 


From: "Alan O'Cais"  
To: "easybuild"  
Sent: Monday, 8 January, 2018 12:38:32 
Subject: Re: [easybuild] Use of EBROOT of a dependency as modextravar 

I think you are misunderstanding the scope of modextravars, it is there to set 
additional variables in the resultant module file from the installation (it is 
not relevant to the install process of the software, only the final module file 
that is written). The modextravars should be set in the Bar easyconfig if you 
wish to leverage it in Foo? Otherwise you just use something like 

preconfigopts = 'BAR_BIN=$EBROOTBAR/bin ' 

in the Foo easyconfig. 

On 8 January 2018 at 12:29, Caspar van Leeuwen < [ 
mailto:caspar.vanleeu...@surfsara.nl | caspar.vanleeu...@surfsara.nl ] > wrote: 





Dear EasyBuilders, 




Question: I have a Package Foo that provides a wrapper for a software package 
Bar. Thus, in the EasyConfig for Foo, I list Bar as a dependency. 




Now, Foo requires an environment variable BAR_BIN to be set that points to the 
Bar binary. Thus, what I would like to do in the Foo EasyConfig is something 
like: 




modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’} 




This doesn’t work: I get an error (something like ‘no variable EBROOTBAR’). I 
presume the reason is that in the modextravars step for 'Foo', the 'Bar' module 
isn’t actually loaded - thus EBROOTBAR is not set. 




I could use $root (which points to the FOO root, and does exist when 
modextravars is executed) and peal off the …/Foo/(version)-(toolchain), then 
add .../Bar/(version)-(toolchain), but this feels like a very dirty solution. 




Does anyone know of an elegant way to achieve this? And just to check: is it 
correct that the dependencies are not loaded when modextravars is executed? 




Best regards, 





Caspar van Leeuwen 






-- 
Dr. Alan O'Cais 
E-CAM Software Manager 
Juelich Supercomputing Centre 
Forschungszentrum Juelich GmbH 
52425 Juelich, Germany 

Phone: +49 2461 61 5213 
Fax: +49 2461 61 6656 
E-mail: [ mailto:a.oc...@fz-juelich.de | a.oc...@fz-juelich.de ] 
WWW: [ http://www.fz-juelich.de/ias/jsc/EN | 
http://www.fz-juelich.de/ias/jsc/EN ] 



 

 
Forschungszentrum Juelich GmbH 
52425 Juelich 
Sitz der Gesellschaft: Juelich 
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher 
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), 
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, 
Prof. Dr. Sebastian M. Schmidt 

 

 




Re: [easybuild] Use of EBROOT of a dependency as modextravar

2018-01-08 Thread Alan O'Cais
I think you are misunderstanding the scope of modextravars, it is there to set 
additional variables in the resultant module file from the installation (it is 
not relevant to the install process of the software, only the final module file 
that is written). The modextravars should be set in the Bar easyconfig if you 
wish to leverage it in Foo? Otherwise you just use something like

preconfigopts = 'BAR_BIN=$EBROOTBAR/bin '

in the Foo easyconfig.

On 8 January 2018 at 12:29, Caspar van Leeuwen 
> wrote:

Dear EasyBuilders,


Question: I have a Package Foo that provides a wrapper for a software package 
Bar. Thus, in the EasyConfig for Foo, I list Bar as a dependency.


Now, Foo requires an environment variable BAR_BIN to be set that points to the 
Bar binary. Thus, what I would like to do in the Foo EasyConfig is something 
like:


modextravars = {‘BAR_BIN’: ‘$EBROOTBAR/bin’}


This doesn’t work: I get an error (something like ‘no variable EBROOTBAR’). I 
presume the reason is that in the modextravars step for 'Foo', the 'Bar' module 
isn’t actually loaded - thus EBROOTBAR is not set.


I could use $root (which points to the FOO root, and does exist when 
modextravars is executed) and peal off the …/Foo/(version)-(toolchain), then 
add .../Bar/(version)-(toolchain), but this feels like a very dirty solution.


Does anyone know of an elegant way to achieve this? And just to check: is it 
correct that the dependencies are not loaded when modextravars is executed?


Best regards,


Caspar van Leeuwen



--
Dr. Alan O'Cais
E-CAM Software Manager
Juelich Supercomputing Centre
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone: +49 2461 61 5213
Fax: +49 2461 61 6656
E-mail: a.oc...@fz-juelich.de
WWW:http://www.fz-juelich.de/ias/jsc/EN




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt