Skip to content

Commit

Permalink
added BLAS library specification in build script (#83)
Browse files Browse the repository at this point in the history
* added BLAS library specification in build script

* Updated README with correct JSON config names

* added a note in etc/derecho/README.md regarding some tests note building with the Intel compiler

* added echo statements in the build scripts

* added TUV-X download in the build script

---------

Co-authored-by: Aditya Dendukuri <[email protected]>
Co-authored-by: Aditya Dendukuri <[email protected]>
  • Loading branch information
3 people authored May 23, 2024
1 parent 5366ab4 commit a24225a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 42 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ The full example uses data files from the `data` directory, which is why you nee
```
cd /output
cp -r /build/data .
tuv-x /build/examples/full_config.json
# to use the standalone tool
./tuv-x examples/tuv_5_4.json
# or
./tuv-x examples/ts1_tsmlt.json
```

Now, in your downloads folder, you should have to nc files, `photolysis_rate_constants.nc` and `dose_rates.nc`.
Expand All @@ -93,8 +96,12 @@ make -j 8

You will now have a runnable exectubable for `tuv-x` and the tests in the build directory.

`./tuv-x examples/full_config.json`.

```
# to use the standalone tool
./tuv-x examples/tuv_5_4.json
# or
./tuv-x examples/ts1_tsmlt.json
```
Inspect the output file `photolysis_rate_constants.nc` to see the results!

## Install
Expand Down
6 changes: 5 additions & 1 deletion etc/derecho/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Building TUV-x on Derecho


## Get the source code

- Copy the build script you wish to use from this folder to GLADE.
Expand All @@ -22,6 +23,7 @@ export TUVX_HOME=/path/to/my-tuvx-build
## Build TUV-x

Replace `/path/to/build_tuvx_derecho_X.sh` with the path to the build script you copied to GLADE, in the following:
> NOTE: Some test cases fail to build with the intel compiler.
```
cd $TUVX_HOME
Expand All @@ -45,6 +47,8 @@ make test

```
cd $TUVX_HOME/tuv-x/build
./tuv-x examples/full_config.json
./tuv-x examples/tuv_5_4.json
# or
./tuv-x examples/ts1_tsmlt.json
```

25 changes: 4 additions & 21 deletions etc/derecho/build_tuvx_derecho_gnu.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# The TUVX_HOME environment variable must be set to the directory to build TUV-x
# in prior to calling this script


module purge
module load ncarenv/23.09
module load craype/2.7.20
Expand All @@ -13,6 +12,7 @@ module load netcdf/4.9.2
module load ncarcompilers/1.0.0
module load cmake/3.26.3


if [[ -z "${TUVX_HOME}" ]]; then
echo "You must set the TUVX_HOME environment variable to the directory where TUV-x should be build."
return
Expand All @@ -23,29 +23,12 @@ if [[ ! -d "${TUVX_HOME}" ]]; then
return
fi

echo "Building JSON Fortran"

# get & build the source code of JSON Fortran

cd ${TUVX_HOME}
curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.3.0.tar.gz
tar -zxvf 8.3.0.tar.gz
cd json-fortran-8.3.0
mkdir build
cd build
INSTALL_DIR=$TUVX_HOME/json-fortran-8.3.0
cmake -D SKIP_DOC_GEN:BOOL=TRUE -D CMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
make install

echo "Building TUV-x"

# get & build the source code of TUV-x

# download and build TUV-X
echo "Downloading and Building TUV-x"
cd ${TUVX_HOME}
git clone [email protected]:NCAR/tuv-x.git
cd tuv-x
mkdir build
cd build
export JSON_FORTRAN_HOME=$INSTALL_DIR/jsonfortran-gnu-8.3.0
cmake -D CMAKE_BUILD_TYPE=release -D TUVX_ENABLE_MEMCHECK=OFF -D LAPACK_LIBRARIES=-lsci_gnu ..
cmake -D CMAKE_BUILD_TYPE=release -D TUVX_ENABLE_MEMCHECK=OFF -D LAPACK_LIBRARIES=-lsci_gnu -D BLAS_LIBRARIES=-lsci_gnu ..
make -j 8
18 changes: 1 addition & 17 deletions etc/derecho/build_tuvx_derecho_intel.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,8 @@ if [[ ! -d "${TUVX_HOME}" ]]; then
return
fi

echo "Building JSON Fortran"

# get & build the source code of JSON Fortran

cd ${TUVX_HOME}
curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.3.0.tar.gz
tar -zxvf 8.3.0.tar.gz
cd json-fortran-8.3.0
mkdir build
cd build
INSTALL_DIR=$TUVX_HOME/json-fortran-8.3.0
cmake -D SKIP_DOC_GEN:BOOL=TRUE -D CMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
make install

echo "Building TUV-x"

# get & build the source code of TUV-x

echo "Downloading and Building TUV-x"
cd ${TUVX_HOME}
git clone [email protected]:NCAR/tuv-x.git
cd tuv-x
Expand Down

0 comments on commit a24225a

Please sign in to comment.