Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 2643 generic install #2657

Merged
merged 7 commits into from
Aug 23, 2023
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 48 additions & 42 deletions internal/scripts/installation/config/install_met_env.generic
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
#Find the directory this script is called from
# Find the directory this script is called from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

#Required
#Directory that is the root of the compile
export TEST_BASE=$DIR/../
# Required
# Directory that is the root of the compile
export TEST_BASE=${DIR}

#Required
#Compiler options = gnu, intel, ics, ips, PrgEnv-intel, or pgi
#Compiler+version can be used for machines using modules e.g. gnu_6.3.0
export COMPILER=gnu
# Required
# Format is compiler_version (e.g. gnu_8.3.0)
# Compiler options = gnu, intel, ics, ips, PrgEnv-intel, or pgi
# Version is used for gnu in compilation of BUFRLIB and HDF5
export COMPILER=gnu_8.3.0

#Required
#Root directory for creating/untaring met source code - usually same as TEST_BASE
# Required
# Root directory for creating/untaring met source code - usually same as TEST_BASE
export MET_SUBDIR=${TEST_BASE}

#Required
#The name of the met tarbal usually downloaded with version from dtcenter.org and includes a version
# example - met-9.0.1.20200423.tar.gz
#met.tar.gz is used for compiling from cloned github repo
export MET_TARBALL=met.tar.gz
# Required
# The name of the met tarbal usually downloaded with version from dtcenter.org and includes a version
# example - v11.1.0.tar.gz
export MET_TARBALL=v12.0.0.tar.gz

#Required
#Specifiy if machine useds modules for loading software
# Required
# Specify if machine useds modules for loading software
export USE_MODULES=FALSE

#Root directory of your python install
export PYTHON_LOC="$(python3-config --prefix)"
# Root directory of your python install, containing the bin, include, lib, and share directories
export MET_PYTHON=`python3-config --prefix`

#Directory of your python executable
export MET_PYTHON=${PYTHON_LOC}
# Python ldflags created using python3-config
export MET_PYTHON_LD=`python3-config --ldflags --embed`

#Python ldflags created using python3-config
export MET_PYTHON_LD="$(python3-config --ldflags)"
# Python cflags created using python3-config
export MET_PYTHON_CC=`python3-config --cflags`

#Python cflags created using python3-config
export MET_PYTHON_CC="$(python3-config --cflags)"
# Use MAKE_ARGS to sped up the compilation of the external libaries and/or MET
# MAKE_ARGS can be set "-j #" where # is replaced with the number of
# cores to use (as an integer) or to simply "-j" to use all available cores.
export MAKE_ARGS=-j

#64 bit machine or not
export SET_D64BIT=FALSE

#General CFLAGS
export CFLAGS="-Wall -g"

#General CXXLAGS
export CXXFLAGS="-Wall -g"

#Normally should be omitted or set to TRUE - only used if building from github repo
export USE_MET_TAR_FILE=FALSE

#If you've already compiled these and don't need to compile them again, set the following
# If you've already used the script to compile these libaries and don't need to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking that I'm interpreting this correctly: if a user already has the libraries installed, they can leave the statements commented out, ONLY IF they're installed in the {EXTERNAL_LIBS} location. Otherwise, if they're installed somewhere else the user will need to uncomment the line and provide the correct path.
What should be done if the libraries aren't installed? Leave them commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should be done if the libraries aren't installed? Leave them commented out?

Yes.

if a user already has the libraries installed, they can leave the statements commented out, ONLY IF they're installed in the {EXTERNAL_LIBS} location.

If the libraries are commented out, the script will always attempt build the libraries in the external_libs directory. If the libraries are installed somewhere other than the external_libs directory and the user would like to use those libraries, they will want to uncomment the line and provide the path. If the libraries are installed in the external_libs directory and the user would like to use those libraries, they will want to uncomment the line and leave it as-is. If the libraries are not installed and the user would like the script to install them, they should leave the lines commented out.

Phew, that's kind of a mouthful, let me try to say it better:

Uncomment the external library variables if the libraries are installed in any location and the user would like to make use of those pre-installed libraries. If the libraries are in the external_libs dir, uncomment and do nothing. If the libraries are not in the external_libs dir, uncomment and change the paths to the appropriate location.

Leave the external library variables commented out if the user would like the library/libraries installed in the external_libs subdirectory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That clears it up a bit, thanks. Given that truth, I would suggest a slight change to the wording to reflect closer to what you've just said,

If users have already installed these libraries and would like to make use of them, uncomment out the export statements. If those pre-existing libraries are in the external_libs directory, no further edits need occur; however, users that have the pre-existing libraries not in the external_libs directory will need to update the paths to the appropriate location.

Does that convey the necessary information well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j-opatz, yes that conveys the necessary information well. Thank you for simplifying it! I appreciate it!

I made one slight change to that wording the in the update to the documentation. Instead of "no further edits need occur", I said, "no further edits are needed". If you prefer the original wording that is fine, and please feel free to change it.

# compile them again, please comment out the export statements with a "#" symbol
# in front. If you have these installed in a location other than ${EXTERNAL_LIBS},
# you can provide the appropriate path below and uncomment the line.
#export EXTERNAL_LIBS=${TEST_BASE}/external_libs
#export MET_GSL=${EXTERNAL_LIBS}
#export MET_BUFRLIB=${EXTERNAL_LIBS}/lib
#export BUFRLIB_NAME=-lbufr
#export LIB_JASPER=${EXTERNAL_LIBS}/lib
#export LIB_LIBPNG=${EXTERNAL_LIBS}/lib
#export LIB_Z=${EXTERNAL_LIBS}/lib
#export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib
#export MET_GRIB2CINC=${EXTERNAL_LIBS}/include
#export GRIB2CLIB_NAME=-lgrib2c
#export MET_BUFRLIB=${EXTERNAL_LIBS}/lib
#export BUFRLIB_NAME=-lbufr
#export MET_NETCDF=${EXTERNAL_LIBS}/lib
# Also, don't forget to set the following options to zero within the compile script if you've already compiled those libraries as well: COMPILE_GSL, COMPILE_HDF, COMPILE_HDFEOS, COMPILE_CAIRO, COMPILE_FREETYPE
#export MET_HDF5=${EXTERNAL_LIBS}
#export MET_NETCDF=${EXTERNAL_LIBS}

# The optional libraries HDF4, HDFEOS, FREETYPE, and CAIRO are used for the
# following, not widely used tools: MODIS-Regrid, lidar2nc, and MODE Graphics.
# To enable the compilation of these libraries, set the compilation flags for
# the library (e.g. COMPILE_HDF, COMPILE_HDFEOS, COMPILE_CAIRO,
# COMPILE_FREETYPE) to any value in the environment config file. If these
# libraries have already been installed and don't need to be reinstalled, set
# MET_HDF, MET_HDFEOS, MET_FREETYPEINC, MET_FREETYPELIB, MET_CAIROINC,
# and MET_CAIROLIB to their installed locations.