@@ -43,18 +43,18 @@ for example, suppose fidimag is in the directory of ~/work, then::
4343
4444 export PYTHONPATH=~/work/fidimag:$PYTHONPATH
4545
46- Add the library path to LD_LIBRARY_PATH
47- ---------------------------------------
48-
49- By default, the libraries are installed in fidimag/local, so in order
50- to run fidimag we need to include the libs path in LD_LIBRARY_PATH, so
51- please add the following to your .bashrc file::
52-
53- export LD_LIBRARY_PATH=/path/to/fidimag/local/lib:$LD_LIBRARY_PATH
54-
55- for instance::
56-
57- export LD_LIBRARY_PATH=~/work/fidimag/local/lib:$LD_LIBRARY_PATH
46+ .. Add the library path to LD_LIBRARY_PATH
47+ .. -- ---------------------------------------
48+ ..
49+ .. By default, the libraries are installed in fidimag/local, so in order
50+ .. to run fidimag we need to include the libs path in LD_LIBRARY_PATH, so
51+ .. please add the following to your .bashrc file::
52+ ..
53+ .. export LD_LIBRARY_PATH=/path/to/fidimag/local/lib:$LD_LIBRARY_PATH
54+ ..
55+ .. for instance::
56+ ..
57+ .. export LD_LIBRARY_PATH=~/work/fidimag/local/lib:$LD_LIBRARY_PATH
5858
5959
6060 Adding OOMMF path to the system
@@ -217,7 +217,7 @@ Notes:
217217 failed without a working X server).
218218
219219Install on OS X
220- =================
220+ ==================
221221
222222The inbuilt OS X gcc compiler (actually clang) doesn't have OpenMP support. A workaround is to
223223
@@ -236,3 +236,38 @@ Also install pytest (``conda install pytest`` if using conda) and
236236Then run ``make ``.
237237
238238Set the Pythonpath so that the fidimag source is in the path.
239+
240+
241+ Possible Issues on Mac OS
242+ =============================
243+ ImportErrors may arise when loading fidimag if the version of sundials is 2.6, ::
244+
245+ ImportError: dlopen(/Users/ww1g11/Softwares/fidimag/fidimag/extensions/clib.so, 2): Library not loaded: libsundials_cvodes.2.dylib
246+ Referenced from: /Users/ww1g11/Softwares/fidimag/fidimag/extensions/clib.so
247+ Reason: image not found
248+
249+ this is because the sundials library (libsundials_cvodes.2.dylib) in clib.so doesn't have a full path,
250+ which can be seen by using ``otool -L fidimag/extensions/clib.so ``, ::
251+
252+ fidimag/extensions/clib.so:
253+ /Users/ww1g11/Softwares/fidimag/local/lib/libfftw3_omp.3.dylib (compatibility version 8.0.0, current version 8.4.0)
254+ /opt/local/lib/libfftw3.3.dylib (compatibility version 8.0.0, current version 8.4.0)
255+ libsundials_cvodes.2.dylib (compatibility version 2.0.0, current version 2.0.0)
256+ libsundials_nvecserial.0.dylib (compatibility version 0.0.0, current version 0.0.2)
257+ libsundials_nvecopenmp.0.dylib (compatibility version 0.0.0, current version 0.0.2)
258+ /opt/local/lib/libgcc/libgomp.1.dylib (compatibility version 2.0.0, current version 2.0.0)
259+ /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
260+ /opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
261+
262+ A solution is to change these path manually with ``install_name_tool ``, so we have provided a python script (``fix_load_path_mac.py ``) to do this.
263+ After run the script, the library path is fixed, for example, the output of the cmd ``otool -L fidimag/extensions/clib.so `` gives ::
264+
265+ fidimag/extensions/neb_clib.so:
266+ /Users/ww1g11/Softwares/fidimag/local/lib/libfftw3_omp.3.dylib (compatibility version 8.0.0, current version 8.4.0)
267+ /opt/local/lib/libfftw3.3.dylib (compatibility version 8.0.0, current version 8.4.0)
268+ /Users/ww1g11/Softwares/fidimag/local/lib/libsundials_cvodes.2.dylib (compatibility version 2.0.0, current version 2.0.0)
269+ /Users/ww1g11/Softwares/fidimag/local/lib/libsundials_nvecserial.0.dylib (compatibility version 0.0.0, current version 0.0.2)
270+ /Users/ww1g11/Softwares/fidimag/local/lib/libsundials_nvecopenmp.0.dylib (compatibility version 0.0.0, current version 0.0.2)
271+ /opt/local/lib/libgcc/libgomp.1.dylib (compatibility version 2.0.0, current version 2.0.0)
272+ /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
273+ /opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
0 commit comments