0

While running python make_dataset in the quick start example for Pylearn2, I've run across an import error in a Theano .so file. The heart of the issue seems to be this: undefined symbol: _gfortran_st_write. I'm running development versions of numpy, scipy, Theano, and Pylearn2. Any ideas?

Traceback (most recent call last):
  File "make_dataset.py", line 58, in <module>
    train.apply_preprocessor(preprocessor=pipeline, can_fit=True)
  File "/home/mmay/Downloads/Installs/pylearn2/pylearn2/datasets/dense_design_matrix.py", line 710, in apply_preprocessor
    preprocessor.apply(self, can_fit)
  File "/home/mmay/Downloads/Installs/pylearn2/pylearn2/datasets/preprocessing.py", line 175, in apply
    item.apply(dataset, can_fit)
  File "/home/mmay/Downloads/Installs/pylearn2/pylearn2/datasets/preprocessing.py", line 1424, in apply
    new_x_symbol)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function.py", line 223, in function
    profile=profile)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/pfunc.py", line 511, in pfunc
    on_unused_input=on_unused_input)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1332, in orig_function
    defaults)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1198, in create
    _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/link.py", line 489, in make_thunk
    output_storage=output_storage)[:3]
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/vm.py", line 881, in make_all
    no_recycling))
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/op.py", line 618, in make_thunk
    output_storage=node_output_storage)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 987, in make_thunk
    keep_lock=keep_lock)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 930, in __compile__
    keep_lock=keep_lock)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1367, in cthunk_factory
    key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cmodule.py", line 1005, in module_from_key
    module = next(compile_steps)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1282, in compile_cmodule_by_step
    preargs=preargs)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cmodule.py", line 1993, in compile_str
    return dlimport(lib_filename)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cmodule.py", line 290, in dlimport
    rval = __import__(module_name, {}, {}, [module_name])
ImportError: ('The following error happened while compiling the node', Dot22(Elemwise{sub,no_inplace}.0, P_), '\n', '/home/mmay/.theano/compiledir_Linux-3.2.0-63-generic-x86_64-with-elementary_OS-0.2-luna-x86_64-2.7.3-64/tmpFGIAyD/0e96d34cc789a5edba0ae9e735b21a70.so: 
undefined symbol: _gfortran_st_write', '[Dot22(<TensorType(float32, matrix)>, P_)]')
Madison May
  • 2,723
  • 3
  • 22
  • 32
  • Do you have libgfortran3 installed? Seems like it's trying to link with some kind of other library that doesn't exist on your system or installation. (I find it unlikely that you'd have to have gfortran installed for this, but it's worth a check/try.) – Derek Redfern Jul 02 '14 at 20:28
  • Actually, this looks like a pretty good similar question to follow: http://stackoverflow.com/questions/11987325/theano-fails-due-to-numpy-fortran-mixup-under-ubuntu – Derek Redfern Jul 02 '14 at 20:30
  • Thanks, I'll check it out! Also, hello there Derek. – Madison May Jul 02 '14 at 20:31
  • Aaaaand the relevant recommendations from the Theano install guide (search for gfortran): https://github.com/Theano/Theano/blob/master/doc/install_ubuntu.txt – Derek Redfern Jul 02 '14 at 20:31
  • Oh crap I didn't even look at who was asking. That's weird. Small world. – Derek Redfern Jul 02 '14 at 20:32
  • Yeah, don't know how I didn't run across that line in the Theano docs. Thanks! – Madison May Jul 02 '14 at 20:33

1 Answers1

0

The problem was resolved after removing ATLAS, installing OpenBLAS, reinstalling numpy + scipy + theano, and then installing Pylearn2 from source.

See https://github.com/Theano/Theano/blob/master/doc/install_ubuntu.txt#L70 of the Theano install guide for a more detailed explanation.

Madison May
  • 2,723
  • 3
  • 22
  • 32