Compiling SCHISM on Windows
Here are the tools and libraries Jon Shu used to build parallel SCHISM on Windows
- MS Visual Studio 2010
- MS HPC package 2008, which can be downloaded at here
- Intel Compiler
- SVN 1.6.16
- CMAKE 3.02
- Prebuild third party libs, which are here here This zip file contains HDF5,netCDF4 and parmetis. Here is an article on how to build netcdf lib on Windows.
Here are the steps to build it
- Edit the CMAKE Windows cache file in SCHSIM source code\cmake\SCHSIM.local.cmake.win. You may turn on/off extra modules in this file, and you must set TVD_LIM option to build hydro. You also need to edit the location of third party libs. Here is a example File:SCHSIM.local.cmake.win.txt
- Create a directory for SCHSIM build, say v5.6.1_build. Start Windows cmd from this folder, type the command line below to generate
MS Visual Studio 2010 project.
"cmake -C ..\v5.6.1\cmake\SCHISM.local.cmake.win -DCMAKE_BUILD_TYPE:STRING=Release -G"Visual Studio 10 Win64" --build . Z:\schism\v5.6.1\src"
- Current SCHSIM cmake system doesn't work very well on Windows, I have seen TVD_LIM preprocessor was not set correctly in the resulting project. To fix this issue, in the solution explorer of MS Visual Studio right click project hydro to show property pages, go to Fortran->Preprocessor->Preprocessor Definitions to make sure you have the correct TVD_LIM defined, For instance, "TVD_SB", if you choose SB option for TVD_LIM.
Also,I found third party lib path for the project pschsim has to be adjust manually in Visual Studio. Right click project pschism to show property pages, go to Linker->Input->Additional Dependencies and check if you have the correct and complete third party libs. I usually just add all the paths manually, here is the list of my input.
Z:\schism\third_party\netCDF432\netCDF_c\lib\netcdf.lib Z:\schism\third_party\netCDF432\netCDF_fortran\lib\netcdf_f90.lib Z:\schism\third_party\netCDF432\netCDF_fortran\lib\ncfortran.lib Z:\schism\third_party\hdf5\lib\hdf5_hl.lib Z:\schism\third_party\hdf5\lib\hdf5.lib Z:\schism\third_party\hdf5\lib\zlib.lib Z:\schism\third_party\parmetis-4.0.3\lib\parmetis.lib Z:\schism\third_party\parmetis-4.0.3\metis\lib\metis.lib "C:\Program Files\Microsoft HPC Pack 2008 R2\lib\amd64\msmpi.lib" "C:\Program Files\Microsoft HPC Pack 2008 R2\Lib\amd64\msmpifec.lib"
- Build the project pschism.
- If your pschism executable throw error of stack overflow when running, it means the reserved stack size is not enough for the executable. You can either run it with more threads in parallel or change the reserved stack size via Visual Studio. To change stack size, Right click project pschism to show property pages, go to Linker->System, and increase Stack Reserve Size and Stack Commit Size, then rebuild pschism.
From Associate Prof. Jian Li in CUG (Wuhan) (July 2018)
Some experiences can be shared about running SCHISM in Windows, I found that several executables of SCHISM_5.6.1 has been uploaded by Jon Shu in the Wiki. Now I want to share the compiling files and running case for the SCHISM5.3.1, which can be used for the developers to develop and debug the code. Besides that, I transferred part of the cohesive sediment modeling code from FVCOM model and also bundled in the file. I used Visual Studio 2008 and Intel Fortran 11.0 to compile SCHISM5.3.1, and the same method and softwares can be used to compile the other version of SCHISM.
All the third party softwares included METIS, NetCDF, GOTM3.2 were also bundled in the software. At the same time, I also used Cygwin to compile and run the SCHISM5.3.1. Therefore, I can develop, compile and run SCHISM both in Windows and Linux alternatively.
I also send the test case of the Sed3D_Trench_migration to you, which can be run in Windows cmd like this: mpiexec -np 8 schism5.3.1 Wish these experiences can help the developers like the Windows OS. The different preprocessor should be used if you want to use another modules, which should be configured in the Visual Studio compiler. If you have any questions, please contact with me, my email address is email@example.com The ACE tools have also been compiled using CygWin in Windows OS, you can email me and I can send you the necessary files.