shadowsocks-libev icon indicating copy to clipboard operation
shadowsocks-libev copied to clipboard

CMake build doesn't install embedded 3rd-party libs.

Open xkszltl opened this issue 3 years ago • 7 comments

What version of shadowsocks-libev are you using?

master

What operating system are you using?

CentOS 7 (this is really not distro related).

What did you do?

Build with cmake+ninja+gcc, and -DWITH_STATIC=OFF because CentOS 7 doesn't ship static version of libev, and then install.

What did you see instead?

Embedded 3rd-party libs are correctly built as build/lib/libipset.so, but they're not installed. Calling things like /usr/local/bin/ss-xxxxx won't work due to missing libs.

A few lines like install(TARGETS ipset-shared LIBRARY DESTINATION lib) in CMakeLists.txt should help.

xkszltl avatar Apr 18 '21 17:04 xkszltl

Why do you find the README wanting? You can just follow the steps provided by the author and build shadowsocks-libev from source.

GinXian avatar Jun 11 '21 06:06 GinXian

@GinXian This is not about building from source, but installation after build. The README instruction is about makefile, not cmake we used here.

xkszltl avatar Jun 11 '21 09:06 xkszltl

@xkszltl The 3rd party libs are installed as intended but the ELF cannot probe it. That may be because ldconfig is absent when the libs are built and installed.

GinXian avatar Jun 11 '21 11:06 GinXian

What do you mean by installed as intended? The embedded libipset isn't installed unless I manually copy it.

As you can see from below, there's simply no install() for libipset target.

  • Search: https://github.com/shadowsocks/shadowsocks-libev/search?l=CMake&q=install
  • Code creating dynamic lib of libipset: https://github.com/shadowsocks/shadowsocks-libev/blob/89b5f987d6a5329de9713704615581d363f0cfed/CMakeLists.txt#L140-L141

xkszltl avatar Jun 11 '21 14:06 xkszltl

Regarding ldconfig, we actually run that intentionally after installation so that's not the issue.

xkszltl avatar Jun 11 '21 14:06 xkszltl

bash ./shadowsocks-libev/rpm/genrpm.sh before ./autogen.sh && ./configure && make It is what I figure out and it's work great .

cibyyang avatar Sep 30 '21 18:09 cibyyang

That's the makefile code path, no cmake.

xkszltl avatar Oct 01 '21 03:10 xkszltl