Search code examples
idl-programming-language

Difficulty making Healpix compatible with GDL


PROBLEM:

I am having difficulty running Healpix-IDL routines with GDL with the current version of Healpix, Healpix_3.20.

The easiest thing to do would be to follow user gilo in this post:

http://sourceforge.net/p/gnudatalanguage/discussion/338692/thread/6546b9ad/?limit=25#324d

All Healpix IDL routines are downloaded in ~/user/downloads/Healpix_3.20/src/idl

Then, use !PATH i.e.:

GDL> !PATH = expand_path('+/user/myname/downloads/HEALPix_3.20/')+':'+!PATH

and after that you have access to all healpix procedures within gdl

That doesn't work for me. I try the command hidl and hididle in the Terminal (I'm using Mac OS X Yosemite, 10.10.5):

GDL> hidl
% Procedure not found: HIDL
% Execution halted at: $MAIN$

Any other solutions?

POSSIBLE SOLUTIONS: In the installation procedures install.pdf, Section 7.6 hidl usage describes that hidl is sometimes not recognized. A fix is setting the environment variable IDL STARTUP to be equal to the HEALPix startup file HEALPix startup including the directory path to the file, i.e. use

setenv IDL_STARTUP /disk1/user1/HEALPix_2.15a/src/idl/HEALPix_startup for C shell, csh

export IDL_STARTUP="+/disk1/user1/HEALPix_2.15a/src/idl/HEALPix_startup" for s, sh, bash

For my routines, this should be

export IDL_STARTUP="+/usr/downloads/HEALPix_3.20/src/idl/HEALPix_startup"

on bash Terminal (Recall syntax: export key=value is sh, ksh, bash setenv key value is csh) This doesn't work for me. After executing the command, and entering gdl, I get:

% Error opening startup file: /user/myname/downloads/HEALPix_3.20/src/idl/HEALPix_startup

Following Section 7.8 Using GDL instead of IDL, I try

$ export IDL_TMPDIR=/tmp
$ gdl

This doesn't work either. Following Using HEALPix IDL together with other IDL libraries in the IDL routines manual, idl.pdf, I try

export IDL_PATH="+/user/myname/downloads/HEALPix_3.20/src/idl/:+/opt/local/share/gnudatalanguage/lib:<IDL_DEFAULT>"
export IDL_STARTUP="+/user/myname/downloads/HEALPix_3.20/src/idl/HEALPix_startup"gdl`

output error:

% Error opening startup file: /user/myname/downloads/HEALPix_3.20/src/idl/HEALPix_startup.

I try

export IDL_PATH="+/opt/local/share/gnudatalanguage/lib:<IDL_DEFAULT>"
hidl

output error:

-bash: hidl: command not found

Nothing works.

BACKGROUND:

Healpix has the installation procedures here, at source forge.net: healpix.sourceforge.net/pdf/install.pdf

and the IDL routines here: healpix.sourceforge.net/pdf/idl.pdf

The sourcecode is here: sourceforge.net/projects/healpix/

In order to install Healpix, you use ./configure and then make. (See install.pdf, section 4)

Healpix IDL routines are downloaded in /user/myname/downloads/HEALPix_3.20/

GDL routines are located in /opt/local/share/gnudatalanguage/lib/


Solution

  • In subdirectory ~/.healpix/3_20_Darwin there are two files, config and idl.sh.

    The config is

    # configuration for Healpix 3.20
    HEALPIX=/Users/myname/downloads/Healpix_3.20 ; export HEALPIX
    HPX_CONF_DIR=/Users/myname/.healpix/3_20_Darwin
    if [ -r ${HPX_CONF_DIR}/idl.sh ] ; then . ${HPX_CONF_DIR}/idl.sh ; fi
    if [ -r ${HPX_CONF_DIR}/f90.sh ] ; then . ${HPX_CONF_DIR}/f90.sh ; fi
    if [ -r ${HPX_CONF_DIR}/cpp.sh ] ; then . ${HPX_CONF_DIR}/cpp.sh ; fi
    if [ -r ${HPX_CONF_DIR}/c.sh ] ;   then . ${HPX_CONF_DIR}/c.sh ;   fi
    

    The idl.sh file is

    # IDL configuration for HEALPix Fri MONTH DAY TIME EDT YEAR
    # make sure IDL related variables are global
    export IDL_PATH IDL_STARTUP
    # back up original IDL config, or give default value
    OIDL_PATH="${IDL_PATH-<IDL_DEFAULT>}"
    OIDL_STARTUP="${IDL_STARTUP}"
    # create Healpix IDL config, and return to original config after running Healpix-enhanced IDL
    HIDL_PATH="+${HEALPIX}/src/idl:${OIDL_PATH}"
    HIDL_STARTUP="${HEALPIX}/src/idl/HEALPix_startup"
    alias hidl="IDL_PATH=\"${HIDL_PATH}\"   ; IDL_STARTUP=${HIDL_STARTUP} ; idl   ; IDL_PATH=\"${OIDL_PATH}\" ; IDL_STARTUP=${OIDL_STARTUP} "
    alias hidlde="IDL_PATH=\"${HIDL_PATH}\" ; IDL_STARTUP=${HIDL_STARTUP} ; idlde ; IDL_PATH=\"${OIDL_PATH}\" ; IDL_STARTUP=${OIDL_STARTUP} " 
    

    So, if I manually set the paths in this idl.sh file and run config, i.e ~/.config. This should then allow one to use hidl in the command line to run the Healpix IDL routines, right?