masashi-y / depccg

A* CCG Parser with a Supertag and Dependency Factored Model
MIT License
93 stars 28 forks source link

undefined symbol: _ZSt24__throw_out_of_range_fmtPKcz #4

Closed pasmargo closed 7 years ago

pasmargo commented 7 years ago

Hello!

I have just installed depccg but I am getting an Import error:

src]$ pwd
/data/pascual/software/depccg/src
src]$ python run.py -h
Traceback (most recent call last):
  File "run.py", line 10, in <module>
    from depccg import PyAStarParser, PyJaAStarParser
ImportError: /data/pascual/software/depccg/src/depccg.so: undefined symbol: _ZSt24__throw_out_of_range_fmtPKcz

I am working on REL 7 (Red Hat) and I installed g++ locally since it was not available in my distribution and I don't have root permissions.

src]$ which g++
/data/pascual/local/bin/g++
src]$ g++ --version
g++ (GCC) 4.9.2

Do you have any advice on how to get past this error?

Thank you very much for making this software available! Best, Pascual

masashi-y commented 7 years ago

Hi! Thank you for being interested in my program.

Through googling '_ZSt24__throw_out_of_range_fmtPKcz', I learned that this is an issue related to g++ version.

https://github.com/conda/conda/issues/4597 https://gitlab.idiap.ch/bob/bob.measure/issues/18 https://github.com/dib-lab/sourmash/issues/26

The last github issue suggests adding to setup.py lines: os.environ["CC"] = "/path/to/compiler/g++" os.environ["CXX"] = "/path/to/compiler/g++"

and running: export LD_LIBRARY_PATH="path/to/compiler/gcc-4.9.2/lib64/:$LD_LIBRARY_PATH"

to specify the expected version of libstdc++ used in running depccg. Could you let me know if these work?

pasmargo commented 7 years ago

Thank you very much for your suggestion!

Following your advice, I added to setup.py:

os.environ["CC"] = "/path/to/compiler/g++"
os.environ["CXX"] = "/path/to/compiler/g++"

and

export LD_LIBRARY_PATH="path/to/compiler/gcc-4.9.2/lib64/:$LD_LIBRARY_PATH"

It still failed with the same error. But I then removed my anaconda installation and created again the virtual environment and finally it worked.

Thank you very much again for your suggestion! I am looking forward to start using depccg!