BobPortmann / IDLCall.jl

Call IDL from Julia
Other
4 stars 4 forks source link

import fails #9

Open AndreWaehlisch opened 7 years ago

AndreWaehlisch commented 7 years ago

When trying to import IDLCall in julia I am getting the following error:

julia> import IDLCall
ls: cannot access '.../bin.*': No such file or directory
ERROR: LoadError: failed process: Process(`bash -c 'ls -d .../bin.*'`, ProcessExited(2)) [2]
 in pipeline_error at process.jl:555
 in readbytes at process.jl:515
 in readall at process.jl:520
while loading .../.julia/v0.4/IDLCall/src/IDLCall.jl, in expression starting on line 9

Where I have blanked (...) the full paths. The problem seems to be that which idl returns the path to a bash script for my system, which then calls IDL, which is of course in a different directory. A better solution may be to look for the environment variable "IDL_DIR". From the documentation:

The IDL_DIR preference provides the value of the !DIR system variable, which contains the location of the IDL distribution that contains the currently running IDL program.

There seems to be another problem, that my system contains IDL with 32 and 64 bit flavor. So my bin directory contains both _bin.linux.x8664 and bin.linux.x86 sub-directories, which leads to an invalid _idl_libdir variable in the IDLCall.jl startup. To get it to run I have to use something like this (not-portable) code:

idl_dir = dirname(ENV["IDL_DIR"])
idl_lib_dir = chomp(readstring(`bash -c "ls -d $(idl_dir)/idl/bin/bin.*_64"`))