1

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/

EB2127
  • 1,788
  • 3
  • 22
  • 43

2 Answers2

1

hidl is an alias to start IDL with the Healpix startup file and path. Type it on the system command line, not the IDL command line. You must run through their configure system to define hidl.

mgalloy
  • 2,356
  • 1
  • 12
  • 10
  • Thanks for the help. Input `hidl` in the command line results in `-bash: hidl: command not found`. If I set the path using `!PATH=expand_path()` above inside GDL, quit, and then use `hidl`, it also doesn't work. Typing `export IDL_STARTUP="+/usr/downloads/HEALPix_3.20/src/idl/HEALPix_startup"` and then `hidl` in the Terminal also doesn't work. The Healpix configure system doesn't seem to affect `hidl`. – EB2127 Sep 12 '15 at 00:19
  • Did you run the `config` file the `configure` command creates in your home directory? You would do something like `. ~/.healpix/3_20_Darwin/config`. – mgalloy Sep 12 '15 at 03:53
  • In subdirectory `~/.healpix/3_20_Darwin` there are two files, `config` and `idl.sh`. See the answer below for more comments. – EB2127 Sep 12 '15 at 13:50
  • I found the error. My error was that for GDL_STARTUP, one cannot include the plus +, i.e. `export GDL_STARTUP="/Users/myname/downloads/Healpix_3.20/src/idl/HEALPix_startup"` but for GDL_PATH you should include the plus +, i.e. `export GDL_PATH="+/Users/myname/downloads/HEALPix_3.20/src/idl/:+/opt/local/share/gnudatalanguage/lib:"` – EB2127 Sep 14 '15 at 14:50
1

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?

EB2127
  • 1,788
  • 3
  • 22
  • 43
  • For me, I just ran the `config` file and then I could run `hidl` from the command line. `hidl` just starts IDL with some paths set. – mgalloy Sep 12 '15 at 18:17
  • You mean, you first typed into the command line `. ~/.healpix/3_20_Darwin/config` and then input `hidl`? It doesn't work for me. I get `-bash: idl: command not found`. – EB2127 Sep 12 '15 at 20:17
  • Or do you mean, you ran `./configure` as detailed in Section 4 here: http://healpix.sourceforge.net/pdf/install.pdf Neither work. – EB2127 Sep 12 '15 at 20:22
  • I had previously ran `./configure`, that is what creates `~/.healpix/3_20_Darwin`. Then I run `. ~/.healpix/3_20_Darwin/config`, which should give you an `hidl` command. You are going to have to modify this `config` file if you want it to launch GDL instead of IDL. – mgalloy Sep 13 '15 at 15:27
  • @mgalloy The `config` file looks like it has no dependency on GDL. (By the way, I would use IDL, but poverty. I'm sorry.) I have edited the file `idl.sh` to be GDL compatible by editing all `IDL` to become `GDL`. Still, the `hidl` doesn't work. I'm not sure why.... – EB2127 Sep 13 '15 at 20:05