@@ -37,6 +37,12 @@ goes into details about how to contribute, but basically we ask three things:
3737INSTALLATION NOTES
3838------------------
3939
40+ CVMix can be installed using two different methods. The original uses Make
41+ and a set of Makefiles. The new method uses CMake and two CMakelists.txt
42+ files.
43+
44+ #### Building/installing using Make
45+
4046The src directory contains a Makefile and a simple 'make' should be sufficient
4147to build the standalone driver. The first time you build, the 'cvmix_setup'
4248utility will run and prompt you for compiler and netcdf information - it will
@@ -58,14 +64,60 @@ $ make FC=[compiler] \
5864And then use -I$(INC_DIR) -L$(LIB_DIR) -lcvmix when you build software using
5965the CVMix library.
6066
67+ #### Building/installing using CMake
68+
69+ [ CMake] ( https://cmake.org/ ) can be used in GUI mode. Further information can
70+ be found on the CMake web-page. Below is provided the command line commands
71+ to configure and compile CVMix. Note that CVMix has been build on Windows using
72+ VisualStudio and the Intel Fortran compiler but NetCDF support has not been
73+ tested.
74+
75+ 1 . cd $CVMix/bld/cmake_bld
76+ * [ CMake] ( https://cmake.org/ ) promotes out of source compilation,
77+ any such directory will do.
78+ 2 . cmake $CVMix
79+ * The simplest configuration - using default Fortran compiler
80+ 3 . cmake $CVMix -DCMAKE\_ Fortran\_ COMPILER=ifort
81+ * Specifying a Fortran compiler
82+ 4 . cmake $CVMix -DCVMIX\_ BUILD\_ DRIVER=on
83+ * Build the CVMix driver program - off by default
84+ 5 . cmake $CVMix -DCVMIX\_ BUILD\_ DRIVER=on CVMIX\_ USE\_ NetCDF=on
85+ * Include support for NetCDF in the driver model(1)
86+ * Note that this requires proper configuration of the installed NetCDF library.
87+ * Setting NetCDF\_ INCLUDE and NetCDF\_ LIBRARIES might help.
88+ 6 . cmake $CVMix -DCMAKE\_ INSTALL\_ PREFIX=$CVMix/bin
89+ * Providing an installation folder (again, any such directory will do)
90+
91+ Combination of the above commands is possible.
92+
93+ After configuration has been done compilation is as simple as:
94+
95+ ```
96+ make
97+ ```
98+
99+ and installation by:
100+
101+ ```
102+ make install
103+ ```
104+
105+ After installation the build directory can be removed.
106+
107+ The support for CMake builds provides sufficient infrastructure for CVMix
108+ being included in ocean models using the GIT submodule feature. This has
109+ been used in the [ GOTM] ( https:/gotm.net ) inclusion of the CVMix mixing
110+ models as a supplement to the original turbulence models in GOTM.
111+
112+ 1): There is unfortunately not an official NetCDF module finder in CMake.
61113
62114DIRECTORY STRUCTURE
63115-------------------
64116
65117bin/ -- Default location for the cvmix executable.
66118
67119bld/ -- Contains auxiliary files needed by the build system. CompileFlags.mak
68- has default compile flags for 5 different compilers -- gfortran,
120+ has default compile flags for 5 different compilers -- gfortran,
69121 pgf90, ifort, xlf90, and nagfor, as well as ftn (the Cray wrapper for
70122 pgf90). At this time, no other compilers are supported on Cray systems.
71123 cvmix_setup is a python script that saves information about what
@@ -179,7 +231,7 @@ src/ -- Contains the source code, organized as follows. The top directory
179231
180232 src/drivers/ -- Subroutines called by the driver (one per test).
181233
182- src/shared/ -- Where all the modules that are needed to use CVMix with an
234+ src/shared/ -- Where all the modules that are needed to use CVMix with an
183235 outside model are stored. Also contains the Makefile used to
184236 build the libcvmix.a library.
185237
0 commit comments