5
5
6
6
An example of implementing the
7
7
[ Fortran bindings] ( https://github.com/csdms/bmi-fortran )
8
- for the CSDMS
9
- [ Basic Model Interface] ( https://bmi-spec.readthedocs.io ) (BMI).
10
-
8
+ for the CSDMS [ Basic Model Interface] ( https://bmi.csdms.io ) (BMI).
11
9
12
10
## Overview
13
11
@@ -50,22 +48,21 @@ This example can be built on Linux, macOS, and Windows.
50
48
51
49
### CMake - Linux and macOS
52
50
53
- To build this example from source with CMake,
51
+ To configure and build this example from source with CMake,
54
52
using the current Fortran BMI version, run
55
53
56
- mkdir _build && cd _build
57
- cmake .. -DCMAKE_INSTALL_PREFIX=<path-to-installation>
58
- make
54
+ cmake -B _build -DCMAKE_INSTALL_PREFIX=<path-to-installation>
55
+ cmake --build _build
59
56
60
57
where ` <path-to-installation> ` is the base directory
61
58
in which the Fortran BMI bindings have been installed
62
59
(` /usr/local ` is the default).
63
60
When installing into a conda environment,
64
61
use the ` $CONDA_PREFIX ` environment variable.
65
62
66
- Then, to install (on both Linux and macOS) :
63
+ Then, to install:
67
64
68
- make install
65
+ cmake -- install _build
69
66
70
67
The installation will look like
71
68
(on macOS, using v2.0 of the Fortran BMI specification):
@@ -81,8 +78,8 @@ The installation will look like
81
78
| ` -- heatf.mod
82
79
` -- lib
83
80
| -- libbmif.a
84
- | -- libbmif.2.0.2 .dylib
85
- | -- libbmif.dylib -> libbmif.2.0.2 .dylib
81
+ | -- libbmif.2.1.4 .dylib
82
+ | -- libbmif.dylib -> libbmif.2.1.4 .dylib
86
83
| -- libbmiheatf.dylib
87
84
| -- libheatf.dylib
88
85
` -- pkgconfig
@@ -91,41 +88,36 @@ The installation will look like
91
88
` -- heatf.pc
92
89
` ` `
93
90
94
- From the build directory,
95
- run unit tests and examples of using the sample implementation with
91
+ Run unit tests and examples of using the sample implementation with
96
92
97
- ctest
93
+ ctest --test-dir _build
98
94
99
95
# ## CMake - Windows
100
96
101
97
An additional prerequisite is needed for Windows:
102
98
103
99
* Microsoft Visual Studio 2017 or Microsoft Build Tools for Visual Studio 2017
104
100
105
- To configure this example from source with cmake
101
+ To configure and build this example from source with CMake
106
102
using the current Fortran BMI version,
107
103
run the following in a [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs)
108
104
109
- mkdir _build && cd _build
110
- cmake .. ^
111
- -G " NMake Makefiles" ^
112
- -DCMAKE_INSTALL_PREFIX=< path-to-installation> ^
113
- -DCMAKE_BUILD_TYPE=Release
105
+ cmake -B _build -L -G Ninja -DCMAKE_INSTALL_PREFIX=< path-to-installation>
106
+ cmake --build _build
114
107
115
108
where ` < path-to-installation> ` is the base directory
116
109
in which the Fortran BMI bindings have been installed.
117
110
The default is ` " C:\Program Files (x86)" ` .
118
111
Note that quotes and an absolute path are needed.
119
112
When using a conda environment, use ` " %CONDA_PREFIX%\Library" ` .
120
113
121
- Then, to build and install:
114
+ Then, to install:
122
115
123
- cmake --build . --target install --config Release
116
+ cmake --install _build
124
117
125
- From the build directory,
126
- run unit tests and examples of using the sample implementation with
118
+ Run unit tests and examples of using the sample implementation with
127
119
128
- ctest
120
+ ctest --test-dir _build
129
121
130
122
131
123
# ## Fortran Package Manager (fpm)
0 commit comments