Skip to content

Commit

Permalink
#2574 Added --enable-ugrid
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Oct 10, 2023
1 parent 94d993c commit a8ec014
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 28 deletions.
4 changes: 4 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ sub-directory, or the MET Online Tutorial:
Enable compilation of lidar2nc
Requires $MET_HDF

--enable-ugrid
Enable compilation of unstructured grid
Requires $MET_ATLAS, $MET_ECKIT, and $MET_UGRID_LD

To configure MET to install all of the available tools in the "bin"
subdirectory of your current directory, you would use the following command:

Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UGRID_LIBS = @UGRID_LIBS@
VERSION = @VERSION@
YACC = @YACC@
YFLAGS = @YFLAGS@
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
/* "build tc_utils" */
#undef ENABLE_TC_UTILS

/* "build unstructured grid with Atlas and eckit libraries" */
#undef ENABLE_UGRID

/* "build wavelet_stat" */
#undef ENABLE_WAVELET_STAT

Expand Down
69 changes: 54 additions & 15 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ YACC
FC_LIBS
ENABLE_DEVELOPMENT_FALSE
ENABLE_DEVELOPMENT_TRUE
UGRID_LIBS
ENABLE_UGRID_FALSE
ENABLE_UGRID_TRUE
PYTHON_LIBS
ENABLE_PYTHON_FALSE
ENABLE_PYTHON_TRUE
Expand Down Expand Up @@ -888,6 +891,7 @@ enable_tc_utils
enable_gsi_tools
enable_grib2
enable_python
enable_ugrid
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1620,6 +1624,8 @@ Optional Features:
--disable-gsi_tools Disable compilation of gsi_tools
--enable-grib2 Enable compilation of utilities using GRIB2
--enable-python Enable python embedding
--enable-ugrid Enable unstructured grid with Atlas and eckit
libraries
Some influential environment variables:
CC C compiler command
Expand All @@ -1639,16 +1645,16 @@ Some influential environment variables:
include files are not under the same main proj directory. If
used, MET_PROJINC must also be defined and MET_PROJ will be
ignored.
MET_ATLAS Where atlas lib and include subdirectories are located. If they
MET_ATLAS Where Atlas lib and include subdirectories are located. If they
are installed in /usr/local, you don't have to specify them.
MET_ATLASINC
Where atlas include files are located. Use if the libraries and
include files are not under the same main atlas directory. If
Where Atlas include files are located. Use if the libraries and
include files are not under the same main Atlas directory. If
used, MET_ATLASLIB must also be defined and MET_ATLAS will be
ignored.
MET_ATLASLIB
Where atlas libraries are located. Use if the libraries and
include files are not under the same main atlas directory. If
Where Atlas libraries are located. Use if the libraries and
include files are not under the same main Atlas directory. If
used, MET_ATLASINC must also be defined and MET_ATLAS will be
ignored.
MET_ECKIT Where eckit lib and include subdirectories are located. If they
Expand Down Expand Up @@ -4624,11 +4630,6 @@ fi

# AC_SUBST command line variables.

if (test -n "$MET_ATLASLIB"); then
CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC}"
LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB}"
fi

#
# Look for the Eckit library.
#
Expand Down Expand Up @@ -4656,11 +4657,6 @@ fi

# AC_SUBST command line variables.

if (test -n "$MET_ECKITLIB"); then
CPPFLAGS="${CPPFLAGS} -I${MET_ECKITINC}"
LDFLAGS="${LDFLAGS} -L${MET_ECKITLIB}"
fi

#
# Look for the NetCDF library.
#
Expand Down Expand Up @@ -6108,6 +6104,45 @@ $as_echo "$as_me: python embedding will not be compiled" >&6;}
fi


# Unstructure grid with ECMF libraries (Atlas/ecKit)

# Check whether --enable-ugrid was given.
if test "${enable_ugrid+set}" = set; then :
enableval=$enable_ugrid; case "${enableval}" in
yes | no ) ENABLE_UGRID="${enableval}" ;;
*) as_fn_error $? "bad value ${enableval} for --enable-ugrid" "$LINENO" 5 ;;
esac
else
ENABLE_UGRID="no"

fi


if test "x$ENABLE_UGRID" = "xyes"; then
ENABLE_UGRID_TRUE=
ENABLE_UGRID_FALSE='#'
else
ENABLE_UGRID_TRUE='#'
ENABLE_UGRID_FALSE=
fi


if test "x$ENABLE_UGRID" = "xyes"; then

