File tree Expand file tree Collapse file tree 1 file changed +30
-5
lines changed
Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Original file line number Diff line number Diff line change 1+ import os
2+ import sys
13try :
24 from . import extensions
5+ from . import common
6+ from . import atomistic
7+ from . import micro
38except ImportError as e :
4- import os
59 cwd = os .getcwd ()
610 FIDIMAG_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
711 os .chdir (FIDIMAG_DIR )
8- print ("Could not find fidimag extensions. Trying to build them now..." )
12+ message = """
13+ Could not load the Fidimag extensions. This could be due to a few things:
14+ 1) The extensions are not built (we'll try and build them now).
15+ 2) FIDIMAG loads comon libraries dynamically. Currently, FIDIMAG requires
16+ * Sundials 2.6.2
17+ * FFTW 3.3.5
18+ If you are using Linux, you may be able to download these through a
19+ package manager such as apt or yum. However, convenience scripts
20+ are provided in the folder bin to install these locally.
21+ 3) If you've run the scripts to install the dynamic libaries,
22+ you may still need to export the LD_LIBRARY_PATH environment
23+ variable. You can do this from the shell with:
24+ export LD_LIBRARY_PATH={}:$LD_LIBRARY_PATH
25+ """
26+ print (message .format (FIDIMAG_DIR ))
927 os .system ("make build" )
1028 print ("Building extensions done." )
1129 os .chdir (cwd )
12- from . import common
13- from . import atomistic
14- from . import micro
30+ try :
31+ from . import extensions
32+ from . import common
33+ from . import atomistic
34+ from . import micro
35+ except ImportError as e :
36+ raise ImportError ("Loading the FIDIMAG extensions still didn't work."
37+ "\n Try the steps above!" )
38+
39+
1540from .gui import GUI
1641
1742citation = common .citation
You can’t perform that action at this time.
0 commit comments