[Scons-users] using scons for workflow
Gary Oberbrunner
garyo at oberbrunner.com
Wed Jul 9 21:00:35 EDT 2014
env=Environment(...)
a_out = env.Command('a_out', [], 'a_script > $TARGET')
b_out = env.Command('b_out', a_out, 'b_script $SOURCE > $TARGET')
r_out = env.Command('r_out', [r_script, b_out], 'r $SOURCES[0] <
$SOURCES[1] > $TARGET') # or however r is really invoked
and so on. See the Command builder examples in the Users Guide for more:
http://www.scons.org/doc/HTML/scons-user/ch19.html
On Wed, Jul 9, 2014 at 8:44 PM, Keith Brown <keith6014 at gmail.com> wrote:
> thanks for the response.
>
> i suppose I am looking for a dependency example.
>
> outputdir="/tmp/data"
>
> 1) run a shell script A
> 2) run a shell script B with Shell script A's output
> 3) run a R script with output of script B
>
> Would like to see how the experts will do it.
>
>
>
> On Wed, Jul 9, 2014 at 8:10 PM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>> Keith,
>>
>> I cannot give you explicit advice with such a generic example but I can
>> point to documentation that should help. The SCons documentation is very
>> robust, so please check it out.
>>
>> 1. Make your source tree fit your needs. Here's info for hierarchical
>> builds:
>> http://www.scons.org/doc/production/HTML/scons-user.html#chap-hierarchical
>> 2. I keep build variables internal to scons whenever possible. Keep in
>> mind that SConscripts are read completely before targets are built, so
>> order doesn't matter as long as you are setting the correct
>> SCons.Environment object. You should not need to export the required
>> environment variables into the python interpreter environment. This is
>> outside my general usage, so if I'm wrong someone will correct me I hope.
>> http://www.scons.org/doc/production/HTML/scons-user.html#chap-environments
>> 3. Look here:
>> http://www.scons.org/doc/production/HTML/scons-user.html#idp284960
>>
>> V/R,
>> William
>>
>>
>> On Wed, Jul 9, 2014 at 7:57 PM, Keith Brown <keith6014 at gmail.com> wrote:
>>
>>> At the moment I am using Make for my workflow eventhough this isn't for
>>> source code compilation. I have several tasks which execute Python, R, Perl
>>> and Shell scripts.
>>>
>>> Some of these tasks last for few minutes to hours and obviously I don't
>>> want to rerun everything if not needed.
>>>
>>> I was wondering if anyone has been doing something similar to what I am
>>> doing.
>>>
>>> So, far my question are:
>>>
>>> How do you setup the directory structure? I know there will be a
>>> SConstruct file.
>>> How do you handle environment variables? Does each one of my script
>>> (R,Perl,etc..) need to explicitly set? Ideally, I would like my SConstruct
>>> file to have the environment variables.
>>> Once my output file is created, I would like to test it for existence
>>> (obvious) and also the size of the file.
>>>
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> http://four.pairlist.net/mailman/listinfo/scons-users
>>>
>>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140709/ee7026c5/attachment.html>
More information about the Scons-users
mailing list