With the introduction of the routine make_rt in IDL 7.0, it became possible to build IDL runtime applications for platforms different from the one in use. In IDL 7.1 make_rt has 10 choices of platforms for different architectures of Linux, Windows, Mac OS and Solaris. However, the documentation does not make it very obvious that the some of the files IDL uses to build applications for other platforms are not present in a “normal” installation. The good news is that this can be fixed by simply providing the missing files to make_rt:
These missing files are the binaries that make up the IDL virtual machine. Those that are installed with IDL reside in subdirectories in the bin directory, such as idl71/bin/bin.linux.x86 for 32-bit Linux, and idl71/bin/bin.x86_64/ for 64-bit Windows. When make_rt is run, it looks for the files needed for the platforms selected, and copies them into the directory where the runtime is created. By default, make_rt looks for them in the IDL installation directory, but it can be told to look for them somewhere else with the idldir keyword. It knows which files to use looking in its manifest file (defaults to bin/make_rt/manifest_rt.txt).
So all that was missing was to find all the proper files and put them together in a place make_rt can find. I packed together all the files in the default manifest for Linux 32 and 64, Windows 32 and 64, and Mac PPC, Intel 32 and Intel 64 in a tar file. Its contents could be put into IDL’s installation directory, but I prefer to put them somewhere else, and them give that path to make_rt with the idldir keyword. One of the reasons for that is that putting them into IDL’s installation directory may overwrite some files that might have been changed after the installation, or recreate files that might have been removed after installation to make some installations work.
The tar file I built is idl71_rt.tar.gz. It is 212MB, and its contents take 554MB. I built it with all the files in the manifest that were present in installations of IDL 7.1 for Linux, Windows and Mac. In case you are wondering, all the files in that tar file are those that IDL may copy into a runtime application, and are just part of IDL’s virtual machine, which anybody can freely download from ITTVIS’ website. Runtime applications are just a way of packing a compiled program (the sav file) and the virtual machine together, so that the person to use your program does not have to download and install the virtual machine. So I do not see any copyright issues with using the contents of that tar file with make_rt.
The file idl80_rt.tar.gz has the equivalent content as the one mentioned above, but with the binaries of IDL 8.0. (and without the PPC Mac binaries, which seem to not be included anymore in the installation file). This is based on manifest_idl80_rt.txt.
A distribution for IDL 8.3 (all platforms currently supported: Linux, Windows 64/32, Mac, Solaris x86_64/sparc64) has been produced: idl83rt.tar.gz (380 MB)
I have tested using it to build Windows applications in Linux, Linux applications in Windows, and Mac applications in Linux. It has worked, though I found two caveats:
1) The startup script made in Windows for Linux had CR+LF ending the lines, which does not seem to work in a Linux shell. So I had to use dos2unix on that file to fix it. Of course there are plenty of converters that can be used to fix the file while still in Windows, but this is simple enough that I wrote a small IDL program to do it: pp_dos2unix.pro.
2) The launcher for Mac does not get created in Linux, because its is missing osacompile to make it. It could be solved by either running osacompile in the Mac, to generate the .app file from the _mac_script_source.txt file made by make_rt, or by just calling the program from the terminal (which can be put into a script similar to the one make_rt makes for Linux).
This came out of a discussion in the IDL newsgroup. Most of this I found out experimenting, since the documentation is a bit scarce on this subject.
The files idl_851_rt.tar.gz (238 MB) and idl_84_rt.tar.gz (240 MB) have the equivalent content as the one mentioned above, but with the binaries of IDL 8.5.1 / 8.4, for Linux 64-bit, Mac OS 64-bit, and Windows 64/32. I have not included the Solaris binaries, but I could add them if users request. As of IDL 8.4, Linux 32-bit has been dropped by Harris Geospatial. This is based on manifest_idl851_rt.txt / manifest_idl84_rt.txt.
As Bernat Puigdomenech pointed out in this thread, the manifest file was not included in my tar file. Since other IDL versions have slightly different manifest files, it is better to use these bin directories with the manifest of the same version that generated them (with the manifest keyword of make_rt). The manifest I used (from IDL 7.1.1) is manifest_idl71_rt.txt.
Also, Bernat has informed me that there are some additional difficulties with osacompile in 64 bit Snow Leopard:
The problem with the new MAC OS, Snow Leopard, is that runs with 64 bits and osacompile uses drivers from Adobe compiled in 32 bits. It’s simply the fact that it’s running the x86_64 binary, and the Adobe Unit Types Scripting Addition doesn’t have that binary mode compiled in.
When IDL calls SPAWN, ‘osacompile -o …..’ in the MAKE_RT routine, the program crashes with the following error:
2009-09-02 23:10:51.123 osascript[708:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
So we have 2 ways to solve this problem:Creating the .app launcher specifying 32 bits: arch -i386 osacompile ...... Downloading the new drivers from Adobe: http://kb2.adobe.com/cps/516/cpsid_51615.html
If you find anything I wrote is wrong or incomplete, please let me know.