Lightgbm: Touble in calling lib_lightgbm.so

Created on 17 Jul 2017  路  11Comments  路  Source: microsoft/LightGBM

Please search your question on previous issues, stackoverflow or other search engines before you open a new one.

For bugs and unexpected issues, please provide following information, so that we could reproduce on our system.

Environment info

Operating System:CentOS release 6.3 (Final)
CPU:Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
C++/Python/R version:C++
GCC:4.8.2

Error Message:

OSError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./lib_lightgbm.so)

Reproducible examples

Steps to reproduce

1.
2.
3.

Hi, guolinke,
Thanks for sharing your code, I came into some trouble using lib_lightgbm.so in python calling c_api. In the Installation guide, it needs glibc >=2.14銆侭ut my server cannot using it cause it cannot connect to the internet. How can I rebuild the lib_lightgbm.so by staticly linking libstdc++ instead of installing glibc2.14?

Most helpful comment

I recompile my python by gcc 4.8.2, and I can use it now.

All 11 comments

@MenglaiWang How do you install LightGBM ? by pip install lightgbm ?

I think you need to compile the cpp code in your machine, by using pip install --no-binary :all: lightgbm

I compile the C++ code , and in the root dir, there is a lib_lightgbm.so.

I try to use the .so , and then got the error

The .so file is compiled by the machine you are running with ?

Yes, so I don't know why I cant use the .so file

@MenglaiWang

It is a very strange thing that you can compile it but cannot run it.

You can try to add following after this line: https://github.com/Microsoft/LightGBM/blob/master/CMakeLists.txt#L57

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")

However, -stdlib=libc++ seems is enabled by default. And it seems the libc++ rely on the glibc, not sure can it works or not.

OK锛孖 will try It馃榿

it's a glib issue, please upgrade your GCC.

you can refer to :https://github.com/Microsoft/CNTK/issues/729

I recompile my python by gcc 4.8.2, and I can use it now.

Sorry, but I'm confused. How to recompile python code. I met exactly the same problem as yours.

@HuaGuo1992 Try this

Was this page helpful?
0 / 5 - 0 ratings