|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 07-Dec-2018 | - |
| zlib/ | H | 07-Dec-2018 | - | 11,474 | 7,186 |
| FindPthreads.cmake | H A D | 08-Nov-2016 | 3.1 KiB | 99 | 88 |
| Makefile.in | H A D | 08-Nov-2016 | 5.3 KiB | 176 | 108 |
| README | H A D | 08-Nov-2016 | 5.9 KiB | 145 | 122 |
| README.MacOS | H A D | 08-Nov-2016 | 2.1 KiB | 71 | 44 |
| README.win | H A D | 08-Nov-2016 | 6 KiB | 137 | 100 |
| README_OLD.win | H A D | 08-Nov-2016 | 3.5 KiB | 84 | 57 |
| buffers.c | H A D | 08-Nov-2016 | 52 KiB | 1,378 | 941 |
| cfileio.c | H A D | 08-Nov-2016 | 233.5 KiB | 7,272 | 5,109 |
| cfitsio.pc.in | H A D | 08-Nov-2016 | 257 | 12 | 10 |
| cfitsio_mac.sit.hqx | H A D | 08-Nov-2016 | 22.8 KiB | 361 | 360 |
| cfortran.h | H A D | 08-Nov-2016 | 131.9 KiB | 2,516 | 2,067 |
| checksum.c | H A D | 08-Nov-2016 | 17.2 KiB | 509 | 317 |
| config.guess | H A D | 29-Aug-2016 | 44 KiB | 1,506 | 1,295 |
| config.sub | H A D | 29-Aug-2016 | 34.2 KiB | 1,740 | 1,591 |
| configure | H A D | 29-Aug-2016 | 192.4 KiB | 6,916 | 5,668 |
| configure.in | H A D | 08-Nov-2016 | 16.4 KiB | 559 | 503 |
| cookbook.c | H A D | 08-Nov-2016 | 21.3 KiB | 572 | 343 |
| cookbook.f | H A D | 08-Nov-2016 | 29.5 KiB | 773 | 338 |
| drvrfile.c | H A D | 08-Nov-2016 | 27.5 KiB | 992 | 648 |
| drvrgsiftp.c | H A D | 08-Nov-2016 | 13.3 KiB | 523 | 421 |
| drvrgsiftp.h | H A D | 08-Nov-2016 | 787 | 22 | 19 |
| drvrmem.c | H A D | 08-Nov-2016 | 36 KiB | 1,220 | 831 |
| drvrnet.c | H A D | 08-Nov-2016 | 69.6 KiB | 2,742 | 1,839 |
| drvrsmem.c | H A D | 08-Nov-2016 | 37.6 KiB | 974 | 772 |
| drvrsmem.h | H A D | 08-Nov-2016 | 6.4 KiB | 180 | 117 |
| editcol.c | H A D | 08-Nov-2016 | 82.7 KiB | 2,478 | 1,802 |
| edithdu.c | H A D | 08-Nov-2016 | 30.5 KiB | 884 | 611 |
| eval.l | H A D | 08-Nov-2016 | 15.8 KiB | 546 | 432 |
| eval.y | H A D | 08-Nov-2016 | 173.5 KiB | 5,838 | 4,954 |
| eval_defs.h | H A D | 08-Nov-2016 | 4.2 KiB | 164 | 142 |
| eval_f.c | H A D | 08-Nov-2016 | 96.4 KiB | 2,840 | 2,213 |
| eval_l.c | H A D | 08-Nov-2016 | 59.2 KiB | 2,253 | 1,610 |
| eval_tab.h | H A D | 08-Nov-2016 | 871 | 43 | 40 |
| eval_y.c | H A D | 08-Nov-2016 | 237.6 KiB | 7,334 | 6,222 |
| f77.inc | H A D | 08-Nov-2016 | 853 | 32 | 26 |
| f77_wrap.h | H A D | 08-Nov-2016 | 10.2 KiB | 288 | 204 |
| f77_wrap1.c | H A D | 08-Nov-2016 | 12.2 KiB | 347 | 247 |
| f77_wrap2.c | H A D | 08-Nov-2016 | 31.6 KiB | 712 | 525 |
| f77_wrap3.c | H A D | 08-Nov-2016 | 32.8 KiB | 854 | 634 |
| f77_wrap4.c | H A D | 08-Nov-2016 | 19 KiB | 573 | 373 |
| fits_hcompress.c | H A D | 08-Nov-2016 | 45.9 KiB | 1,859 | 921 |
| fits_hdecompress.c | H A D | 08-Nov-2016 | 61.9 KiB | 2,619 | 1,526 |
| fitscopy.c | H A D | 08-Nov-2016 | 2.6 KiB | 61 | 51 |
| fitscore.c | H A D | 08-Nov-2016 | 297.1 KiB | 9,353 | 6,699 |
| fitsio.h | H A D | 08-Nov-2016 | 110.8 KiB | 1,968 | 1,610 |
| fitsio2.h | H A D | 08-Nov-2016 | 57.7 KiB | 1,212 | 985 |
| fpack.c | H A D | 08-Nov-2016 | 14.3 KiB | 412 | 307 |
| fpack.h | H A D | 08-Nov-2016 | 7 KiB | 190 | 100 |
| fpackutil.c | H A D | 08-Nov-2016 | 71.9 KiB | 2,327 | 1,585 |
| funpack.c | H A D | 08-Nov-2016 | 4.4 KiB | 169 | 122 |
| getcol.c | H A D | 08-Nov-2016 | 38.8 KiB | 1,054 | 862 |
| getcolb.c | H A D | 08-Nov-2016 | 74.8 KiB | 2,009 | 1,545 |
| getcold.c | H A D | 08-Nov-2016 | 65.7 KiB | 1,684 | 1,226 |
| getcole.c | H A D | 08-Nov-2016 | 65.8 KiB | 1,687 | 1,226 |
| getcoli.c | H A D | 08-Nov-2016 | 71.2 KiB | 1,909 | 1,475 |
| getcolj.c | H A D | 08-Nov-2016 | 140.7 KiB | 3,742 | 2,869 |
| getcolk.c | H A D | 08-Nov-2016 | 71.1 KiB | 1,902 | 1,459 |
| getcoll.c | H A D | 08-Nov-2016 | 22.6 KiB | 622 | 440 |
| getcols.c | H A D | 08-Nov-2016 | 28.4 KiB | 836 | 615 |
| getcolsb.c | H A D | 08-Nov-2016 | 73.7 KiB | 1,992 | 1,545 |
| getcolui.c | H A D | 08-Nov-2016 | 71.6 KiB | 1,915 | 1,481 |
| getcoluj.c | H A D | 08-Nov-2016 | 71.4 KiB | 1,909 | 1,470 |
| getcoluk.c | H A D | 08-Nov-2016 | 71.8 KiB | 1,924 | 1,481 |
| getkey.c | H A D | 08-Nov-2016 | 112 KiB | 3,248 | 2,329 |
| group.c | H A D | 08-Nov-2016 | 170.2 KiB | 6,464 | 3,182 |
| group.h | H A D | 08-Nov-2016 | 1.9 KiB | 66 | 39 |
| grparser.c | H A D | 08-Nov-2016 | 45.6 KiB | 1,380 | 1,032 |
| grparser.h | H A D | 08-Nov-2016 | 5.7 KiB | 186 | 116 |
| histo.c | H A D | 08-Nov-2016 | 72.9 KiB | 2,222 | 1,640 |
| imcompress.c | H A D | 08-Nov-2016 | 349.9 KiB | 9,369 | 6,564 |
| imcopy.c | H A D | 08-Nov-2016 | 9.1 KiB | 234 | 176 |
| install-sh | H A D | 29-Aug-2016 | 5.5 KiB | 251 | 152 |
| iraffits.c | H A D | 08-Nov-2016 | 56.1 KiB | 2,094 | 1,427 |
| iter_a.c | H A D | 08-Nov-2016 | 5.1 KiB | 148 | 86 |
| iter_a.f | H A D | 08-Nov-2016 | 6.7 KiB | 225 | 131 |
| iter_b.c | H A D | 08-Nov-2016 | 3.6 KiB | 115 | 64 |
| iter_b.f | H A D | 08-Nov-2016 | 5.5 KiB | 194 | 114 |
| iter_c.c | H A D | 08-Nov-2016 | 5.9 KiB | 172 | 96 |
| iter_c.f | H A D | 08-Nov-2016 | 10.3 KiB | 348 | 200 |
| iter_image.c | H A D | 08-Nov-2016 | 3 KiB | 94 | 47 |
| iter_var.c | H A D | 08-Nov-2016 | 3.2 KiB | 101 | 47 |
| longnam.h | H A D | 08-Nov-2016 | 20.1 KiB | 594 | 539 |
| makefile.bc | H A D | 08-Nov-2016 | 12.5 KiB | 589 | 484 |
| makefile.vcc | H A D | 08-Nov-2016 | 17.6 KiB | 794 | 554 |
| makepc.bat | H A D | 08-Nov-2016 | 2.3 KiB | 88 | 86 |
| modkey.c | H A D | 08-Nov-2016 | 62.9 KiB | 1,756 | 1,327 |
| pliocomp.c | H A D | 08-Nov-2016 | 6.9 KiB | 332 | 272 |
| putcol.c | H A D | 08-Nov-2016 | 63.9 KiB | 1,930 | 1,528 |
| putcolb.c | H A D | 08-Nov-2016 | 35.8 KiB | 1,018 | 706 |
| putcold.c | H A D | 08-Nov-2016 | 37.1 KiB | 1,065 | 749 |
| putcole.c | H A D | 08-Nov-2016 | 37.6 KiB | 1,079 | 749 |
| putcoli.c | H A D | 08-Nov-2016 | 34 KiB | 991 | 695 |
| putcolj.c | H A D | 08-Nov-2016 | 68.5 KiB | 2,001 | 1,414 |
| putcolk.c | H A D | 08-Nov-2016 | 34.9 KiB | 1,018 | 716 |
| putcoll.c | H A D | 08-Nov-2016 | 13.4 KiB | 370 | 237 |
| putcols.c | H A D | 08-Nov-2016 | 10.6 KiB | 305 | 215 |
| putcolsb.c | H A D | 08-Nov-2016 | 34 KiB | 975 | 684 |
| putcolu.c | H A D | 08-Nov-2016 | 21 KiB | 630 | 385 |
| putcolui.c | H A D | 08-Nov-2016 | 33.5 KiB | 970 | 683 |
| putcoluj.c | H A D | 08-Nov-2016 | 33.6 KiB | 978 | 691 |
| putcoluk.c | H A D | 08-Nov-2016 | 34.3 KiB | 994 | 700 |
| putkey.c | H A D | 08-Nov-2016 | 105 KiB | 3,080 | 2,267 |
| quantize.c | H A D | 08-Nov-2016 | 115.7 KiB | 3,921 | 2,754 |
| region.c | H A D | 08-Nov-2016 | 54.3 KiB | 1,765 | 1,312 |
| region.h | H A D | 08-Nov-2016 | 2.1 KiB | 83 | 59 |
| ricecomp.c | H A D | 08-Nov-2016 | 34.4 KiB | 1,354 | 712 |
| sample.tpl | H A D | 08-Nov-2016 | 3.5 KiB | 121 | 98 |
| scalnull.c | H A D | 08-Nov-2016 | 8.8 KiB | 230 | 119 |
| smem.c | H A D | 08-Nov-2016 | 2.5 KiB | 78 | 70 |
| speed.c | H A D | 08-Nov-2016 | 15.1 KiB | 512 | 325 |
| swapproc.c | H A D | 08-Nov-2016 | 7.5 KiB | 248 | 183 |
| testf77.f | H A D | 08-Nov-2016 | 78.3 KiB | 2,489 | 1,830 |
| testf77.out | H A D | 08-Nov-2016 | 32.6 KiB | 747 | 691 |
| testprog.c | H A D | 08-Nov-2016 | 83.9 KiB | 2,590 | 1,867 |
| testprog.out | H A D | 08-Nov-2016 | 31.5 KiB | 798 | 738 |
| testprog.tpt | H A D | 08-Nov-2016 | 396 | 13 | 11 |
| vmsieee.c | H A D | 08-Nov-2016 | 3.7 KiB | 131 | 102 |
| wcssub.c | H A D | 08-Nov-2016 | 34.4 KiB | 1,044 | 710 |
| wcsutil.c | H A D | 08-Nov-2016 | 16.4 KiB | 503 | 375 |
| winDumpExts.mak | H A D | 08-Nov-2016 | 4.2 KiB | 192 | 145 |
| windumpexts.c | H A D | 08-Nov-2016 | 12.6 KiB | 503 | 337 |
README
1 CFITSIO Interface Library
2
3CFITSIO is a library of ANSI C routines for reading and writing FITS
4format data files. A set of Fortran-callable wrapper routines are also
5included for the convenience of Fortran programmers. This README file
6gives a brief summary of how to build and test CFITSIO, but the CFITSIO
7User's Guide, found in the files cfitsio.doc (plain text), cfitsio.tex
8(LaTeX source file), cfitsio.ps, or cfitsio.pdf should be
9referenced for the latest and most complete information.
10
11BUILDING CFITSIO
12----------------
13
14The CFITSIO code is contained in about 40 *.c source files and several *.h
15header files. The CFITSIO library is built on Unix systems by typing:
16
17 > ./configure [--prefix=/target/installation/path]
18 > make (or 'make shared')
19 > make install (this step is optional)
20
21at the operating system prompt. The configure command customizes the
22Makefile for the particular system, then the `make' command compiles the
23source files and builds the library. Type `./configure' and not simply
24`configure' to ensure that the configure script in the current directory
25is run and not some other system-wide configure script. The optional
26'prefix' argument to configure gives the path to the directory where
27the CFITSIO library and include files should be installed via the later
28'make install' command. For example,
29
30 > ./configure --prefix=/usr1/local
31
32will cause the 'make install' command to copy the CFITSIO libcfitsio file
33to /usr1/local/lib and the necessary include files to /usr1/local/include
34(assuming of course that the process has permission to write to these
35directories).
36
37On VAX/VMS and ALPHA/VMS systems the make.com command file may be used
38to build the cfitsio.olb object library using the default G-floating
39point option for double variables. The make\_dfloat.com and make\_ieee.com
40files may be used instead to build the library with the other floating
41point options.
42
43A precompiled DLL version of CFITSIO is available for IBM-PC users of
44the Borland or Microsoft Visual C++ compilers in the files
45cfitsiodll_xxxx_borland.zip and cfitsiodll_xxxx_vcc.zip, where 'xxxx'
46represents the current release number. These zip archives also
47contains other files and instructions on how to use the CFITSIO DLL
48library. The CFITSIO library may also be built from the source code
49using the makefile.bc or makefile.vcc files. Finally, the makepc.bat
50file gives an example of building CFITSIO with the Borland C++ v4.5
51compiler using simpler DOS commands.
52
53When building on Mac OS-X, users should follow the Unix instructions,
54above. Previous MacOS versions of the cfitsio library can be built by
55(1) un binhex and unstuff cfitsio_mac.sit.hqx, (2) put CFitsioPPC.mcp
56in the cfitsio directory, and (3) load CFitsioPPC.mcp into CodeWarrior
57Pro 5 and make. This builds the cfitsio library for PPC. There are
58also targets for both the test program and the speed test program.
59
60To use the MacOS port you can add Cfitsio PPC.lib to your Codewarrior
61Pro 5 project. Note that this only has been tested for the PPC and
62probably won't work
63 on 68k macs.
64
65TESTING CFITSIO
66---------------
67
68The CFITSIO library should be tested by building and running
69the testprog.c program that is included with the release.
70On Unix systems, type:
71-
72 % make testprog
73 % testprog > testprog.lis
74 % diff testprog.lis testprog.out
75 % cmp testprog.fit testprog.std
76-
77 On VMS systems,
78(assuming cc is the name of the C compiler command), type:
79-
80 $ cc testprog.c
81 $ link testprog, cfitsio/lib
82 $ run testprog
83-
84The testprog program should produce a FITS file called `testprog.fit'
85that is identical to the testprog.std FITS file included in this
86release. The diagnostic messages (which were piped to the file
87testprog.lis in the Unix example) should be identical to the listing
88contained in the file testprog.out. The 'diff' and 'cmp' commands
89shown above should not report any differences in the files.
90
91USING CFITSIO
92-------------
93
94The CFITSIO User's Guide, contained in the files cfitsio.doc (plain
95text file) and cfitsio.ps (postscript file), provides detailed
96documentation about how to build and use the CFITSIO library.
97It contains a description of every user-callable routine in the
98CFITSIO interface.
99
100The cookbook.c file provides some sample routines for performing common
101operations on various types of FITS files. Programmers are urged to
102examine these routines for recommended programming practices when using
103CFITSIO. Users are free to copy or modify these routines for their own
104purposes.
105
106SUPPORTED PLATFORMS
107-------------------
108
109CFITSIO has currently been tested on the following platforms:
110
111 Operating System Compiler
112 ---------------- --------
113 OPERATING SYSTEM COMPILER
114 Sun OS gcc and cc (3.0.1)
115 Sun Solaris gcc and cc
116 Silicon Graphics IRIX gcc and cc
117 Silicon Graphics IRIX64 MIPS
118 Dec Alpha OSF/1 gcc and cc
119 DECstation Ultrix gcc
120 Dec Alpha OpenVMS cc
121 DEC VAX/VMS gcc and cc
122 HP-UX gcc
123 IBM AIX gcc
124 Linux gcc
125 MkLinux DR3
126 Windows 95/98/NT Borland C++ V4.5
127 Windows 95/98/NT/ME/XP Microsoft/Compaq Visual C++ v5.0, v6.0
128 Windows 95/98/NT Cygwin gcc
129 OS/2 gcc + EMX
130 Mac OS 7.1 or greater Metrowerks 10.+
131 Mac OS-X 10.1 or greater cc (gcc)
132
133CFITSIO will probably run on most other Unix platforms without
134modification. Cray supercomputers and IBM mainframe computers are
135currently not supported.
136
137Reports of any success or failure to run CFITSIO on other platforms
138would be appreciated. Any problem reports or suggestions for
139improvements are also welcome and should be sent to the primary author.
140
141-------------------------------------------------------------------------
142William D. Pence
143HEASARC, NASA/GSFC
144email: William.D.Pence@nasa.gov
145
README.MacOS
1To build CFITSIO library on an Intel Mac as a Universal Binary
2
3Unzip the library:
4- tar xzf cfitsio3060.tar.gz (or whatever version this is)
5
6- cd cfitsio/
7
8- copy the cfitsio-xcodeproj.zip file here
9
10- unzip cfitsio-xcodeproj.zip
11
12- start Xcode and open cfitsio.xcodeproj
13
14- expand the "Targets" menu under "Groups & Files"
15
16- choose one of the following build options:
17
18 * right-click on Build PPC -> Build "Build PPC"
19
20 * right-click on Build i386 -> Build "Build i386"
21
22 * right-click on Build x86_64 -> Build "Build x86_64"
23
24 * right-click on Build Universal -> Build "Build Universal"
25 (Builds all three of the above options, i.e. a Universal Binary
26 usable on ppc, i386, and x86_64 architectures)
27
28 (For some reason clicking on the menu "Build" icon doesn't seem to
29 work correctly, but the right-click menus do).
30
31-------------------------------------------------------
32
33Another way to build the universal binary:
34
35- unpack the cfitsio source code tar file
36- cd cfitsio
37
38Set the CFLAGS environment variable for building a Universal Binary:
39
40 C-Shell variants:
41 setenv CFLAGS "-arch ppc -arch i386 -arch x86_64 -g -O2"
42
43 Bourne Shell variants:
44 export CFLAGS="-arch ppc -arch i386 -arch x86_64 -g -O2"
45
46Then proceed with the standard cfitsio build, i.e.:
47
48- ./configure
49- make
50- make install
51
52
53-------------------------------------------------------
54
55Below, are the old (and now obsolete) instructions for building CFITSIO
56on classic Mac OS-9 or earlier versions:
57
581. Un binhex and unstuff cfitsio_mac.sit.hqx
592. put CFitsioPPC.mcp in the cfitsio directory.
602. Load CFitsioPPC.mcp into CodeWarrior Pro 5 and make.
61 This builds the cfitsio library for PPC. There are also targets for both
62 the test program and the speed test program.
63
64To use the MacOS port you can add Cfitsio PPC.lib to your Codewarrior Pro 5
65project. Note that this only has been tested for the PPC. It probably
66won't work on 68k macs. Also note that the fortran bindings aren't
67included. I haven't worked with the codewarrior f2c plugin so I don't know
68how these would work. If one is interested, please write and I can look
69into this.
70
71
README.win
1Instructions on building and using CFITSIO on Windows platforms
2for C programmers using Microsoft Visual Studio or Borland C++.
3
4These instructions for building the CFITSIO library under Windows use the
5CMake build system that is available from http://www.cmake.org.
6
7===============================================================================
8
91. Build the CFITSIO dll library
10
11This step will create the cfitsio.dll, and cfitsio.lib files. If you have
12downloaded the CFITSIO DLL .zip file that already contains the pre-built
13versions of these files, then SKIP THIS STEP.
14
15 a. If CMAKE is not already installed on your machine, download it from
16 http://www.cmake.org. It is recommended that you choose the
17 "Add CMake to the system PATH for current user" option during the
18 installation setup process for convenience when running CMake later on.
19
20 b. Unzip the CFITSIO .zip file (e.g. cfit3360.zip) that was obtained from
21 the CFITSIO Web site (http://heasarc.gsfc.nasa.gov/fitsio/). This will
22 create a new \cfitsio subdirectory that contains the source code and
23 documentation files. It should also contain a CMakeLists.txt file that
24 will be used during the CMake build process.
25
26 c. Open the Visual Studio Command Prompt window, likely using a
27 desktop icon with this same name, (or the equivalent Borland command window)
28 and CD (change directory) into the parent directory that is one level
29 above the directory containing the CFITSIO source files that was created
30 in the previous step.
31
32 d. Create a new "cfitsio.build" subdirectory, and CD into it with the
33 following commands:
34
35 mkdir cfitsio.build
36 cd cfitsio.build
37
38 When using Visual Studio, all the files that are generated during the
39 CMake process will be created in or under this subdirectory.
40
41 e. Decide which CMake Generator you will want to use in the following step.
42 This depends on which C/C++ compiler you are using and will likely have
43 a name such as:
44
45 "Visual Studio 10"
46 "Visual Studio 10 Win64" (for 64-bit builds)
47 "Visual Studio 11"
48 "Visual Studio 11 Win64" (for 64-bit builds)
49 "Visual Studio 12"
50 "Visual Studio 12 Win64" (for 64-bit builds)
51 "Borland Makefiles"
52 "NMake Makefiles"
53
54 You can see a list of all the available CMake Generators by executing
55 the command
56
57 cmake.exe /?
58
59 Note that these names are case-sensitive and must be entered in the
60 following step exactly as displayed.
61
62 f. Execute the following commands to build the CFITSIO library:
63
64 cmake.exe -G "<cmake generator>" ..\cfitsio
65 cmake.exe --build . --config Release
66
67 Where the string <cmake generator> is the string that was selected
68 in step e. Note that the "..\cfitsio" argument in the first command
69 gives the path to the directory that contains the CFITSIO source files
70 and the CMakeLists.txt file. The "." argument in the second command
71 (following --build) tells CMake to build the files in the current
72 directory (i.e., the cfitsio.build directory).
73
74 If this process completes successfully, you should find the CFITSIO
75 library files that were created in the "cfitsio.build\Release"
76 subdirectory. To verify that CFITSIO is working correctly, execute the
77 testprog.exe file (in that Release directory). This should generate
78 a long stream of diagnostic messages ending with the line "Status = 0:
79 OK - no error".
80
81 g. Other CMake options.
82
83 CMake has many other build options that may be useful in some
84 situations. Refer to the CMake documentation for more
85 information.
86
87 For example, one can build a 'debug' version of the CFITSIO library
88 by executing the command "cmake.exe --build ." instead of the 2nd
89 command listed above in section f.
90
91 One can also make a thread safe version of CFITSIO using the
92 pthread library with the following procedure:
93
94 a. Download the precompiled files from the pthread-win32 project
95 (http://sourceware.org/pthreads-win32/). Put the files for your
96 specific platform (.h, .lib, .dll) into a folder 'pthread',
97 parallel to the cfitsio source folder.
98
99 b. For the compilation of cfitsio follow the cmake steps, but use
100 this change as a replacement for the commands in step f:
101
102 cmake.exe -G "<cmake generator>" ..\cfitsio -DUSE_PTHREADS=1
103 -DCMAKE_INCLUDE_PATH=..\pthread -DCMAKE_LIBRARY_PATH=..\pthread
104
105 cmake.exe --build . --config Release
106
107 You may need to adapt the paths for the source directory and
108 the pthread library.
109
110============================================================================
111
1122. Using CFITSIO when compiling and linking application programs
113
114First, depending on your particular programming environment, it may be
115necessary to copy the cfitsio.lib and cfitsio.dll files into another
116directory where your compiler expects to find them. Or equivalently, you
117may need to specify the directory path to the location of the CFITSIO
118library files when creating a project that uses them. You may also need to
119copy the fitsio.h and longnam.h include files from the \cfitsio source file
120directory to a standard 'include' directory on your system.
121
122When using the Visual Studio command line window, application programs can
123be compiled and linked with CFITSIO using the following command:
124
125 cl /MD your_program.c cfitsio.lib
126
127The /MD command line switch must be specified to force the compiler/linker
128to use the appropriate runtime library. If this switch is omitted, then
129the fits_report_error function in CFITSIO will likely crash.
130
131When building programs in the Visual Studio graphical environment, one can
132force the equivalent of the /MD switch by selecting 'Settings...' under the
133'Project' menu, then click on the C/C++ tab and select the 'Code Generator'
134category. Then under 'User Run-time Library' select 'Multithreaded DLL'.
135
136===============================================================================
137
README_OLD.win
1===============================================================================
2===============================================================================
3= NOTE: This is the old version of the README.win32 file that was distributed
4= with CFITSIO up until version 3.35 in 2013. These instruction may still work
5= with more recent versions of CFITSIO, however, users are strongly urged to
6= use the CMake procedures that are now documented in the new README.win32 file.
7===============================================================================
8===============================================================================
9
10 Instructions on using CFITSIO on Windows platforms for C programmers
11
12These instructions use a simple DOS-style command window. It is also possible
13to build and use CFITSIO within a GUI programming environment such as Visual
14Studio, but this is not supported here.
15
16===============================================================================
171. Build the CFITSIO dll library
18
19This step will create the cfitsio.def, cfitsio.dll, and cfitsio.lib files.
20(If you downloaded the CFITSIO .zip file that contains the pre-built binary
21.dll file, then SKIP THIS STEP).
22
23 A. With Microsoft Visual C++:
24
25 1. Open a DOS command window and execute the vcvars32.bat file that
26 is distributed with older versions of Visual C++, or simply open
27 the Visual C++ command window (e.g., when using Visual Studio 2010).
28
29 2. Unpack the CFITSIO source files (cfitxxxx.zip) into a new empty directory
30
31 3. In the DOS command window, cd to that directory and enter the
32 following commands:
33
34 nmake winDumpExts.mak
35 nmake makefile.vcc
36 (ignore the compiler warning messages)
37
38 B: With Borland C++:
39
40 First, follow the instructions provided by Borland to set up
41 the proper environment variables and configure files for the compiler.
42
43 Unpack the cfitsio.zip source file distribution into a suitable directory.
44
45 In a DOS command window, cd to that directory and then execute the
46 makepc.bat batch file on the command line to build the CFITSIO library,
47 and the testprog and cookbook sample programs.
48
49===============================================================================
502. Test the CFITSIO library with Visual C++
51
52 Compile and link the testprog.c test program. When using Visual Studio,
53 the command is:
54
55 cl /MD testprog.c cfitsio.lib
56
57
58 This will create the testprog.exe executable program. Running this
59 program should print out a long series of diagnostic messages
60 that should end with "Status = 0; OK - no error"
61
62===============================================================================
633. Compile and link an application program that calls CFITSIO routines
64 with Visual C++
65
66 Include the fitsio.h and longnam.h header files in the C source code.
67
68 Link the program with the cfitsio.lib file:
69
70 cl /MD your_program.c cfitsio.lib
71
72
73 NOTE: The /MD command line switch must be specified on the cl
74 command line to force the compiler/linker to use the
75 appropriete runtime library. If this switch is omitted, then
76 the fits_report_error function in CFITSIO will likely crash.
77
78 When building programs in the Visual Studio environment, one
79 can force the equivalent of the /MD switch by selecting
80 'Settings...' under the 'Project' menu, then click on the C/C++
81 tab and select the 'Code Generator' category. Then under 'User
82 Run-time Library' select 'Multithreaded DLL'.
83
84