*************** Building and Running HDF in Borland 6.0 in 31 easy steps *********************** 1. Make new directory on your drive called hdf. For example: c:\hdf\ 2. Download hdf5-1_4_4.zip at http://hdf.ncsa.uiuc.edu/HDF5/release/obtain5.html. 3. Unzip hdf5-1_4_4.zip in c:\hdf\. 4. Download zlib-1.1.4.tar.gz at http://prdownloads.sourceforge.net/libpng/zlib-1.1.4.tar.gz. 5. Unzip zlib-1.1.4.tar.gz in c:\hdf\. 6. You will now have two new directories: c:\hdf\hdf5-1_4_4\ c:\hdf\zlib-1.1.4\ 7. Rename c:\hdf\hdf5-1_4_4\ to c:\hdf\hdf5\ 8. Unzip c:\hdf\hdf5\windows\all.zip to c:\hdf\ 9. Make a new folder in c:\hdf for a New Borland Project. Such as c:\hdf\borland\ 10. In c:\hdf\borland make three new folders: c:\hdf\borland\hdflib\, c:\hdf\borland\zlib\, and c:\hdf\borland\hdftest\ ************************* Compiling Zlib ************************************** 11. Make a new Borland Library Project Named Zlib and save all files to c:\hdf\borland\zlib\ In Borland, click File, New, Other , under the New tab select library. 12. Add all the C files in c:\hdf\zlib-1.1.4\ to your Zlib project. In Borland click Project, add to Project, select files. 13. Add c:\hdf\zlib-1.1.4\ to your included directories in your Borland Project; In Borland click Project, Options, select Directories\Conditionals, add c:\hdf\zlib-1.1.4\ to the include paths. 14. Build the project. In Borland click project, Build Zlib. 15. Check and see if Zlib.lib is a new file in c:\hdf\borland\zlib\. If so, good work. 16. If Zlib.lib is there, close the Zlib Project ************************* Compiling HDF5 ************************************** 17. Make a new Borland Library Project Named HDFLib and save all files to c:\hdf\borland\hdflib\ In Borland, click File, New, Other, under the New tab select library. 18. Add all the C files in c:\hdf\hdf5\src\ to your HDFLib project. In Borland click Project, add to Project, select files. 19. Add c:\hdf\hdf5\src\ to your included directories in your Borland Project; In Borland click Project, Options, select Directories\Conditionals, add c:\hdf\hdf5\src\ to the include paths. 20. Add c:\hdf\borland\zlib\zlib.lib to your project. In Borland click Project, add to Project, select zlib.lib. 21. Add c:\hdf\zlib-1.1.4\ to your included directories in your Borland Project; In Borland click Project, Options, select Directories\Conditionals, add c:\hdf\zlib-1.1.4\ to the include paths. 22. There is a bug in the existing Code that you will need to change. In file HS5hyper.c change line 4934 from: stride = _stride; to: (hsize_t *) stride = _stride And in the same file HS5hyper.c change line 4946 from: block = _block; to: (hsize_t *) block = _block; 23. You will need to turn off warnings because when building too many are generated for borland. In Borland click Project, Options, Compiler Tab, select "None" under Warnings section. 24. Change the page size. (I'm not sure why you have to do this, but it won't compile if you don't) In Borland click Project, Options, TLib Tab, change page size to 0x1000 25. Build the Project In Borland click Project, Build HDFLib 26. Check and see if HDFLib.lib is in c:\hdf\borland\hdflib\ If so good job! ************************* Testing Lib files ************************************ 27. Make a new Borland Console Wizard Project Named HDFTest and save all files to c:\hdf\borland\hdftest\ 28. Save the following code as your main program source (this will test if hdf works): #include int main(int argc, char* argv[]) { hid_t file; file = H5Fcreate("test.txt", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); H5Fclose(file); } // All this does is create a file and close it using hdf commands 29. Add c:\hdf\borland\zlib\zlib.lib and c:\hdf\borland\hdflib\HDFLib.lib to your project. In Borland click Project, add to Project, select files 30. Add c:\hdf\zlib-1.1.4\ and c:\hdf\hdf5\src\ to your included directories in your Borland Project; In Borland click Project, Options, select Directories\Conditionals, add above directories to the include paths. 31. Run it! It should create a HDF file in the directory you saved the project (c:\hdf\borland\hdftest\) Created by: Chad Schneider schneide@nrel.colostate.edu 9-16-02