Fanning Software Consulting

Coyote Program Will Not Compile

QUESTION: I am trying to use a Coyote Library program. I downloaded a program from the Coyote Library and tried to compile it with this result.

   IDL> .compile SCALE_VECTOR

      void = Error_Message()
                            ^
     % Syntax error.
       At: /users/csh/IDL/SCALE_VECTOR.pro, Line 129
     % 1 Compilation error(s) in module SCALE_VECTOR.

Don't you know how to write programs? You and your programs suck!

ANSWER: Uh, well, I understand your frustration. But, I can assure you, these programs are suppose to compile and work correctly. Occasionally, Coyote will introduce a boneheaded error, but not too often. There are typically three reasons why these programs don't work when you try them.

Reason 1: You Didn't Download the Entire Library

Programs from the Library require other programs in the Library. Be sure you download the entire Coyote Library. You can download the Coyote Library either as a zip file from this web page, or you can download the Coyote Library from a Subversion code repository. You must have a Subversion client installed to use the repository code. The Subversion repository is highly recommended as this is the main repository for all the work I do on the Library. You can use the repository to update to the very lastest version of the Library, or to a particular tagged release. The zip file always contains the very latest version of the Library.

Note that I try extremely hard to keep the Coyote Library free of outside influence. That is to say, even though I personally use many routines from both the IDL Astronomy Library and the Johns Hopkins Applied Physics Lab Library, I do not use these routines in Coyote Library programs. Thus, there are no library dependencies in the Coyote Library, except from the normal IDL user library and from the Coyote Library itself. I try hard to keep the Coyote Library away from cutting edge IDL improvments, but life does goes on. If you are using an older (e.g., IDL 6.3) version of IDL you may find some routines in the Library no longer working for you. If you do, contact me about the problem. It's possible I can retreive an older version of the program that works for you.

Reason 2: You Didn't Add the Coyote Library to your IDL Path

To use the Coyote Library, you must add the library directory to your IDL Path. Please follow the directions below for adding the Coyote Library to your IDL Path.

Coyote Library Installation Procedures

Reason 3: You Have Multiple Coyote Libraries on Your IDL Path

It is possible, especially if you are on a UNIX machine that you have multiple versions of the Coyote Library on your IDL path. It is not at all unusual for me to find 4-5 versions of the Library on the IDL Path of people having difficulty running these programs. Sometimes multiple versions are added by the user himself, and other times the user has added programs (e.g., the SolarSoft astronomy library) that have added Coyote Library programs to their distribution and have not renamed the programs for their own purpose. In this sense, the Coyote Library is a victim of its own success.

Resolving Naming Conflicts

Not all naming conflict problems are easily resolved. If you think you are still having problems after following this advice, here is how to determine what the problem is. First of all, determine which file actually got compiled. For example, if you are running into a problem with a program like PSCONFIG, it is likely that you may have another program with this name on your path, and you are compiling this first, rather than the one you want in the coyote directory. To see which one you compiled, type this:

   IDL> Help, /SOURCE

Now search the output list for “PSCONFIG” and you will find where IDL located the file.

Another way to do this, assuming you know the name of the file you are looking for, is to use the File_Which command in IDL:

   IDL> Print, File_Which('psconfig.pro')

Typically, file naming conflicts are resolved by either moving directories around on the IDL path, or by deleting old files from other directories that are no longer needed. You should strive, whenever possible, to have a single Coyote directory.

Fail Safe Method for Adding Coyote Library to Path

There is one fail safe method to make sure the current Coyote Library directory is found first on your IDL path.

  1. Start IDL.
  2. Use the CD command to move to the Coyote Library directory you want to use.
       IDL> CD, '/home/idl/coyote'
    
  3. Once in the right directory, type "AddToPath". The current directory will be added to the first position in your IDL path. Type "PrintPath" to confirm that the Coyote Library has been added to your IDL path.
       IDL> AddToPath
       IDL> PrintPath
    

This is a temporary solution and is good for just this one particular IDL session. It does not change your IDL path permanently, as other solutions would.

