How do I change the build order of IDL source files in an IDL 7.0 Workbench project?
Topic:
Build order issues can often be avoided by the use of one or more of the appropriate directives like
- COMPILE_OPT STRICTARR
- COMPILE_OPT IDL2
- FORWARD_FUNCTION
--at the top of all routines that call user or library functions. However, there can be times when a specific customized build order is desirable.
In the IDL 7.0 Workbench (IDLDE), there is not a GUI interface way to change the compile order of your IDL source code files in an IDL project. Instead, to explicitly control the way that each of the files in a project are compiled, one needs to write and maintain a custom build command script or program.Discussion:
For example, to make a custom build command script for files named
one.pro
,
two.pro
,
three.pro
, which you would like to compile in the order of the numerical name rather than alphabetical order of the file names. In this case you could create a batch script file called
mybuildcmds.pro
with the following lines:
.compile one
.compile two
.compile three
RESOLVE_ALL
You might then just manually run your IDL build script to compile your project, for example:
(-- and then, if needed, call an IDL SAVE command to create your application *.sav file).
Alternatively, you could place the build script call into the Project->Properties dialog for your project as follows:
- Select the project in question in the Project Explorer window (expose by selecting Window > Show View > Other... > General > Project Explorer)
- Then select the Project->Properties menu item
- Select the "Use a custom build command" button then enter the build batch script command file call, for example:
--into the associated field.

Note that by setting the "Use a custom build command" button, no files in the project will be compiled except as specified by the custom build command script. (Notice also that the "Create a save file" box is checked and a output *.sav file is specified in order to automatically create a save file when the project is built.)
For additional information please also see the IDL help system contents section:
- IDL Workbench Guide > Tasks > Running and Building IDL Projects
and subsections:
- Example Custom Build Routines
- Solving Build Order Problems
For additional information about IDL batch scripts, see the IDL help contents under the section:
- IDL Programmers' Guides > Application Programming > Part I: Application Programming > Executing Batch Jobs in IDL
Related IDL help system topics: RESOLVE_ALL, RESOLVE_ROUTINE, ITRESOLVE, COMPILE_OPT, FOWARD_FUNCTION, .COMPILE
<< keywords: build order, compile order, project files, custom build command, custom build order, batch script file, include file, resolve_routine, itresolve, foward_function, compile_opt, .compile >>
Solution:
[Edit this field in the IDL-based Tech Tip Editor, v62]