cfitsio-4.0.0/0000755000175000017500000000000014051334376013333 5ustar cagordoncagordoncfitsio-4.0.0/CMakeLists.txt0000755000175000017500000002473214051334376016106 0ustar cagordoncagordon#============================================================================== # CFITSIO CMakeLists.txt #============================================================================== # Ensure that build directory is not the source directory: IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "Please create a separate directory for building CFITSIO." ) ENDIF() CMAKE_MINIMUM_REQUIRED(VERSION 3.1) # Suppress warning about WIN32 no longer being defined on Cygwin: SET(CMAKE_LEGACY_CYGWIN_WIN32 0) PROJECT(CFITSIO DESCRIPTION "Library of C and Fortran subroutines for reading and writing data files in FITS data format." LANGUAGES C CXX ) # Define project version SET(${PROJECT_NAME}_MAJOR_VERSION 4) SET(${PROJECT_NAME}_MINOR_VERSION 0) SET(${PROJECT_NAME}_MICRO_VERSION 0) SET(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_MICRO_VERSION}) SET(LIB_NAME cfitsio) # Allow @rpath token in target install name on Macs. # See "cmake --help-policy CMP0042" for more information. IF(POLICY CMP0042) CMAKE_POLICY(SET CMP0042 NEW) ENDIF() INCLUDE(CheckLibraryExists) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckCSourceCompiles) #============================================================================== # Build options: #============================================================================== # Allow the developer to select if Dynamic or Static libraries are built OPTION(BUILD_SHARED_LIBS "Build Shared Libraries" ON) # Allow curl dependency to be disabled with "-DUSE_CURL=OFF": OPTION(USE_CURL "USE_CURL" ON) OPTION(USE_PTHREADS "Thread-safe build (using pthreads)" OFF) OPTION(TESTS "Build test programs Testprog and cookbook" OFF) OPTION(UTILS "Build FPack, Funpack, and Fitscopy executables" OFF) OPTION(CFITSIO_USE_SSE2 "Enable use of instructions in the SSE2 extended instruction set" OFF) OPTION(CFITSIO_USE_SSSE3 "Enable use of instructions in the SSSE3 extended instruction set" OFF) IF(NOT WIN32) OPTION(CFITSIO_USE_BZIP2 "Enable bzip2 support" OFF) ENDIF() #============================================================================== FIND_PACKAGE(ZLIB REQUIRED) IF(BUILD_SHARED_LIBS) SET (LIB_TYPE SHARED) ELSE() SET (LIB_TYPE STATIC) ENDIF(BUILD_SHARED_LIBS) IF(NOT MSVC) # Find curl library, for HTTPS support: IF(USE_CURL) FIND_PACKAGE(CURL) IF(CURL_FOUND) ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) ENDIF() ENDIF() ENDIF(NOT MSVC) IF(USE_PTHREADS) FIND_PACKAGE(Threads REQUIRED) ADD_DEFINITIONS(-D_REENTRANT) ENDIF(USE_PTHREADS) IF(CFITSIO_USE_BZIP2) FIND_PACKAGE(BZip2 REQUIRED) ADD_DEFINITIONS(-DHAVE_BZIP2=1) ENDIF(CFITSIO_USE_BZIP2) # Math library (not available in MSVC or MINGW) IF(MSVC OR MINGW) SET(M_LIB "") ELSE() FIND_LIBRARY(M_LIB m) ENDIF() # Support for remote file drivers is not implemented for native Windows: IF (NOT MSVC) # Find library needed for gethostbyname: CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) IF (NOT CMAKE_HAVE_GETHOSTBYNAME) CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_HAVE_GETHOSTBYNAME) ENDIF () # Find library needed for connect: CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) IF (NOT CMAKE_HAVE_CONNECT) CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_HAVE_CONNECT) ENDIF () # Define HAVE_NET_SERVICES if gethostbyname & connect were found: IF (CMAKE_HAVE_GETHOSTBYNAME AND CMAKE_HAVE_CONNECT) ADD_DEFINITIONS(-DHAVE_NET_SERVICES) CHECK_SYMBOL_EXISTS(fmemopen "stdio.h" HAVE_FMEMOPEN) IF(HAVE_FMEMOPEN) ADD_DEFINITIONS(-DHAVE_FMEMOPEN) ENDIF() ENDIF() ENDIF() IF(MSVC OR BORLAND) # Define ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) # Need an empty unistd.h in MSVC for flex-generated eval_l.c: FILE(WRITE ${CMAKE_SOURCE_DIR}/unistd.h "") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) ENDIF() IF(BORLAND) # Suppress spurious Borland compiler warnings about "Suspicious # pointer arithmetic", "Possibly incorrect assignment", and # "Comparing signed and unsigned values". ADD_DEFINITIONS(-w-spa) ADD_DEFINITIONS(-w-pia) ADD_DEFINITIONS(-w-csu) ENDIF() IF(CFITSIO_USE_SSE2) IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ADD_COMPILE_OPTIONS(-msse2) ENDIF() IF(MSVC) ADD_DEFINITIONS(-D__SSE2__=1) ENDIF() ENDIF() IF(CFITSIO_USE_SSSE3) IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ADD_COMPILE_OPTIONS(-mssse3) ENDIF() IF(MSVC) ADD_DEFINITIONS(-D__SSE2__=1 -D__SSSE3__=1) ENDIF() ENDIF() # Test for the unix ftruncate function CHECK_SYMBOL_EXISTS(ftruncate "unistd.h" HAVE_FTRUNCATE) IF(HAVE_FTRUNCATE) ADD_DEFINITIONS(-DHAVE_UNISTD_H -DHAVE_FTRUNCATE) ENDIF() # Check is System V IPC is supported on this machine CHECK_C_SOURCE_COMPILES(" #include #include #include int main() { shmat(0,0,0); shmdt(0); shmget(0, 0, 0); semget(0, 0, 0); return 0; }" HAVE_SHMEM_SERVICES) IF(HAVE_SHMEM_SERVICES) ADD_DEFINITIONS(-DHAVE_SHMEM_SERVICES) # Some systems define flock_t, for others we have to define it ourselves CHECK_C_SOURCE_COMPILES(" #include int main() { flock_t filler; return 0; }" HAVE_FLOCK_T) IF(HAVE_FLOCK_T) ADD_DEFINITIONS(-DHAVE_FLOCK_T) ENDIF() # Check union semun CHECK_C_SOURCE_COMPILES(" #include #include #include int main() { union semun filler; return 0; }" HAVE_UNION_SEMUN) IF(HAVE_UNION_SEMUN) ADD_DEFINITIONS(-DHAVE_UNION_SEMUN) ENDIF() ENDIF() IF(WIN32 AND BUILD_SHARED_LIBS) ADD_DEFINITIONS(-Dcfitsio_EXPORTS) ENDIF() #============================================================================== # CFITSIO source code: #============================================================================== set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/") set (BIN_DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") SET(H_FILES fitsio.h fitsio2.h longnam.h) SET(SRC_FILES buffers.c cfileio.c checksum.c drvrfile.c drvrmem.c drvrnet.c drvrsmem.c editcol.c edithdu.c eval_f.c eval_l.c eval_y.c f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c fits_hcompress.c fits_hdecompress.c fitscore.c getcol.c getcolb.c getcold.c getcole.c getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c getcolui.c getcoluj.c getcoluk.c getkey.c group.c grparser.c histo.c imcompress.c iraffits.c modkey.c pliocomp.c putcol.c putcolb.c putcold.c putcole.c putcoli.c putcolj.c putcolk.c putcoll.c putcols.c putcolsb.c putcolu.c putcolui.c putcoluj.c putcoluk.c putkey.c quantize.c region.c ricecomp.c scalnull.c simplerng.c swapproc.c wcssub.c wcsutil.c zcompress.c zuncompress.c ) # For future modifications: # drvrsmem.c is only usable if HAVE_SHMEM_SERVICES is defined: #drvrsmem.c # drvrgsiftp.c is only usable if HAVE_NET_SERVICES & HAVE_GSIFTP are defined: #drvrgsiftp.c #============================================================================== # Add libraries: #============================================================================== ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) # Math: TARGET_LINK_LIBRARIES(${LIB_NAME} ${M_LIB}) # zlib: IF (ZLIB_FOUND) TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${ZLIB_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${LIB_NAME} ${ZLIB_LIBRARIES}) ENDIF(ZLIB_FOUND) # cURL: IF (CURL_FOUND) TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${CURL_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBRARIES}) ENDIF(CURL_FOUND) # PThreads: IF (THREADS_FOUND) TARGET_LINK_LIBRARIES(${LIB_NAME} Threads::Threads) ENDIF(THREADS_FOUND) # BZip2: IF (BZIP2_FOUND) TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC ${BZIP2_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(${LIB_NAME} ${BZIP2_LIBRARIES}) ENDIF(BZIP2_FOUND) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) install(TARGETS ${LIB_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) #============================================================================== # Optional test programs: #============================================================================== IF (TESTS) ENABLE_TESTING() ADD_EXECUTABLE(TestProg testprog.c) TARGET_LINK_LIBRARIES(TestProg ${LIB_NAME}) ADD_TEST(TestProg TestProg) # Copy testprog.tpt to build directory to allow quick test # of ./TestProg (or .\Release\TestProg.exe in MSVC): FILE(COPY ${CMAKE_SOURCE_DIR}/testprog.tpt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) ADD_EXECUTABLE(cookbook cookbook.c) TARGET_LINK_LIBRARIES(cookbook ${LIB_NAME}) ADD_TEST(cookbook cookbook) ENDIF(TESTS) #============================================================================== # Optional utilities: #============================================================================== IF (UTILS) ADD_EXECUTABLE(FPack fpack.c fpackutil.c) TARGET_LINK_LIBRARIES(FPack ${LIB_NAME}) ADD_EXECUTABLE(Funpack funpack.c fpackutil.c) TARGET_LINK_LIBRARIES(Funpack ${LIB_NAME}) ADD_EXECUTABLE(Fitscopy fitscopy.c) TARGET_LINK_LIBRARIES(Fitscopy ${LIB_NAME}) # To expand the command line arguments in Windows, see: # http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx if(MSVC) set_target_properties(FPack Funpack PROPERTIES LINK_FLAGS "setargv.obj") endif(MSVC) install(TARGETS FPack Funpack Fitscopy RUNTIME DESTINATION bin) ENDIF(UTILS) #============================================================================== # cfitsio.pc #============================================================================== configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cfitsio.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc DESTINATION lib/pkgconfig/) cfitsio-4.0.0/License.txt0000644000175000017500000000260214051334376015456 0ustar cagordoncagordonCopyright (Unpublished--all rights reserved under the copyright laws of the United States), U.S. Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S. Code. Permission to freely use, copy, modify, and distribute this software and its documentation without fee is hereby granted, provided that this copyright notice and disclaimer of warranty appears in all copies. DISCLAIMER: THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NASA BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER. cfitsio-4.0.0/Makefile.in0000644000175000017500000001373514051334376015411 0ustar cagordoncagordon# # Makefile for cfitsio library: # # Oct-96 : original version by # # JDD/WDP # NASA GSFC # Oct 1996 # # 25-Jan-01 : removed conditional drvrsmem.c compilation because this # is now handled within the source file itself. # 09-Mar-98 : modified to conditionally compile drvrsmem.c. Also # changes to target all (deleted clean), added DEFS, LIBS, added # DEFS to .c.o, added SOURCES_SHMEM and MY_SHMEM, expanded getcol* # and putcol* in SOURCES, modified OBJECTS, mv changed to /bin/mv # (to bypass aliasing), cp changed to /bin/cp, add smem and # testprog targets. See also changes and comments in configure.in # Default library name: PACKAGE = cfitsio # CFITSIO version numbers: CFITSIO_MAJOR = @CFITSIO_MAJOR@ CFITSIO_MINOR = @CFITSIO_MINOR@ CFITSIO_MICRO = @CFITSIO_MICRO@ CFITSIO_SONAME = @CFITSIO_SONAME@ prefix = @prefix@ exec_prefix = @exec_prefix@ CFITSIO_BIN = ${DESTDIR}@bindir@ CFITSIO_LIB = ${DESTDIR}@libdir@ CFITSIO_INCLUDE = ${DESTDIR}@includedir@ INSTALL_DIRS = ${DESTDIR}@INSTALL_ROOT@ ${CFITSIO_INCLUDE} ${CFITSIO_LIB} ${CFITSIO_LIB}/pkgconfig SHELL = /bin/sh ARCHIVE = @ARCHIVE@ RANLIB = @RANLIB@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ SSE_FLAGS = @SSE_FLAGS@ FC = @FC@ LDFLAGS = @LDFLAGS@ LDFLAGS_BIN = @LDFLAGS_BIN@ DEFS = @DEFS@ LIBS = @LIBS@ LIBS_CURL = @LIBS_CURL@ FLEX = flex BISON = bison SHLIB_LD = @SHLIB_LD@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ CFITSIO_SHLIB = @CFITSIO_SHLIB@ CFITSIO_SHLIB_SONAME = @CFITSIO_SHLIB_SONAME@ CORE_SOURCES = buffers.c cfileio.c checksum.c drvrfile.c drvrmem.c \ drvrnet.c drvrsmem.c editcol.c edithdu.c eval_l.c \ eval_y.c eval_f.c fitscore.c getcol.c getcolb.c getcold.c getcole.c \ getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c \ getcoluk.c getcolui.c getcoluj.c getkey.c group.c grparser.c \ histo.c iraffits.c \ modkey.c putcol.c putcolb.c putcold.c putcole.c putcoli.c \ putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c \ putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c \ swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c \ pliocomp.c fits_hcompress.c fits_hdecompress.c \ simplerng.c @GSIFTP_SRC@ ZLIB_SOURCES = zcompress.c zuncompress.c SOURCES = ${CORE_SOURCES} ${ZLIB_SOURCES} @F77_WRAPPERS@ OBJECTS = ${SOURCES:.c=.o} CORE_OBJECTS = ${CORE_SOURCES:.c=.o} ${ZLIB_SOURCES:.c=.o} FITSIO_SRC = f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c # ============ description of all targets ============= # - <<-- ignore error code all: @if [ "x${FC}" = x ]; then \ ${MAKE} all-nofitsio; \ else \ ${MAKE} stand_alone; \ fi all-nofitsio: ${MAKE} stand_alone "FITSIO_SRC=" stand_alone: lib${PACKAGE}.a shared lib${PACKAGE}.a: ${OBJECTS} ${ARCHIVE} $@ ${OBJECTS}; \ ${RANLIB} $@; shared: lib${PACKAGE}${SHLIB_SUFFIX} lib${PACKAGE}${SHLIB_SUFFIX}: ${OBJECTS} ${SHLIB_LD} ${LDFLAGS} -o ${CFITSIO_SHLIB} ${OBJECTS} -lm ${LIBS_CURL} ${LIBS} @if [ "x${CFITSIO_SHLIB_SONAME}" != x ]; then \ ln -sf ${CFITSIO_SHLIB} ${CFITSIO_SHLIB_SONAME}; \ ln -sf ${CFITSIO_SHLIB_SONAME} $@; \ fi install: lib${PACKAGE}.a ${INSTALL_DIRS} @for lib in lib${PACKAGE}.a lib${PACKAGE}${SHLIB_SUFFIX} \ ${CFITSIO_SHLIB} ${CFITSIO_SHLIB_SONAME}; do \ if [ -f $$lib ]; then \ echo "/bin/cp -a $$lib ${CFITSIO_LIB}"; \ /bin/cp -a $$lib ${CFITSIO_LIB}; \ fi; \ done /bin/cp fitsio.h fitsio2.h longnam.h drvrsmem.h ${CFITSIO_INCLUDE} /bin/cp cfitsio.pc ${CFITSIO_LIB}/pkgconfig @for task in ${FPACK_UTILS} ${UTILS}; do \ if [ -f $$task ]; then \ if [ ! -d ${CFITSIO_BIN} ]; then mkdir -p ${CFITSIO_BIN}; fi; \ echo "/bin/cp $$task ${CFITSIO_BIN}"; \ /bin/cp $$task ${CFITSIO_BIN}; \ fi; \ done .c.o: ${CC} -c -o ${ eval_l.c1 # Note workaround for yyfree=fffree conflict /bin/sed -e 's/yy/ff/g' -e 's/YY/FF/g' eval_l.c1 -e 's/fffree/yyfffree/g' > eval_l.c /bin/rm -f eval_l.c1 ${BISON} -d -v -y eval.y /bin/sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.c > eval_y.c /bin/sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.h > eval_tab.h /bin/rm -f y.tab.c y.tab.h clean: - /bin/rm -rf *.o zlib/*.o *.dSYM lib${PACKAGE}* y.output so_locations \ ${UTILS} ${FPACK_UTILS} testprog.fit distclean: clean - /bin/rm -f Makefile cfitsio.pc config.log config.status configure.lineno # Make target which outputs the list of the .o contained in the cfitsio lib # usefull to build a single big shared library containing Tcl/Tk and other # extensions. used for the Tcl Plugin. cfitsioLibObjs: @echo ${CORE_OBJECTS} cfitsioLibSrcs: @echo ${SOURCES} # This target actually builds the objects needed for the lib in the above # case objs: ${CORE_OBJECTS} ${INSTALL_DIRS}: @if [ ! -d $@ ]; then mkdir -p $@; fi cfitsio-4.0.0/README0000644000175000017500000001066014051334376014216 0ustar cagordoncagordon CFITSIO Interface Library CFITSIO is a library of ANSI C routines for reading and writing FITS format data files. A set of Fortran-callable wrapper routines are also included for the convenience of Fortran programmers. This README file gives a brief summary of how to build and test CFITSIO, but the CFITSIO User's Guide, found in the files cfitsio.doc (plain text), cfitsio.tex (LaTeX source file), cfitsio.ps, or cfitsio.pdf should be referenced for the latest and most complete information. BUILDING CFITSIO ---------------- The CFITSIO code is contained in about 40 *.c source files and several *.h header files. CFITSIO should compile and run on most Unix platforms without modification, except that Cray supercomputers computers are currently not supported. The CFITSIO library is built on Unix systems by typing: > ./configure [--prefix=/target/installation/path] > make (or 'make shared') > make install (this step is optional) at the operating system prompt. The configure command customizes the Makefile for the particular system, then the `make' command compiles the source files and builds the library. Type `./configure' and not simply `configure' to ensure that the configure script in the current directory is run and not some other system-wide configure script. The optional 'prefix' argument to configure gives the path to the directory where the CFITSIO library and include files should be installed via the later 'make install' command. For example, > ./configure --prefix=/usr1/local will cause the 'make install' command to copy the CFITSIO libcfitsio file to /usr1/local/lib and the necessary include files to /usr1/local/include (assuming of course that the process has permission to write to these directories). All the available configure options can be seen by entering the command > ./configure --help On VAX/VMS and ALPHA/VMS systems the make.com command file may be used to build the cfitsio.olb object library using the default G-floating point option for double variables. The make\_dfloat.com and make\_ieee.com files may be used instead to build the library with the other floating point options. A precompiled DLL version of CFITSIO is available for IBM-PC users of the Borland or Microsoft Visual C++ compilers in the files cfitsiodll_xxxx_borland.zip and cfitsiodll_xxxx_vcc.zip, where 'xxxx' represents the current release number. These zip archives also contains other files and instructions on how to use the CFITSIO DLL library. The CFITSIO library may also be built from the source code using the makefile.bc or makefile.vcc files. Finally, the makepc.bat file gives an example of building CFITSIO with the Borland C++ v4.5 compiler using simpler DOS commands. Instructions for building CFITSIO on Mac OS can be found in the README.MacOS file. TESTING CFITSIO --------------- The CFITSIO library should be tested by building and running the testprog.c program that is included with the release. On Unix systems, type: - % make testprog % testprog > testprog.lis % diff testprog.lis testprog.out % cmp testprog.fit testprog.std - On VMS systems, (assuming cc is the name of the C compiler command), type: - $ cc testprog.c $ link testprog, cfitsio/lib $ run testprog - The testprog program should produce a FITS file called `testprog.fit' that is identical to the testprog.std FITS file included in this release. The diagnostic messages (which were piped to the file testprog.lis in the Unix example) should be identical to the listing contained in the file testprog.out. The 'diff' and 'cmp' commands shown above should not report any differences in the files. USING CFITSIO ------------- The CFITSIO User's Guide, contained in the files cfitsio.doc (plain text file) and cfitsio.ps (postscript file), provides detailed documentation about how to build and use the CFITSIO library. It contains a description of every user-callable routine in the CFITSIO interface. The cookbook.c file provides some sample routines for performing common operations on various types of FITS files. Programmers are urged to examine these routines for recommended programming practices when using CFITSIO. Users are free to copy or modify these routines for their own purposes. Any problem reports or suggestions for improvements are welcome and should be sent to the HEASARC help desk. ------------------------------------------------------------------------- William D. Pence HEASARC, NASA/GSFC cfitsio-4.0.0/README.MacOS0000644000175000017500000000467514051334376015170 0ustar cagordoncagordonBy default, the CFITSIO library will be a "Universal Binary" (i.e. 32- and 64-bit compatible) under Mac OS X when built in the standard way, i.e. - tar xzf cfitsio3370.tar.gz (or whatever version this is) - cd cfitsio/ - ./configure - make - make install --------------------------------------------------------------------- To install CFITSIO using MacPorts: --------------------------------------------------------------------- If you have MacPorts installed, you may install CFITSIO simply with the command $ sudo port install cfitsio +universal For more information, please visit: http://macports.org https://trac.macports.org/browser/trunk/dports/science/cfitsio/Portfile --------------------------------------------------------------------- To install CFITSIO using Homebrew: --------------------------------------------------------------------- If you have Homebrew installed, you may install CFITSIO simply with the command $ brew install cfitsio For more information, please visit: http://brew.sh http://brewformulas.org/Cfitsio --------------------------------------------------------------------- To build CFITSIO using the XCode GUI: --------------------------------------------------------------------- - tar xzf cfitsio3370.tar.gz (or whatever version this is) - cd cfitsio/ - Start Xcode and open cfitsio.xcodeproj/project.pbxproj, or just "open" the file from a terminal command line, $ open cfitsio.xcodeproj/project.pbxproj and this will start up XCode for you. - Press the Build (or "Play") button in the upper left corner of the GUI. --------------------------------------------------------------------- --------------------------------------------------------------------- Below, are the old (and now obsolete) instructions for building CFITSIO on classic Mac OS-9 or earlier versions: 1. Un binhex and unstuff cfitsio_mac.sit.hqx 2. put CFitsioPPC.mcp in the cfitsio directory. 2. Load CFitsioPPC.mcp into CodeWarrior Pro 5 and make. This builds the cfitsio library for PPC. There are also targets for both the test program and the speed test program. To use the MacOS port you can add Cfitsio PPC.lib to your Codewarrior Pro 5 project. Note that this only has been tested for the PPC. It probably won't work on 68k macs. Also note that the fortran bindings aren't included. I haven't worked with the codewarrior f2c plugin so I don't know how these would work. If one is interested, please write and I can look into this. cfitsio-4.0.0/README.win0000644000175000017500000002040614051336021014776 0ustar cagordoncagordonInstructions on building and using CFITSIO on Windows platforms for C programmers using Microsoft Visual Studio or Borland C++. These instructions for building the CFITSIO library under Windows use the CMake build system that is available from http://www.cmake.org. =============================================================================== 1. Build the CFITSIO dll library a. If CMAKE is not already installed on your machine, download it from http://www.cmake.org. It is recommended that you choose the "Add CMake to the system PATH for current user" option during the installation setup process for convenience when running CMake later on. b. Install ZLIB: The compression library "zlib" is required in order to build CFITSIO. Visit their site at https://zlib.net to download the latest distribution. Unpack it, then build and install it from a parallel directory, for example: mkdir zlib.build cd zlib.build cmake ..\zlib-1.2.11 -DCMAKE_INSTALL_PREFIX=c:\Users\myname\zlib cmake --build . --config Release cmake --install . The cmake comands below will use the path "c:\Users\myname\zlib" as an example for the installed zlib location. c. Unzip the CFITSIO .zip file (e.g. cfit-4.0.0.zip) that was obtained from the CFITSIO Web site (http://heasarc.gsfc.nasa.gov/fitsio). This will create a new \cfitsio-4.0.0 subdirectory that contains the source code and documentation files. It also contains a CMakeLists.txt file that will be used during the CMake build process. d. Open the Visual Studio Command Prompt window, likely using a desktop icon with this same name, (or the equivalent Borland command window) and cd (change directory) into the parent directory that is one level above the directory containing the CFITSIO source files that was created in the previous step. e. Create a new subdirectory (for example, "cfitsio.build"), and cd into it with the following commands: mkdir cfitsio.build cd cfitsio.build When using Visual Studio, all the files that are generated during the CMake process will be created in or under this subdirectory. f. Create the CMake files necessary for the build: To use the default Visual Studio compilers and architecture, simply run (for example): cmake ..\cfitsio-4.0.0 -DCMAKE_PREFIX_PATH=c:\Users\myname\zlib Alternatively, you can specify the name of a CMake Generator using the "-G" flag: cmake -G "" ..\cfitsio-4.0.0 -DCMAKE_PREFIX_PATH=c:\Users\myname\zlib Where the string "" designates your choice of compiler. Some possible options are: "Visual Studio 16 2019" "Visual Studio 16 2019" -A Win32 (for 32-bit builds) "Visual Studio 15 2017 Win64" "Visual Studio 15 2017" (for 32-bit builds) "Visual Studio 15 2017" -A Win32 (for 32-bit builds) "MinGW Makefiles" "Borland Makefiles" "NMake Makefiles" You can see a list of all the available CMake Generators by executing the command cmake /? Note that these names are case-sensitive and must be entered exactly as displayed. Note that the "..\cfitsio-4.0.0" argument gives the relative path to the directory that contains the CFITSIO source files and the CMakeLists.txt file. Some other optional flags are available to use during this step, using this format: cmake -G ..\cfitsio-4.0.0 -D