comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Need advice on building a project
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Need advice on building a project [message #40041 is a reply to message #33270] Thu, 01 July 2004 20:21 Go to previous message
Robert Barnett is currently offline  Robert Barnett
Messages: 70
Registered: May 2004
Member
For my first major project using IDL, I used version 5.4 and the idlde.
I'm about to move onto a second project and I think that even idlde for
version 6.0 is not terribly useful.

I want to know if anyone has tried this before:

Today I quickly wrote up a (perl) script that allows one to specify the
build order in a heirarchical fashion.

Each directory contains a BuildOrder file which indicates what programs
need to be built but also can contain dependancies on other BuildOrder
files.

The aim of this is to package my programs so that any given group of
programs can be compiled and tested as indepenantly as possible. Also a
package (including it's build order) can be imported and exported
without too much trouble.

I've only written a very simple script and there are no tools or
documentation. I have only attached the code so that you might get some
idea of what I'm getting at. Please do not expect it to actually work
for you.

However, I'm sure that others must have explored similar methods for
doing this. Does anyone know of someone who might have done this already?


--

nrb
Robbie Barnett
@
Research Assistant
wsahs
Nuclear Medicine & Ultrasound
nsw
Westmead Hospital
gov
Sydney Australia
au
+61 2 9845 7223

#! /usr/bin/perl

$debug = 0;
$idlexec = 'idl';
$filename = 'BuildOrder';

$r_commands = [];
$pwd = $ENV{"PWD"};
resolveOrder($r_commands,$filename,"$pwd/");
$debug && print join("\n",@$r_commands);

$startup = $ENV{"IDL_STARTUP"};
if (defined($startup)) {
open(STARTUP,">$startup");
print STARTUP join("\n",@$r_commands) . "\n";
close(STARTUP);
}

$savefile = $ARGV[0];
if (defined($savefile)) {
open(IDL,'|' . $idlexec);
print IDL join("\n",@$r_commands) . "\n";
print IDL "SAVE, FILENAME='$savefile'\n";
print IDL "EXIT\n";
close(IDL);
}

sub resolveOrder {
my ($r_commands,$filename,$directory) = @_;
if (-f $filename) {
$debug && print "Examining $filename\n";
open(ORDER,$filename);
my @lines = (<ORDER>);
close(ORDER);
$debug && print "$filename has " . scalar(@lines) . " lines\n";
foreach $line (@lines) {
$line =~ s/\s+$//;
$line = $line;
if (-f $directory . $line) {
push(@$r_commands,".COMPILE $line");
}
}
foreach $line (@lines) {
$line =~ s/\s+$//;
$line = $line;
if (-d $directory . $line) {
$debug && print "Searching directory $line\n";
$filename = $line . 'BuildOrder';
if (-f $directory . $filename) {
$debug && print "Found Build Order $directory$filename\n";
push(@$r_commands,"CD, '$directory$line'");
resolveOrder($r_commands,$directory.$filename,$directory . $line);
}
}
}
}
}
#! /bin/sh

\rm BuildOrder
ls *pro > BuildOrder
ls -p | grep / >> BuildOrder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: minimum intensity projection
Next Topic: Re: Lambert Projection to Lat Lon

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Oct 20 14:02:47 PDT 2025

Total time taken to generate the page: 2.31978 seconds