EcoExtreML / STEMMUS_SCOPE_Processing

Python modules and notebooks to process data and run STEMMUS-SCOPE model
https://pystemmusscope.readthedocs.io/en/latest/
Apache License 2.0
5 stars 1 forks source link

Setting up environment variable LD_LIBRARY_PATH #12

Open SarahAlidoost opened 2 years ago

SarahAlidoost commented 2 years ago

For running the model on a local system, the notebook run_model_in_notebook.ipynb sets the environment variable LD_LIBRARY_PATH. Instead, we can create a bash script to set the variable after MCR installation. Something like:

  echo Setting up environment variables
  MCRROOT="$1"
  echo ---
  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/extern/bin/glnxa64;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64;
  export LD_LIBRARY_PATH;
  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
# Preload glibc_shim in case of RHEL7 variants
  test -e /usr/bin/ldd &&  ldd --version |  grep -q "(GNU libc) 2\.17"  \
            && export LD_PRELOAD="${MCRROOT}/bin/glnxa64/glibc-2.17_shim.so"