Subject: CVS commit: pkgsrc/devel/cfitsio
From: Makoto Fujiwara
Date: 2016-06-18 11:06:11
Message id: 20160618090611.DA382FBB5@cvs.NetBSD.org

Log Message:
Updated devel/cfitsio from 3.37 to 3.39 (from doc/changes.txt)
---------------------------------------
Version 3.39 - April 2016

   - added 2 new routines suggested by Eric Mandel:
      ffhisto3 is similar to ffhisto2, except that it does not close the
         original file.
      fits_open_extlist is similar to fits_open_data except that it opens
         the FITS file and then moves to the first extension in the user-input
	 list of 'good' extensions.

   - in ffpsvc and ffprec, it is necessary to treat CONTINUE, COMMENT, HISTORY,
     and blank name keywords as a special case which must be treated differently
     from other keywords because they have no value field and, by definition,
     have keyword names that are strictly limited in length.

   - added the Fortran wrapper routines for the 2 new string keyword reading
     routines (FTGSKY and FTGKSL), and documented all the routines in the
     FITSIO and CFITSIO users guides.

   - in ffinttyp, added explicit initialization of the input 'negative'
     argument to 0.

   - added new routine to return the length of the keyword value string:
         fits_get_key_strlen / ffgksl.
     This is primarily intended for use with string keywords
     that use the CONTINUE convention to continue the
     value over multiple header records, but this routine can be used
     to get the length of the value string for any type keyword.

   - added new routine to read string-valued keywords:
          fits_read_string_key / ffgsky
     This routine supports normal string keywords as well as long string
     keywords that use the CONTINUE convention. In many cases this routine
     may be more convenient to use then the older fits_read_key_longstr
     routine.

   - changed the prototype of fits_register_driver in fitsio2.h so that the
     pointer definition argument does not have the same name as the pointer
     itself (to work around a bug in the pgcc compiler).

   - added the missing FTDTDM fortran wrapper definition to f77_wrap3.c.

   - modified Makefile.in and configure.in to add LDFLAGS_BIN for task linker
     flages, which will be the same as LDFLAGS except on newer Mac OS X where
     an rpath flag is added.

   - modified Makefile.in to add a new "make utils" command which will \ 
build
     fpack, funpack, cookbook, fitscopy, imcopy, smem, speed, and testprog.
     These programs will be installed into $prfix/bin.

   - fixed a bug when attempting to modify the values in a variable-length
     bit ("X") column in a binary table.

   - reinstated the ability to write HIERARCH keywords that contain characters
     that would not be allowed in a normal 8-character keyword name, which had
     been disabled in the previous release.

Version 3.38 - February 2016

   - CRITICAL BUG FIX:
     The Intel 15 and 16 compilers (and potentially other compilers) may silently
     produce incorrect assembly code when compiling CFITSIO with the -O2 (or
     higher) optimization flag. In particular, this problem could cause  CFITSIO
     to incorrectly read the values of arrays of 32-bit integers in a  FITS file
     (i.e., images with BITPIX = 32 or table columns with TFORM = 'J')  when the
     array is being read into a 'long' integer array in cases where the long
     array elements are 8 bytes long.

     One way to test if a particular system is affected by this problem is to
     compile CFITSIO V3.37 (or earlier) with optimization enabled, and then
     compare the output of the testprog.c program with the testprog.out file
     that is distributed with CFITSIO. If there are any  differences in the
     files, then this system might be affected by this bug. Further tests
     should be performed to determine the exact cause.

     The root cause of this problem was traced to the fact that CFITSIO was
     aliasing an array of 32-bit integers and an array of 64-bit integers to the
     same memory location in order to obtain better data I/O efficiency when
     reading FITS files.  When CFITSIO modified the values in these arrays, it
     was essential that the processing be done in strict sequential order from
     one end of the array to the other end, as was implicit in the C code
     algorithm. In this case, however, the compiler adopted certain  loop
     optimization techniques that produced assembly code that violated  this
     assumption.  Technically, the CFITSIO code violates the "strict \ 
