setup_processing.py uses damask module but builds the core part of it, therefore made the use damask.core optional by setting a try statement in __init__.py and a "from damask import xxx"

This commit is contained in:
Martin Diehl 2012-01-04 11:06:24 +00:00
parent ee401520d7
commit dd1e968908
2 changed files with 8 additions and 5 deletions

View File

@ -7,4 +7,7 @@ from .result import Result # one class with subclasses
from .geometry import Geometry # one class with subclasses
from .solver import Solver # one class with subclasses
from .test import Test
try:
from . import core
except:
print 'Core module (Fortran code) not available, try to run setup_processing.py'

View File

@ -2,7 +2,8 @@
# Makes postprocessing routines acessible from everywhere.
import os,sys,glob,string,damask
import os,sys,glob,string
from damask import Environment
from optparse import OptionParser, Option
@ -44,7 +45,7 @@ parser.add_option('--F90', dest='compiler', type='string', \
(options,filenames) = parser.parse_args()
if options.compiler not in compilers:
parser.error('compiler has to be one out of --F90 %s'%(', '.join(compilers)))
parser.error('compiler switch "--F90" has to be one out of: %s'%(', '.join(compilers)))
f2py_compiler = {
'gfortran': 'gnu95 --f90flags="-fno-range-check"',
@ -54,8 +55,7 @@ f2py_compiler = {
'ifort': 'intelem',
}[options.compiler]
damaskEnv = damask.Environment()
damaskEnv = Environment()
baseDir = damaskEnv.relPath('processing/')
codeDir = damaskEnv.relPath('code/')