$as_echo "#define ENABLE_UGRID /**/" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: unstructured grid will be compiled" >&5
$as_echo "$as_me: unstructured grid will be compiled" >&6;}
CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC} -I${MET_ECKITINC} -DWITH_UGRID"
LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB} -L${MET_ECKITLIB} -Wl,-rpath,${MET_ATLASLIB}:${MET_ECKITLIB}"
UGRID_LIBS="-lvx_data2d_ugrid -latlas -leckit -leckit_mpi -leckit_geometry"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: unstructured grid will not be compiled" >&5
$as_echo "$as_me: unstructured grid will not be compiled" >&6;}
UGRID_LIBS=
fi


########################################################################

# Check for the MET_DEVELOPMENT environment variable
Expand Down Expand Up @@ -9228,6 +9263,10 @@ if test -z "${ENABLE_PYTHON_TRUE}" && test -z "${ENABLE_PYTHON_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_PYTHON\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_UGRID_TRUE}" && test -z "${ENABLE_UGRID_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_UGRID\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_DEVELOPMENT_TRUE}" && test -z "${ENABLE_DEVELOPMENT_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_DEVELOPMENT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
41 changes: 28 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ fi

# Configure the variables. The help text will appear if the user uses "configure --help".

AC_ARG_VAR([MET_ATLAS], [Where atlas lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them.])
AC_ARG_VAR([MET_ATLASINC], [Where atlas include files are located. Use if the libraries and include files are not under the same main atlas directory. If used, MET_ATLASLIB must also be defined and MET_ATLAS will be ignored.])
AC_ARG_VAR([MET_ATLASLIB], [Where atlas libraries are located. Use if the libraries and include files are not under the same main atlas directory. If used, MET_ATLASINC must also be defined and MET_ATLAS will be ignored.])
AC_ARG_VAR([MET_ATLAS], [Where Atlas lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them.])
AC_ARG_VAR([MET_ATLASINC], [Where Atlas include files are located. Use if the libraries and include files are not under the same main Atlas directory. If used, MET_ATLASLIB must also be defined and MET_ATLAS will be ignored.])
AC_ARG_VAR([MET_ATLASLIB], [Where Atlas libraries are located. Use if the libraries and include files are not under the same main Atlas directory. If used, MET_ATLASINC must also be defined and MET_ATLAS will be ignored.])

# Ensure that both or neither are specified.

Expand All @@ -74,11 +74,6 @@ fi

# AC_SUBST command line variables.

if (test -n "$MET_ATLASLIB"); then
CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC}"
LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB}"
fi

#
# Look for the Eckit library.
#
Expand Down Expand Up @@ -106,11 +101,6 @@ fi

# AC_SUBST command line variables.

if (test -n "$MET_ECKITLIB"); then
CPPFLAGS="${CPPFLAGS} -I${MET_ECKITINC}"
LDFLAGS="${LDFLAGS} -L${MET_ECKITLIB}"
fi

#
# Look for the NetCDF library.
#
Expand Down Expand Up @@ -1098,6 +1088,31 @@ else
fi
AC_SUBST([PYTHON_LIBS])

# Unstructure grid with ECMF libraries (Atlas/ecKit)

AC_ARG_ENABLE(ugrid,
[AS_HELP_STRING([--enable-ugrid], [Enable unstructured grid with Atlas and eckit libraries])],
[case "${enableval}" in
yes | no ) ENABLE_UGRID="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ugrid) ;;
esac],
[ENABLE_UGRID="no"]
)

AM_CONDITIONAL([ENABLE_UGRID], [test "x$ENABLE_UGRID" = "xyes"])

if test "x$ENABLE_UGRID" = "xyes"; then
AC_DEFINE([ENABLE_UGRID], [], ["build unstructured grid with Atlas and eckit libraries"])
AC_MSG_NOTICE([unstructured grid will be compiled])
CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC} -I${MET_ECKITINC} -DWITH_UGRID"
LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB} -L${MET_ECKITLIB} -Wl,-rpath,${MET_ATLASLIB}:${MET_ECKITLIB}"
UGRID_LIBS="-lvx_data2d_ugrid -latlas -leckit -leckit_mpi -leckit_geometry"
else
AC_MSG_NOTICE([unstructured grid will not be compiled])
UGRID_LIBS=
fi
AC_SUBST([UGRID_LIBS])

########################################################################

# Check for the MET_DEVELOPMENT environment variable
Expand Down

0 comments on commit a8ec014

Please sign in to comment.