aliasing"
     assumption in ANSI C99, therefore the affected CFITSIO routines have been
     modified so that the aliasing of different data types to the same memory
     location no longer occurs.

   - fixed problem in configure and configure.in which caused the programs that
     are distributed with CFITSIO (most notably, fack and funpack) to be build
     without using any compiler optimization options, which could make them
     run more slowly than expected.

   - in imcompress.c, fixed bug where the rowspertile variable (declared as 'long')
     was mistakenly declared as a TLONGLONG variable in a call to fits_write_key.
     This could have caused the ZTILELEN keyword to be written incorrectly in
     the header of tile-compressed FITS tables on systems where sizeof(long) = 4.

   - in imcompress.c, implemented a new set of routines that safely convert
     shorter integer arrays into a longer integer arrays (e.g. short to int)
     where both arrays are aliased to the same memory location.  These
     special routines were needed to guard against certain compiler optimization
     techniques that could produce incorrect code.

   - modified the 4 FnNoise5_(type) routines in quantize.c to correctly
     count the number of non-null pixels in the input array.  Previously the
     count could be inaccurate if the image mainly consisted of null pixels.
     This could have caused certain floating point image tiles to be
     quantized during the image compression process, when in fact the tile
     did not satisfy all the criteria to be safely quantized.

   - in imcomp_copy_comp2img, added THEAP to the list of binary table
     keywords that may be present in the header of a compressed image
     and should not be copied to the uncompressed image header.

   - modified fits_copy_col to check that when copying a vector column, the
     vector length in the output column is the same as in the input column.
     Also modified the code to support the case where a column is being copied
     to an earlier position in the same table (which shifts the input column
     over 1 space).

   - added configure option (--with-bzip2) to support reading bzip2 compressed
     FITS files.  This also required modifications to drvrmem.c and drvrfile.c
     This depends on having the bzlib library installed on the
     local machine.  This patch was submitted by Dustin Lang.

   - replaced calls to 'memcpy' by 'memmove' in getcolb.c, getcold.c,
     getcole.c, and getcoli.c to support cases where the 2 memory areas
     overlap. (submitted by Aurelien Jarno)

   - modified the FITS keyword reading and writing routines to potentially
     support keywords with names longer than 8-characters.  This was implemented
     in anticipation of a new experimental FITS convention which allows longer
     keyword names.

   - in fits_quantize_double in quantize.c, test if iseed == N_RANDOM,
     to avoid the (unlikely) possibility of overflowing the random number
     array bounds. (The corresponding fits_quantize_float routine already
     performed this test).

   - in the FnNoise5_short routine in quantize.c, change the first 'if'
     statement from "if (nx < 5)" to "if )nx < 9)", in \ 
order to support the
     (very rare) case where the tile is from 5 to 8 pixels wide.  Also make
     the same change in the 3 other similar FnNoise5_* routines.

   - in the qtree_bitins64 routine in fits_hdecompress.c, must declare the
     plane_val variable as 'LONGLONG' instead of int.  This bug could have
     caused integer overflow errors when uncompressing integer*4 images that
     had been compressed with the Hcompress algorithm, but only in cases
     where the image contains large regions of pixels whose values are close
     to the maximum integer*4 value of 2**31.

   - in fits_hcompress.c, call the calloc function instead of malloc when
     allocating the signbits array, to eliminate the need to individually
     set each byte to zero.

   - in the ffinit routine, and in a couple other routines that call ffinit,
     initialize the *fptr input parameter to NULL, even if the input
     status parameter value is greater than zero.  This helps prevent
     errors later on if that fptr value is passed to ffclos.

   - modified ftcopy, in edithdu.c, to only abort if status > 0 rather
     than if status != 0. This had caused a problem in funpack in rare
     circumstances.

   - in imcompress.c changed all the calls to ffgdes to ffgdesll, to support
     compressed files greater than 2.1 GB in size.

   - fixed bug in ffeqtyll when it is called with 4th and 5th arguments
     set to NULL.

   - in fitsio.h, added the standard C++ guard around the declaration of the
     function fits_read_wcstab.  (reported by Tammo Jan Dijkema, Astron.)

   - in fitsio.h, changed the prototype variable name "zero" to \ 
"zeroval" to
     avoid conflict in code that uses a literal definition of 'zero' to mean 0.

   - tweaked Makefile.in and configure.in to use LDFLAGS instead of CFLAGS
     for linking, use Macros for library name, and let fpack and funpack
     link with shared library.

   - modified an 'ifdef' statement in cfileio.c to test for '__GLIBC__'
     instead of 'linux' when initializing support for multi-threading.

   - modified ffeqtyll to return an effective column data type of TDOUBLE
     in the case of a 'K' (64-bit integer) column that has non-integer
     TSCALn or TZEROn keywords.

   - modified ffgcls (which returns the value in a column as a formatted string)
     so that when reading a 'K' (TLONGLONG) column it returns a long long integer
     value if the column is not scaled, but returns a double floating point
     value if the column has non-integer TSCALn or TZEROn values.

   - modified fitsio.h to correctly define "OFF_T long long" when using
     the Borland compiler

   - converted the 'end of line' characters in simplerng.c file to the unix
     style, instead of PC DOS.

   - updated CMakeLists.txt CMake build file which is primarily used to
     build CFITSIO on Windows machines.

   - modified fits_get_keyclass to recognize ZQUANTIZ and ZDITHER0 as
     TYP_CMPRS_KEY type keywords, i.e., keywords used in tile compressed
     image files.

   - added test to see if HAVE_UNISTD_H is defined, as a condition for
     including unistd.h in drvrfile.c drvrnet.c, drvrsmem.c, and group.c.

   - modified the CMakelist.txt file to fix several issues (primarily for
     building CFITSIO on Windows machines)..

   - fixed bug when reading tile-compressed images that were compressed with
     the IRAF PLIO algorithm.  This bug did not affect fpack or funpack, but
     other software that reads the compressed image could be affected.  The
     bug would cause the data values to be offset by 32768 from the actual
     pixel values.

Files:
RevisionActionfile
1.30modifypkgsrc/devel/cfitsio/Makefile
1.8modifypkgsrc/devel/cfitsio/PLIST
1.14modifypkgsrc/devel/cfitsio/distinfo
1.6modifypkgsrc/devel/cfitsio/patches/patch-aa