iraf-community / iraf-fitsutil

FITS utilities
https://iraf.readthedocs.io/en/latest/tasks/fitsutil
Other
1 stars 1 forks source link

Use mkfloat.sh in mkpkg #10

Closed olebole closed 5 years ago

olebole commented 5 years ago

IRAF now uses /bin/sh compatible scripts instead of (t)csh. Since the shell name is encoded in the suffix, this needs to be changed in mkpkg.

Closes #9

vall33 commented 5 years ago

maybe this is only part of the problem. The instructions are incomplete as one needs to source $hlib/irafuser.csh in order to compile. However, irafuser.csh has this line:

setenv XC_CFLAGS "${CPPFLAGS} ${CFLAGS} -I${iraf}include"

I do not have CPPLAGS and CFLAGS variable defined and nothing after that line is sources. I get lots of complains about undefined HSI_CF. Could this be a problem for compiling IRAF as well? I managed to compile it, but when running the tests, 2 are skipped and one fails.

Also mkpkg gives these two messages:

envinit: cannot open /home/data/iraf/extern/fitsutil/fitsutillib/zzsetenv.def' Warning, mkpkg line 0: cannot openfitsutil$lib/mkpkg.inc'

in particular there is no fitsutillib directory and thus zzsetenv.def is not read

olebole commented 5 years ago

Thank you very much for looking deeper into the package build! Do you use (t)csh or bash? In the latter case (which works now for IRAF), you should source unix/hlib/irafuser.sh instead.

olebole commented 5 years ago

when running the tests, 2 are skipped and one fails.

One test (for IRAF) usually xfails, where the x means "expected failure". Is this the case?

vall33 commented 5 years ago

it is xfalis I think.

I use tcsh, but I will try with bash now

olebole commented 5 years ago

For tcsh, source irafuser.csh terminates on the first error, which is the case here (need to fix that, thanks for reporting!). For the moment, you should either switch to bash, or define the undefined variables to be empty.

olebole commented 5 years ago

see iraf-community/iraf#86 for a fix of the aborting tcsh source.

vall33 commented 5 years ago

The complier problem is now solved, but I still get:

envinit: cannot open /home/data/iraf/extern/fitsutil/fitsutillib/zzsetenv.def' Warning, mkpkg line 0: cannot open fitsutil$lib/mkpkg.inc'

It seems 'fitsutillib' should be just 'lib', but I cannot figure out where the error comes from. The directory is correctly set in extern.pkg

olebole commented 5 years ago

You should (not written in the README yet) do a setenv fitsutil <path>/ (tcsh) resp. export fitsutil=<path>/ (bash). I'll add this there (in some other external packages it is described)

vall33 commented 5 years ago

that worked. It is indeed described in the mscred package. Thanks for the help

olebole commented 5 years ago

Back to the original PR: I think this would be a good opportunity to remove a bad-style solution from IRAF: for the user, the script language of mkfloat.(c)sh does not matter at all (as long as the script interpreter is installed). So, the ending should be removed completely. If in some future the script is rewritten in Python, this shall not cause another incompatibility then. So, I will rename the script to hlib$mkfloat without any suffix, and adjust the external packages accordingly.