mgaitan/fortran_magic

Running the Example notebook fails

josephcslater opened this issue · 1 comments

I'm on MacOS X, Jupyter 4.3.0, python 3.6.1 and am getting the following on execution of the fortran cell. I can't figure out what this means or how to fix it.

Things were working on my machine some time ago, but thousands of minor upgrades since I last tried and used it so it's infeasible to figure out what might have broke it.


ImportError Traceback (most recent call last)
in ()
----> 1 get_ipython().run_cell_magic('fortran', '', '\nsubroutine f1(x, y, z)\n real, intent(in) :: x,y\n real, intent(out) :: z\n\n z = sin(x+y)\n\nend subroutine f1')

~/anaconda/lib/python3.6/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2101 magic_arg_s = self.var_expand(line, stack_depth)
2102 with self.builtin_trap:
-> 2103 result = fn(magic_arg_s, cell)
2104 return result
2105

in fortran(self, line, cell)

~/anaconda/lib/python3.6/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

~/Documents/python-dev/fortran_magic/fortranmagic.py in fortran(self, line, cell)
368
369 self._code_cache[key] = module_name
--> 370 module = imp.load_dynamic(module_name, module_path)
371 self._import_all(module, verbosity=args.verbosity)
372

~/anaconda/lib/python3.6/imp.py in load_dynamic(name, path, file)
340 spec = importlib.machinery.ModuleSpec(
341 name=name, loader=loader, origin=path)
--> 342 return _load(spec)
343
344 else:

~/anaconda/lib/python3.6/importlib/_bootstrap.py in _load(spec)

~/anaconda/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda/lib/python3.6/importlib/_bootstrap.py in module_from_spec(spec)

~/anaconda/lib/python3.6/importlib/_bootstrap_external.py in create_module(self, spec)

~/anaconda/lib/python3.6/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

ImportError: dlopen(/Users/jslater/.ipython/fortran/_fortran_magic_c5e7e14a004b240d5916d25afb069a7a.cpython-36m-darwin.so, 2): Symbol not found: ___addtf3
Referenced from: /Users/jslater/anaconda/lib/./libquadmath.0.dylib
Expected in: /usr/local/lib/libgcc_s.1.dylib
in /Users/jslater/anaconda/lib/./libquadmath.0.dylib

This appears to be a problem that has happened a few times with gfortran installations on MacOS X. Replacing libgcc_s.1.dylib with one built by macports resolved the issue.