mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r15312] Purpose: Support Visual Studio 2008 on Windows
Description: Write documentation for building HDF5 with the latest version of Visual Studio, 2008. The process is very similar to building with Visual Studio 2005, but with an automatic project-file conversion beforehand. Also adapt commandline build scripts for Visual Studio 2008 as well. Tested: VS2008 on WinXP
This commit is contained in:
parent
7722c4c834
commit
2b50ce6983
@ -23,8 +23,9 @@ Contents:
|
||||
Section VIII : How to build HDF5 with Thread-Safe Feature
|
||||
Section IX : How to build HDF5 for 64-bit Windows
|
||||
Section X : How to build HDF5 on Windows Vista
|
||||
Section XI : Backwards Compatibility with HDF5 1.6
|
||||
Section XII : Misc.
|
||||
Section XI : How to build HDF5 using Visual Studio 2008
|
||||
Section XII : Backwards Compatibility with HDF5 1.6
|
||||
Section XIII : Misc.
|
||||
|
||||
|
||||
========================================================================
|
||||
@ -34,10 +35,10 @@ Contents:
|
||||
Preconditions:
|
||||
|
||||
1. Installed Microsoft Visual Studio. This document is written for Visual
|
||||
Studio 2005, although we also support Visual Studio .NET 2003. Most of
|
||||
the instructions are the same, although some features are unsupported in
|
||||
Visual Studio .NET. For simple Visual Studio .NET instructions, see the
|
||||
document INSTALL_Windows_NET.TXT.
|
||||
Studio 2005, although we also support Visual Studio .NET 2003 and Visual
|
||||
Studio 2008 as well. Most of the instructions are the same, although some
|
||||
features are unsupported in Visual Studio .NET. For simple Visual Studio
|
||||
.NET instructions, see the document INSTALL_Windows_NET.TXT.
|
||||
|
||||
2. (Optional) Installed Intel Compiler 9.1 or 10.1 if you want to build HDF5
|
||||
Fortran libraries.
|
||||
@ -187,6 +188,9 @@ Notes:
|
||||
7. For users who would like to build Muti-threaded version of HDF5 library,
|
||||
please read Section VII.
|
||||
|
||||
8. To build HDF5 in Visual Studio 2008, be sure to read the instructions in
|
||||
Section XI.
|
||||
|
||||
|
||||
========================================================================
|
||||
Section I: What do we build and install?
|
||||
@ -1119,6 +1123,8 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 9.1 and 10.1 are
|
||||
2. The Compaq Fortran Compiler is no longer supported for HDF5 1.8.
|
||||
|
||||
3. Intel Fortran 9.1 works only under Visual Studio 2005 environments.
|
||||
Building Fortran libraries under Visual Studio .NET is unsupported.
|
||||
Visual Studio 2008 is supported only with Intel Fortran 10.1.
|
||||
|
||||
4. Parallel builds should be disabled. To do so: Go to Tools >
|
||||
Options > Projects and Solutions > Build and Run. Set "Maximum Number
|
||||
@ -1142,7 +1148,7 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 9.1 and 10.1 are
|
||||
You have to read this part even if you want to use only Zlib
|
||||
or Szip. You also need to read Section V.
|
||||
|
||||
1) Invoke Microsoft Visual Studio 2005.
|
||||
1) Invoke Microsoft Visual Studio 2005 or 2008.
|
||||
|
||||
2) From the main menu, Go to Tools > Options > Intel(R) Fortran. In the
|
||||
right panel, make sure your "Selected Compiler" is Intel Fortran.
|
||||
@ -1156,15 +1162,15 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 9.1 and 10.1 are
|
||||
5) Then click "OK".
|
||||
|
||||
|
||||
1. Build with Intel Fortran Compiler 9.1 or 10.1 under Visual Studio 2005
|
||||
1. Build with Intel Fortran Compiler 9.1 or 10.1 under Visual Studio 2005 or 2008
|
||||
|
||||
Note: This step will build HDF5 Static and DLL C and C++ Library using
|
||||
Visual Studio 2005 Compiler as well as HDF5 Static and High Level
|
||||
Visual Studio compiler as well as HDF5 Static and High Level
|
||||
Fortran Library using Intel Fortran 9.1 or 10.1 Compiler.
|
||||
|
||||
1.1 Open all_fortran.sln
|
||||
|
||||
Invoke Microsoft Visual Studio 2005. From the main menu,
|
||||
Invoke Microsoft Visual Studio. From the main menu,
|
||||
go to "File" and select "Open Solution". Choose "all_fortran.sln"
|
||||
under the directory c:\MyHDFstuff\hdf5\windows\proj\all_fortran.
|
||||
|
||||
@ -1254,7 +1260,7 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 9.1 and 10.1 are
|
||||
|
||||
1. Open allf90examples.sln
|
||||
|
||||
Invoke Microsoft Visual Studio 2005. From the main menu,
|
||||
Invoke Microsoft Visual Studio. From the main menu,
|
||||
go to "File" and select "Open Solution". Choose "allf90examples.sln"
|
||||
under the directory
|
||||
c:\MyHDFstuff\hdf5\windows\fortran\examples\allf90examples.
|
||||
@ -1319,7 +1325,7 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 9.1 and 10.1 are
|
||||
|
||||
1. Open allhlf90examples.sln
|
||||
|
||||
Invoke Microsoft Visual Studio 2005. From the main menu,
|
||||
Invoke Microsoft Visual Studio. From the main menu,
|
||||
go to "File" and select "Open Solution". Choose
|
||||
"allhlf90examples.sln" under the directory
|
||||
c:\MyHDFstuff\hdf5\windows\hl\fortran\examples\allhlf90examples.
|
||||
@ -1614,10 +1620,10 @@ to the earlier sections of this document for details on building and testing.
|
||||
Section IX: How to build HDF5 for 64-bit Windows
|
||||
========================================================================
|
||||
|
||||
HDF5 can be built for 64-bit Windows in Visual Studio 2005. Visual Studio .NET
|
||||
has very primative 64-bit support, but it is very difficult to setup, and
|
||||
debugging is not supported. Therefore, we recommend all users switch to
|
||||
Visual Studio 2005 for 64-bit builds.
|
||||
HDF5 can be built for 64-bit Windows in Visual Studio 2005 or 2008. Visual
|
||||
Studio .NET has very primative 64-bit support, but it is very difficult to
|
||||
set up, and debugging is not supported. Therefore, we recommend all users
|
||||
switch to Visual Studio 2005 or 2008 for 64-bit builds.
|
||||
|
||||
Notes:
|
||||
|
||||
@ -1630,7 +1636,7 @@ Prerequisites:
|
||||
|
||||
1. A 64-bit Windows machine. Either AMD64 and Itanium is supported.
|
||||
|
||||
2. Microsoft Visual Studio 2005 installed with x64 Extensions.
|
||||
2. Microsoft Visual Studio 2005 or 2008 installed with x64 Extensions.
|
||||
|
||||
|
||||
Building:
|
||||
@ -1673,8 +1679,8 @@ Building on Windows Vista is very similar to building on Windows XP, with
|
||||
some minor changes. Therefore, follow the build instructions above, with the
|
||||
following considerations:
|
||||
|
||||
1. Only Visual Studio 2005 is currently supported on Windows Vista. This
|
||||
is because Microsoft has ended their support for 6.0 and .NET.
|
||||
1. Only Visual Studio 2005 and 2008 is currently supported on Windows Vista.
|
||||
This is because Microsoft has ended their support for and .NET.
|
||||
|
||||
2. Building Fortran libraries has not been tested, and is therefore also
|
||||
unsupported. You may attempt to build Fortran libraries following the
|
||||
@ -1694,6 +1700,32 @@ following considerations:
|
||||
script.
|
||||
|
||||
|
||||
========================================================================
|
||||
Section XI: How to build HDF5 using Visual Studio 2008
|
||||
========================================================================
|
||||
Building with Visual Studio 2008 is very similar to building with Visual Studio
|
||||
2005, with some minor changes. Therefore, follow the build instructions above,
|
||||
with the following considerations:
|
||||
|
||||
1. Visual Studio 2008 uses a new format for project files, but Visual Studio
|
||||
2005 project files can be easily converted. The HDF5 project files
|
||||
will need to be converted on first use. To do so:
|
||||
|
||||
1.1. Open the HDF5 Visual Studio 2005 solution file as in Section II
|
||||
(either all.sln or all_fortran.sln if building Fortran.)
|
||||
|
||||
1.2. You will be prompted with an automatic conversion wizard. Click
|
||||
through, accepting the default values. You may choose to create
|
||||
backups of the project files, although it isn't necessary.
|
||||
|
||||
1.3. When it is finished, it should state that all projects were
|
||||
converted successfully with no errors. Warnings can be ignored.
|
||||
|
||||
2. Once the project files have been converted, build and test normally.
|
||||
Note that the converted project files aren't backwards compatible with
|
||||
previous versions of Visual Studio.
|
||||
|
||||
|
||||
========================================================================
|
||||
Section XII: Backwards Compatibility with HDF5 1.6
|
||||
========================================================================
|
||||
@ -1725,7 +1757,7 @@ To enable 1.6 API symbols in your application:
|
||||
|
||||
|
||||
========================================================================
|
||||
Section XII: Misc.
|
||||
Section XIII: Misc.
|
||||
========================================================================
|
||||
|
||||
1. Helpful Pointers
|
||||
|
@ -6,10 +6,10 @@ Note: This instruction is written for users who would like to build HDF5
|
||||
libraries and tools from the HDF5 source code package on command
|
||||
line.
|
||||
|
||||
Currently, we support
|
||||
Currently, we support:
|
||||
|
||||
1. Building and testing HDF5 C/C++/Fortran libraries on command line with
|
||||
Microsoft Visual Studio 2005 for 32- or 64-bit Windows.
|
||||
Microsoft Visual Studio .NET, 2005 or 2008 for 32- or 64-bit Windows.
|
||||
|
||||
For all other Windows development tools, HDF5 should be built in
|
||||
the development environment. Please refer to INSTALL_Windows.txt
|
||||
@ -25,12 +25,12 @@ notes in INSTALL_Windows.txt before starting below procedures.
|
||||
|
||||
========================================================================
|
||||
Section I: Building and testing HDF5 on command line with Microsoft
|
||||
Visual Studio 2005
|
||||
Visual Studio
|
||||
========================================================================
|
||||
|
||||
1. Preconditions:
|
||||
|
||||
1.1 Verify environment for Visual Studio 2005
|
||||
1.1 Verify environment for Visual Studio
|
||||
|
||||
Building from the command line requires environment variables for Visual
|
||||
Studio. These are generally setup when Visual Studio is installed, but you
|
||||
@ -41,6 +41,9 @@ notes in INSTALL_Windows.txt before starting below procedures.
|
||||
This should output a path similar to:
|
||||
|
||||
C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
|
||||
|
||||
If you are using Visual Studio .NET, replace "vs80comntools" with
|
||||
"vs71comntools". For Visual Studio 2008, use "vs90comntools"
|
||||
|
||||
1.2 Run batch file copy_hdf.bat.
|
||||
|
||||
@ -55,9 +58,9 @@ notes in INSTALL_Windows.txt before starting below procedures.
|
||||
From the command prompt that you will be building HDF5 from, issue the
|
||||
following command:
|
||||
|
||||
set HDF5_EXT_ZLIB=zdll.lib
|
||||
set HDF5_EXT_ZLIB=zlib1.lib
|
||||
|
||||
replacing "zdll.lib" with the name of the zlib library on your system.
|
||||
replacing "zlib1.lib" with the name of the zlib library on your system.
|
||||
Similarly, set HDF5_EXT_SZIP to the name of the szip library on your system.
|
||||
|
||||
(Optional) If you will be building using the /useenv switch, you must also
|
||||
@ -80,6 +83,8 @@ notes in INSTALL_Windows.txt before starting below procedures.
|
||||
hdf5bt file takes the following options:
|
||||
/vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
Note: Default is Visual Studio 2005
|
||||
/vs9 Build HDF5 using Visual Studio 2008
|
||||
Note: Default is Visual Studio 2005
|
||||
/fort Build and test HDF5 with Fortran libraries
|
||||
/ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
|
||||
Note: Default is Intel Visual Fortran 9.1
|
||||
@ -109,6 +114,8 @@ notes in INSTALL_Windows.txt before starting below procedures.
|
||||
hdf55build takes the following options:
|
||||
/vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
Note: Default is Visual Studio 2005
|
||||
/vs9 Build HDF5 using Visual Studio 2008
|
||||
Note: Default is Visual Studio 2005
|
||||
/fort Build HDF5 with Fortran libraries
|
||||
/ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
|
||||
Note: Default is Intel Visual Fortran 9.1
|
||||
|
@ -18,6 +18,8 @@ rem This batch file is used to build and test HDF5 Libraries and Tools.
|
||||
rem This batch file takes the following options:
|
||||
rem . /vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
rem . Note: Default is Visual Studio 2005
|
||||
rem . /vs9 Build HDF5 using Visual Studio 2008
|
||||
rem . Note: Default is Visual Studio 2005
|
||||
rem . /fort Build and test HDF5 with Fortran libraries
|
||||
rem . /useenv Build HDF5 using compiler settings defined
|
||||
rem . in the environment, rather than the IDE.
|
||||
@ -29,7 +31,7 @@ rem . HDF5CHECK_LOG
|
||||
rem . /? Help information
|
||||
rem By Xuan Bai
|
||||
rem Created: Aug. 16, 2004
|
||||
rem Last Updated: Scott Wegner, 6/30/08
|
||||
rem Last Updated: Scott Wegner, 7/2/08
|
||||
|
||||
rem This batch file makes the following assumptions:
|
||||
rem - The appropriate version of Visual Studio is installed and setup
|
||||
@ -63,6 +65,8 @@ rem Print a help message
|
||||
echo.
|
||||
echo. /vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
echo. Note: Default is Visual Studio 2005
|
||||
echo. /vs9 Build HDF5 using Visual Studio 2008
|
||||
echo. Note: Default is Visual Studio 2005
|
||||
echo. /fort Build and test HDF5 with Fortran libraries
|
||||
echo. /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
|
||||
echo. Note: Default is Intel Visual Fortran 9.1
|
||||
@ -81,6 +85,10 @@ rem Parse through the parameters sent to file, and set appropriate variables
|
||||
rem Use Visual Studio .NET to build
|
||||
set hdf5_vnet=true
|
||||
|
||||
) else if "%%a"=="/vs9" (
|
||||
rem Use Visual Studio 2008 to build
|
||||
set hdf5_vs2008=true
|
||||
|
||||
) else if "%%a"=="/fort" (
|
||||
rem Enable Fortran
|
||||
set hdf5_enablefortran=true
|
||||
@ -125,6 +133,10 @@ rem Setup our environment
|
||||
set hdf5build_params=%hdf5build_params% /vs7
|
||||
)
|
||||
|
||||
if defined hdf5_vs2008 (
|
||||
set hdf5build_params=%hdf5build_params% /vs9
|
||||
)
|
||||
|
||||
if defined hdf5_enablefortran (
|
||||
set hdf5build_params=%hdf5build_params% /fort
|
||||
set hdf5check_params=enableall
|
||||
|
@ -18,6 +18,8 @@ rem This batch file is used to build HDF5 Libraries and Tools.
|
||||
rem This batch file takes the following options:
|
||||
rem . /vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
rem . Note: Default is Visual Studio 2005
|
||||
rem . /vs9 Build HDF5 using Visual Studio 2008
|
||||
rem . Note: Default is Visual Studio 2005
|
||||
rem . /fort Build HDF5 with Fortran libraries
|
||||
rem . /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
|
||||
rem . Note: Default is Intel Visual Fortran 9.1
|
||||
@ -26,7 +28,7 @@ rem . in the environment, rather than the IDE.
|
||||
rem . /? Help information
|
||||
rem By Xuan Bai
|
||||
rem Created: Aug. 16, 2004
|
||||
rem Last Updated: Scott Wegner, 6/30/08
|
||||
rem Last Updated: Scott Wegner, 7/2/08
|
||||
|
||||
rem This batch file makes the following assumptions:
|
||||
rem - The appropriate version of Visual Studio is installed and setup
|
||||
@ -58,6 +60,8 @@ rem Print a help message
|
||||
echo.
|
||||
echo. /vs7 Build HDF5 using Visual Studio .NET 2003
|
||||
echo. Note: Default is Visual Studio 2005
|
||||
echo. /vs9 Build HDF5 using Visual Studio 2008
|
||||
echo. Note: Default is Visual Studio 2005
|
||||
echo. /fort Build HDF5 with Fortran libraries using the
|
||||
echo. Intel Fortran version specified, or 9.1 by default
|
||||
echo. /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
|
||||
@ -77,6 +81,10 @@ rem Parse through the parameters sent to file, and set appropriate variables
|
||||
rem Use Visual Studio .NET 2003
|
||||
set hdf5_vnet=true
|
||||
|
||||
) else if "%%a"=="/vs9" (
|
||||
rem Use Visual Studio .NET 2003
|
||||
set hdf5_vs2008=true
|
||||
|
||||
) else if "%%a"=="/fort" (
|
||||
rem Enable Fortran
|
||||
set hdf5_enablefortran=true
|
||||
@ -123,11 +131,26 @@ rem Setup our environment
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
rem Make sure /vs7 and /vs9 weren't specified together
|
||||
if "%hdf5_vnet%%hdf5_vs2008%"=="truetrue" (
|
||||
echo.Error: /vs7 and /vs9 should not be specified together.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
rem Figure out which solution file to use based on configuration
|
||||
if defined hdf5_vnet (
|
||||
echo.Using Visual Studio .NET 2003
|
||||
set hdf5_sln="%CD%\windows_vnet\proj\all\all.sln"
|
||||
set hdf5_sln="%CD%\windows_vnet\proj\all\all.sln"
|
||||
|
||||
) else if defined hdf5_vs2008 (
|
||||
echo.Using Visual Studio 2008
|
||||
if defined hdf5_enablefortran (
|
||||
echo.Building Fortran projects enabled
|
||||
set hdf5_sln="%CD%\windows\proj\all_fortran\all_fortran.sln"
|
||||
) else (
|
||||
set hdf5_sln="%CD%\windows\proj\all\all.sln"
|
||||
)
|
||||
|
||||
) else (
|
||||
echo.Using Visual Studio 2005
|
||||
if defined hdf5_enablefortran (
|
||||
@ -164,6 +187,42 @@ rem Setup our environment
|
||||
echo.make sure VS71COMNTOOLS is defined in the environment.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
) else if defined hdf5_vs2008 (
|
||||
if not defined hdf5_enablefortran (
|
||||
if defined vs90comntools (
|
||||
rem This sets the Visual Studio 2005 path and environment variables
|
||||
if %hdf5_platform%==Win32 (
|
||||
call "%vs90comntools%\..\..\VC\vcvarsall.bat" x86
|
||||
) else (
|
||||
call "%vs90comntools%\..\..\VC\vcvarsall.bat" x86_amd64
|
||||
)
|
||||
|
||||
) else (
|
||||
echo.Error: Cannot setup Visual Studio 2008 environment. Please
|
||||
echo.make sure VS90COMNTOOLS is defined in the environment.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
) else (
|
||||
echo.with Intel Visual Fortran 10.1
|
||||
|
||||
if defined ifort_compiler10 (
|
||||
rem This sets the Intel Fortran 10.1 environment, as well as
|
||||
rem setting the appropriate Visual Studio environment
|
||||
|
||||
if %hdf5_platform%==Win32 (
|
||||
call "%ifort_compiler10%\IA32\Bin\ifortvars.bat"
|
||||
) else (
|
||||
call "%ifort_compiler10%\em64t\Bin\ifortvars.bat"
|
||||
)
|
||||
) else (
|
||||
echo.Error: Cannot setup Intel Fortran 10.1 environment. Please
|
||||
echo.make sure IFORT_COMPILER10 is defined in the environment.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
) else (
|
||||
rem Assume Visual Studio 2005
|
||||
if not defined hdf5_enablefortran (
|
||||
@ -204,7 +263,7 @@ rem Setup our environment
|
||||
echo.with Intel Visual Fortran 10.1
|
||||
|
||||
if defined ifort_compiler10 (
|
||||
rem This sets the Intel Fortran 9.1 environment, as well as
|
||||
rem This sets the Intel Fortran 10.1 environment, as well as
|
||||
rem setting the appropriate Visual Studio environment
|
||||
|
||||
if %hdf5_platform%==Win32 (
|
||||
@ -231,6 +290,15 @@ rem Setup our environment
|
||||
exit /b 0
|
||||
|
||||
|
||||
rem Upgrade the project files to the latest format for Visual Studio
|
||||
:upgrade
|
||||
|
||||
echo.Upgrading project files
|
||||
devenv %hdf5_sln% /Upgrade /NoLogo
|
||||
|
||||
exit /b
|
||||
|
||||
|
||||
rem Build the HDF5 libraries. By default, C and C++ libraries are built.
|
||||
:all
|
||||
|
||||
@ -244,8 +312,7 @@ rem Build the HDF5 libraries. By default, C and C++ libraries are built.
|
||||
rem Build both debug and release versions
|
||||
for %%a in (debug release) DO (
|
||||
echo.Building %hdf5_platform% %%a libraries...
|
||||
rem Only add hdf5_platform if using Visual Studio 2005, because Visual Studio
|
||||
rem .NET doesn't like the syntax
|
||||
rem Only add hdf5_platform if not using Visual Studio .NET, because it doesn't like the syntax
|
||||
if defined hdf5_vnet (
|
||||
devenv %hdf5_sln% %ccflags% /rebuild %%a
|
||||
) else (
|
||||
@ -291,6 +358,15 @@ rem This is where the magic happens
|
||||
echo.Error setting up build environment.
|
||||
goto error
|
||||
)
|
||||
|
||||
rem Upgrade the project files if needed
|
||||
if defined hdf5_vs2008 (
|
||||
call :upgrade
|
||||
if !errorlevel! neq 0 (
|
||||
echo.Error upgrading project files!
|
||||
goto error
|
||||
)
|
||||
)
|
||||
|
||||
echo.Building HDF5 Libraries and Tools
|
||||
echo.
|
||||
|
Loading…
Reference in New Issue
Block a user