Skip to content

Commit

Permalink
Update README_CMAKE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cd10kfsu committed Aug 21, 2022
1 parent b6f156a commit 284edd3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_gfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: "install NetCDF"
- name: "install NetCDF, HDF4, HDF5"
run: |
sudo apt install libnetcdf-dev libnetcdff-dev netcdf-bin
sudo apt install hdf4-tools libhdf4-dev
Expand All @@ -32,7 +32,7 @@ jobs:
echo "===============================" && h5fc -showconfig && h5fc -show test.f90
echo "===============================" && ulimit -a
- name: "cmake build (build NetCDF, HDF4)"
- name: "cmake build"
run: |
source ./config/env.gnu.github.sh
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=gfortran -DBUILD_H4=ON -DBUILD_H5=ON -DH5_VERSION_1_8=OFF -DBUILD_NC=ON -DTEST_FULL=OFF -DCMAKE_VERBOSE_MAKEFILE=OFF
Expand Down
25 changes: 18 additions & 7 deletions README.CMAKE → README_CMAKE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
#Compile with CMAKE:
## Compile with CMAKE:

"make all" in the current directory, and a directory "build" will be created here. The libs and includes will be under "build/libs" and "build/include".

config/env.sh sets the required environmental vars used by CMAKE.

To turn off specific lib, you can modify Makefile at the current directory as:

# turn off hdf
all:
### turn off hdf
```
mkdir build
. config/env.sh; cd build; cmake -DBUILD_H4=off ..; make; make test
```

# turn off netcdf
all:
### turn off netcdf
```
mkdir build
. config/env.sh; cd build; cmake -DBUILD_NC=off ..; make; make test
```

# turn off hdf5
all:
### turn off hdf5
```
mkdir build
. config/env.sh; cd build; cmake -DBUILD_H5=off ..; make; make test
```

#### for hdf5 libs, if you are using hdf5 libs with major version <= 1.8
add the `H5_VERSION_1_8=ON` when running cmake

```
mkdir build
. config/env.sh; cd build; cmake -DBUILD_H5=on -DH5_VERSION_1_8=ON ..; make; make test
```

0 comments on commit 284edd3

Please sign in to comment.