source: trunk/windows/README.txt @ 1822

Revision 434, 4.9 KB checked in by faa59, 7 years ago (diff)

Add Windows build with new directory structure

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1Building NeXus with Visual Studio
2---------------------------------
3
4Setup
5-----
6
7You need to define several Windows environment variables
8HDF4ROOT and HDF5ROOT to point to top of unpacked HDF distributions
9e.g.
10
11    HDF4ROOT=c:\program files\hdf42r1
12    HDF5ROOT=C:\program Files\HDF5-164
13
14Note that you do not need the HDF5 version with F90 support even to build the nexus F90 API
15The above the the latest version of HDF as available from the NCSA site and
16reaquire several external libraries: zlin 1.2.2, jpeg-6b and szip-2.0 (encoder enabled)
17The location of these external libraries is isdicated by the following variables e.g.
18
19    JPEGROOT=c:\program files\jpeg-6b
20    ZLIBROOT=c:\program fiules\zlib122
21    SZIPROOT=c:\program files\szip20
22
23the HDF4 includes will be in %HDFROOT%\debug\include and %HDF5ROOT%\release\include and
24similarly HDF5 includes in %HDF5ROOT%\debug\include and %HDF5ROOT%\release\include
25
26All the visual studio project files make use of these variables and so should not
27depend on the location HDF files are installed in.
28
29Currently ZLIB only works as a DLL so your programs will require zlib1.dll
30
31Building
32--------
33
34Open nexus.dsw, and then select a project to build
35
36nexus4, nexus5 and nexus45 - Static NeXus libraries with HDF4, HDF5, and both HDF4/HDF5 support
37nx45dll                    - Dynamic Link Library (DLL) version of the NeXus library with HDF4 and HDF5 support
38napi*_test                 - the various test programs
39nxbrowse                   - the nexus file browser with static libraru
40nxbrowse_dll               - NeXus file browser using nx45dll.dll
41
42
43Building your own projects with static libraries
44------------------------------------------------
45
46To make use of the HDF4ROOT and HDF5ROOT variables from within Visual Studio,
47you refer to them as $(HDF4ROOT) and $(HDF5ROOT). When building a
48program using the NeXus library you will need to do the following to the
49project settings:
50
51* Add  HDF4  and/or  HDF5  to the C "preprocessor definitions"
52* Add either  $(HDF4ROOT)\debug\include,$(HDF5ROOT)\debug\include  or   
53     $(HDF4ROOT)\debug\include,$(HDF5ROOT)\release\include   to the C "additional include directories"
54     depending on whether you are building a debug or release project
55* For a C project add either   $(HDF4ROOT)\debug\lib,$(HDF5ROOT)\debug\lib   or
56                      $(HDF4ROOT)\release\lib,$(HDF5ROOT)\release\lib
57     to the "additional library path" in the "input" section of the "link" settings
58* For a FORTRAN project add either  $(HDF4ROOT)\debug\lib,$(HDF5ROOT)\debug\lib   or
59                      $(HDF4ROOT)\debug\lib,$(HDF5ROOT)\release\lib
60     to the "additional library path" in the "input" section of the "link" settings
61* Add "wsock32.lib" (for the _htons@4 symbols etc.) and "hdf5.lib"  to the list of
62  library modules to load.
63 
64For a debug build only, you will have to add "libc.lib" to the list of library modules to ignore
65on the link input tab.
66
67Building your own projects with dynamic link libraries (DLL)
68------------------------------------------------------------
69
70For a working example, see the nxbrowse_dll project
71
72When building a program using the DLL version of the NeXus library
73(NX45DLL.DLL) you will need to do the following to the project settings:
74
75* Set your C code generation options to use "debug multithreaded DLL" or "multithreaded DLL" libraries
76* set the FORTRAN libraries option to DLL
77* Add  HDF4  and/or  HDF5  to the C "preprocessor definitions"
78* Add either  $(HDF4ROOT)\include,$(HDF5ROOT)\c\debug\include  or   
79     $(HDF4ROOT)\include,$(HDF5ROOT)\c\release\include   to the C "additional include directories"
80     depending on whether you are building a debug or release project
81* For a C project add either   $(HDF4ROOT)\dlllibdbg,$(HDF5ROOT)\c\debug\dll   or
82                      $(HDF4ROOT)\dlllib,$(HDF5ROOT)\c\release\dll
83     to the "additional library path" in the "input" section of the "link" settings
84* For a FORTRAN project add either  $(HDF4ROOT)\dllibdbg,$(HDF5ROOT)\f90\debug\dll   or
85                      $(HDF4ROOT)\dlllib,$(HDF5ROOT)\f90\release\dll
86     to the "additional library path" in the "input" section of the "link" settings
87* Add "wsock32.lib" (for the _htons@4 symbols etc.) and either "hdf5ddll.lib"  or  "hdf5dll.lib"
88  (depending on debug/release configuration) to the list of library modules to load.
89* Either add "nx45dll.lib" to the list of library modules to load in the link tab
90  or make your project "depend" on the "nx45dll" project (in which case it links to nx45dll.lib automatically)
91
92For a debug build only, you will have to add "msvcrt.lib" to the list of library
93modules to ignore on the link input tab.
94
95When you run the program, you either need to have the DLL files in the same directory as the EXE file
96or you need to add the directories containing the DLL files to the PATH environment variable.
97
98Freddie Akeroyd (Freddie.Akeroyd@rl.ac.uk)
99ISIS Facility
100Rutherford Appleton Laboratory
101GB
102
103$Id$
Note: See TracBrowser for help on using the repository browser.