Steps for Installing the Coyote Library on Windows

  1. Download the Coyote Library zip file. You can put the zip file wherever you like on your hard drive. (Note that, if you prefer, you can download the Coyote Library from an open-source Google Code Subversion repository into a directory on your machine using either a Subversion client or Subversion commands directly.)
  2. Extract the zipped files to a local directory. On my C: drive on my Windows machine, I have a top-level directory named idl. It is here that I would create a coyote directory to receive the programs from the zip file. I am going to use the following directory in my examples below.

       C:\idl\coyote
    

    You should substitute into the commands the actual location where you installed the files.

    Installation Alternatives

    It would be perfectly fine if you wanted to install the Coyote files in a directory other that the coyote directory described above. You could, for example, install the file into a coyote directory located in the lib directory in the main IDL distribution (probably something like C:\Program Files\ITT\IDL70\lib), if you had permission to do so. Or, you can name the directory something entirely different. It is not important what you name it, but how it is found on your IDL path.

  3. Given that you have extracted the zip file into the directory above, how do you get the files on your IDL path? There are many possibilities. Let me tell you one I would not recommend.

    I do not recommend that you add this directory as a project to your IDL 7.xx Workbench and let IDL manage the path to the files for you. (Adding the files as a project is a great idea, just do not EVER let IDL manage the paths for you.) If you add them to your Workbench as a project be sure go to the Project -> Properties -> IDL Project Properties tab and turn off the button that says “Update IDL path when project is opened or closed.”

    If you make the files a project in your IDL Workbench then add the directory to the IDL path by going to the Window -> Preferences -> IDL -> Paths tab. Click the Insert... button and search for the coyote directory. Next, select the coyote directory and use the Move Up button to move the coyote directory in front of (toward the top of the window) of other directories on your path. You should now be good to go. If you still find occasional name conflicts, contact me and I'll see what I can do about it. Some name conflicts are probably inevitable. Play around with the order of your files in this path list until you are happy.

    Adding the Coyote Library to your IDL Path.
    Adding the Coyote Library to your IDL Path.
     
  4. If you are not using the IDL Workbench to run IDL, you might be able to do something similar to the IDL Workbench instructions if you are using an IDLDE. There the IDL path preferences are probably in File -> Preferences -> Path. The Insert... button is still there, but you need to use the arrow buttons to the right of the path list to move and order the directories on your IDL path.

  5. If all else fails, you can either include the following IDL command in your IDL start-up file, or you can simply type the command at the IDL command line before you run any Coyote program:

       IDL> !PATH = Expand_Path('+C:\idl\coyote')  + ';' + !PATH
    

    Note the plus sign (+) at the front of the coyote directory name. This tells IDL to search all of the sub-directories of these directories and add them to the path, too. Note also that directories are separated by a semi-colon on Windows machines.

Steps for Installing the Coyote Libray on UNIX

  1. Download the Coyote Library zip file. You can put the zip file wherever you like on your hard drive.
  2. Extract the zipped files to a local directory. On my local hard drive on my UNIX machine, I have a top-level directory named ~/david/idl. It is here that I would create a directory named coyote to receive the programs from the zip file. I am going to use the following directory in my examples below.

       /home/fanning/idl/coyote
    

    You should substitute into the commands the actual location where you installed the files.

    Installation Alternatives

    It would be perfectly fine if you wanted to install the Coyote files in a directory other that the coyote directory described above. You could, for example, install the file into a coyote directory located in the lib directory in the main IDL distribution (probably something like /usr/local/ITT/idl70/lib), if you had permission to do so. Or, you can name the directory something entirely different. It is not important what you name it, but how it is found on your IDL path.

  3. Given that you have extracted the zip file into the directory above, how do you get the files on your IDL path? There are many possibilities. Let me tell you one I would not recommend.

    I do not recommend that you add this directory as a project to your IDL 7.xx Workbench and let IDL manage the path to the files for you. (Adding the files as a project is a great idea, just do not EVER let IDL manage the paths for you.) If you add them to your Workbench as a project be sure go to the Project -> Properties -> IDL Project Properties tab and turn off the button that says “Update IDL path when project is opened or closed.”

    If you make the files a project in your IDL Workbench then add the directory to the IDL path by going to the Window -> Preferences -> IDL -> Paths tab. Click the Insert... button and search for the coyote directory. Next, select the coyote directory and use the Move Up button to move the coyote directory in front of (toward the top of the window) of other directories on your path. You should now be good to go. If you still find occasional name conflicts, contact me and I'll see what I can do about it. Some name conflicts are probably inevitable. Play around with the order of your files in this path list until you are happy.

  4. If you are not using the IDL Workbench to run IDL, it is more likely that you are defining your IDL path be defining environment variables in a .cshrc, .bashrc, or .profile file. For example, in a .bashrc file, you could add the coyote directory to your current IDL path ($IDL_PATH) by adding a command like this:

       export IDL_PATH=+/home/fanning/idl/coyote:$IDL_PATH
    

    Note the plus sign (+) in front of the coyote directory name. This is an indication that IDL should expand this path to include all of the sub-directories under this directory and add these to the IDL path, too.

    I typically define my IDL path in an IDL start-up file. The start-up file is also defined by an environment variable ($IDL_STARTUP). For example, in my .profile file I have this line:

       export IDL_STARTUP=/home/fanning/idl/idlstartup.pro
    

    Then, in my IDL start-up file, which is simply a text file that gets executed upon starting up IDL, as if I were typing the commands at the IDL command line, I have the following lines of code which define my IDL path:

       !PATH =  Expand_Path('+~/idl/coyote') + ':' + $
                Expand_Path('+~/idl/catalyst') + ':' + $
                Expand_Path('+~/idl/david') + ':' + $
                Expand_Path('~/idl/idl_util') + ':' + $
                Expand_Path('~/idl/idl_grids') + ':' + $
                !PATH
    

    Note the plus sign (+) at the front of the coyote and catalyst directory names. This tells IDL to search all of the sub-directories of these directories and add them to the path, too. Note also that directories are separated by colons in a UNIX environment.

  5. If all else fails, you can simply type the following IDL command at the IDL command line before you run any Coyote program:

       IDL> !PATH = Expand_Path('+~/idl/coyote') + ':' + !PATH
    

    Note the plus sign (+) at the front of the coyote directory name. This tells IDL to search all of the sub-directories of these directories and add them to the path, too.

Version of IDL used to prepare this article: IDL 7.0.1.

Last Updated: 20 March 2011