File: set_nrnpyenv.sh

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (33 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash

#if nrniv does not work then see if we can fix the problem
if nrniv -c 'quit()' >& /dev/null ; then
  true
else
  orig_pythonhome="$PYTHONHOME"
  orig_pythonpath="$PYTHONPATH"
  orig_ldlibpath="$LD_LIBRARY_PATH"
  orig_path="$PATH"
  eval "`nrnpyenv.sh`"
  if nrniv -c 'quit()' >& /dev/null ; then
    true
  else
    echo Attempt to fix nrniv failure using: 'eval "`mk_nrnpyenv.sh`"' failed.
    if test "$orig_pythonhome" = "" ; then
      unset PYTHONHOME
    else
      export PYTHONHOME="$orig_pythonhome"
    fi
    if test "$orig_pythonpath" = "" ; then
      unset PYTHONPATH
    else
      export PYTHONPATH="$orig_pythonpath"
    fi
    if test "$orig_ldlibpath" = "" ; then
      unset LD_LIBRARY_PATH
    else
      export LD_LIBRARY_PATH="$orig_ldlibpath"
    fi
    export PATH="$orig_path"
  fi
fi