From dd1e968908a87e7d8b09110b75450c81ce3c95a1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 4 Jan 2012 11:06:24 +0000 Subject: [PATCH] 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" --- lib/damask/__init__.py | 5 ++++- processing/setup/setup_processing.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 291b70a4e..b4af675b4 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -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 -from . import core +try: + from . import core +except: + print 'Core module (Fortran code) not available, try to run setup_processing.py' diff --git a/processing/setup/setup_processing.py b/processing/setup/setup_processing.py index 4e6703890..cfb3076cd 100755 --- a/processing/setup/setup_processing.py +++ b/processing/setup/setup_processing.py @@ -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/')