Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanirby committed Feb 29, 2024
2 parents 4c210e5 + 4fa83b4 commit bcff7b5
Show file tree
Hide file tree
Showing 33 changed files with 829 additions and 418 deletions.
68 changes: 1 addition & 67 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,67 +1 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# CFITSIO misc
Makefile
config.log
config.status
cfitsio.pc
cookbook
fitscopy
fitsverify
fpack
funpack
imcopy
smem
speed
testprog
*~
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PROJECT(CFITSIO

# Define project version
SET(${PROJECT_NAME}_MAJOR 4)
SET(${PROJECT_NAME}_MINOR 3)
SET(${PROJECT_NAME}_MINOR 4)
SET(${PROJECT_NAME}_MICRO 0)
SET(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR}.${${PROJECT_NAME}_MINOR}.${${PROJECT_NAME}_MICRO})
SET(LIB_NAME cfitsio)
Expand Down Expand Up @@ -298,7 +298,7 @@ install(TARGETS ${LIB_NAME} EXPORT ${LIB_NAME}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(EXPORT ${LIB_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(EXPORT ${LIB_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cfitsio)
install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)

#==============================================================================
Expand Down Expand Up @@ -344,7 +344,7 @@ IF (UTILS)

# To expand the command line arguments in Windows, see:
# http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx
if(MSVC)
if(MSVC AND NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
set_target_properties(FPack Funpack PROPERTIES LINK_FLAGS "setargv.obj")
endif(MSVC)

Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ eval: # Rebuild eval_* files from flex/bison source

clean:
- /bin/rm -rf *.o zlib/*.o utilities/*.o lib${PACKAGE}* \
${FPACK_UTILS} ${UTILS} \
testf77 testprog.fit *.dSYM y.output so_locations
${FPACK_UTILS} ${UTILS} testf77 \
testf77.fit testprog.fit *.dSYM y.output so_locations

distclean: clean
- /bin/rm -f Makefile cfitsio.pc config.log config.status configure.lineno
Expand Down
Binary file removed NASA NOSA License.pdf
Binary file not shown.
136 changes: 0 additions & 136 deletions README

This file was deleted.

102 changes: 102 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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 latest and most complete information may be found in the "docs" folder in the CFITSIO User's Guide:

### User Guides for C programmers
* `cfitsio.tex` (LaTeX source file)
* `cfitsio.ps` (PostScript file)
* `cfitsio.pdf` (Portable Document Format)

### User Guides for Fortran programmers
* `fitsio.tex` (LaTeX source file)
* `fitsio.ps` (PostScript file)
* `fitsio.pdf` (Portable Document Format)

### Quick Start Guide
* `quick.tex` (LaTeX source file)
* `quick.ps` (PostScript file)
* `quick.pdf` (Portable Document Format)

## Building CFITSIO

The CFITSIO code (contained in `*.c` source files and several `*.h` header files) should compile and run on most Unix platforms without modification. The standard way to build the library on Unix systems is the usual GNU-like approach, i.e. by first typing

```bash
% ./configure [--prefix=/target/installation/path]
```

at the operating system prompt. 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,

```bash
% ./configure --prefix=/usr1/local
```

will cause the later `make install` command to copy the library file(s) to `/usr1/local/lib` and the necessary header 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

```bash
% ./configure --help
```

The configure command customizes the Makefile for a particular system, so after it has been run, type

```bash
% make
```

at the prompt, and this will compile the source files and build the library (static `libcfitsio.a` as well as the shared version `libcfitsio.so|.dylib`). Users may also wish to build the helper utilities (`fpack`, `funpack`, `fitscopy`, `imcopy`, et al.) and test program (`testprog`) using this command:

```bash
% make utils
```

Finally, to copy the library and header file(s) to the chosen install location, type this command:

```bash
% make install
```

Alternatively, the library and utilities may be built on many systems using the CMake program. Specific instructions for using CMake on Windows platforms can be found in the `README.win` file, but for Unix systems (e.g., Linux or macOS) the procedure should be similar to the following:

While in the CFITSIO source code directory:

```bash
% mkdir cmbuild
% cd cmbuild
% cmake -G "Unix Makefiles" ..
% cmake --build .
% cmake --install . [--prefix /usr/local]
```

Where the final step uses an optional installation prefix.

Additional options for installing CFITSIO on macOS via third-party package managers or the XCode GUI can be found in the `README.MacOS` file.


## Testing CFITSIO

The CFITSIO library may be tested by building and running the `testprog.c` program that is included with the release (in the `utilities` folder). On Unix systems, type:

```bash
% make testprog [or "make utils"]
% ./testprog > testprog.lis
% diff testprog.lis testprog.out
% cmp testprog.fit testprog.std
```

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 mentioned above, 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 in the utilities folder 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 CFITSIO/CCFITS help desk at:

[ccfits@heasarc.gsfc.nasa.gov](mailto:ccfits@heasarc.gsfc.nasa.gov)

-------------------------------------------------------------------------
William D. Pence
HEASARC, NASA/GSFC
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,7 @@ test -n "$target_alias" &&
#--------------------------------------------------------------------
CFITSIO_MAJOR=4

CFITSIO_MINOR=3
CFITSIO_MINOR=4

CFITSIO_MICRO=0

Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AC_CANONICAL_TARGET([])
# CFITSIO Version Numbers:
#--------------------------------------------------------------------
AC_SUBST(CFITSIO_MAJOR,4)
AC_SUBST(CFITSIO_MINOR,3)
AC_SUBST(CFITSIO_MINOR,4)
AC_SUBST(CFITSIO_MICRO,0)
# Increment soname each time the interface changes:
AC_SUBST(CFITSIO_SONAME,10)
Expand Down
Binary file modified docs/cfitsio.pdf
Binary file not shown.
Binary file modified docs/cfitsio.ps
Binary file not shown.
Loading

0 comments on commit bcff7b5

Please sign in to comment.