Opened 6 years ago

Last modified 6 years ago

#1138 new enhancement

refactor environment variables

Reported by: pkienzle Owned by:
Priority: minor Milestone: SasView 4.3.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

The environment variables are now displayed by the sascomp command (ticket 608 branch) as:

    -DSAS_MODELPATH=~/.sasmodels/custom_models sets path to custom models
    -DSAS_WEIGHTS_PATH=~/.sasview/weights sets path to custom distributions
    -DSAS_OPENCL=vendor:device|none sets the target OpenCL device
    -DXDG_CACHE_HOME=~/.cache sets the pyopencl cache root (linux only)
    -DSAS_COMPILER=tinycc|msvc|mingw|unix sets the DLL compiler
    -DSAS_OPENMP=0 set to 1 to turn on OpenMP for the DLLs
    -DSAS_DLL_PATH=~/.sasmodels/compiled_models sets the DLL cache

These should appear somewehere in the sasview manual.

Perhaps we should make SAS_WEIGHTS_PATH default to ~/.sasmodels/weights to be consistent with SAS_MODELPATH and SAS_DLL_PATH, and redirect it in sasview like we do for SAS_MODELPATH.

We should redirect SAS_DLL_PATH to the ~/.sasview directory as well, otherwise we end up with .sasview and .sasmodels in our home directory.

Renaming SAS_MODELPATH to SAS_MODEL_PATH would add further consistency.

Document any other environment variables used in sasview or sasmodels.

The XDG_CACHE_HOME variable is used by pyopencl, and is defined in the appdirs package. Consider using this package for sasview/sasmodels as well since we already depend on it through pyopencl.

Change History (2)

comment:1 Changed 6 years ago by smk78

/sasview/docs/sphinx-docs/source/user/environment.rst created

Linked into manual from Working with SasView

comment:2 Changed 6 years ago by pkienzle

These are all sasmodels environment variables, and so ought to be in the sasmodels doc tree.

Searching the sasview wx source I see the following additional environment variables referenced by sasview:

  • SASVIEW_DOC_PATH
  • SASVIEW_WX_VERSION
  • OMP_NUM_THREADS
  • MPLCONFIGDIR
  • MPLBACKEND
Note: See TracTickets for help on using tickets.