SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

refactor environment variables (Trac #1138) #239

Open pkienzle opened 5 years ago

pkienzle commented 5 years ago

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.

Migrated from http://trac.sasview.org/ticket/1138

{
    "status": "new",
    "changetime": "2018-09-18T02:29:59",
    "_ts": "2018-09-18 02:29:59.821026+00:00",
    "description": "The environment variables are now displayed by the sascomp command (ticket 608 branch) as:\n{{{\n    -DSAS_MODELPATH=~/.sasmodels/custom_models sets path to custom models\n    -DSAS_WEIGHTS_PATH=~/.sasview/weights sets path to custom distributions\n    -DSAS_OPENCL=vendor:device|none sets the target OpenCL device\n    -DXDG_CACHE_HOME=~/.cache sets the pyopencl cache root (linux only)\n    -DSAS_COMPILER=tinycc|msvc|mingw|unix sets the DLL compiler\n    -DSAS_OPENMP=0 set to 1 to turn on OpenMP for the DLLs\n    -DSAS_DLL_PATH=~/.sasmodels/compiled_models sets the DLL cache\n}}}\n\nThese should appear somewehere in the sasview manual.\n\nPerhaps 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.  \n\nWe should redirect SAS_DLL_PATH to the ~/.sasview directory as well, otherwise we end up with .sasview and .sasmodels in our home directory.\n\nRenaming SAS_MODELPATH to SAS_MODEL_PATH would add further consistency.\n\nDocument any other environment variables used in sasview or sasmodels.\n\nThe 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.",
    "reporter": "pkienzle",
    "cc": "",
    "resolution": "",
    "workpackage": "SasView Bug Fixing",
    "time": "2018-07-19T17:46:35",
    "component": "SasView",
    "summary": "refactor environment variables",
    "priority": "minor",
    "keywords": "",
    "milestone": "SasView 4.3.0",
    "owner": "",
    "type": "enhancement"
}
smk78 commented 5 years ago

Trac update at 2018/07/20 15:52:57: smk78 commented:

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

Linked into manual from Working with !SasView

pkienzle commented 5 years ago

Trac update at 2018/09/18 02:29:59: pkienzle commented:

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: