Skip to content

Commit 0eaa796

Browse files
jktjktmichalvasko
authored andcommitted
Python: fix installation with non-standard include path target of libyang
When installed outside of default `/usr` prefix, the build fails because `setup.py` does not respect CMake's library locations. I have no idea whether it respects non-standard compilers etc, but this one was an issue that I hit: ``` x86_64-pc-linux-gnu-gcc -pthread -fPIC -I/home/jkt/temp/py-3.6/include -I/usr/include/python3.6m -c /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libnetconf2/python/netconf.c -o /home/jkt/work/prog/_build/libnetconf2/GCC_8_1_NETCONF-Debug/python/build/temp.linux-x86_64-3.6/home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libnetconf2/python/netconf.o -Wall -I/home/jkt/work/prog/_build/libnetconf2/GCC_8_1_NETCONF-Debug/python-I/opt/nc/include -DNC_ENABLED_SSH -DNC_ENABLED_TLS In file included from /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libnetconf2/python/netconf.h:25, from /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libnetconf2/python/netconf.c:21: /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libnetconf2/python/../src/session_client.h:22:10: fatal error: libyang/libyang.h: No such file or directory #include <libyang/libyang.h> ^~~~~~~~~~~~~~~~~~~ ``` The end result requires a `LD_LIBRARY_PATH` override because RPATH information is getting lost as well, but hey, this is an improvement. It would have been nice if all CMake settings were respected, but that's outside of my experience.
1 parent 3097682 commit 0eaa796

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/setup.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ netconf2Module = Extension("netconf2",
1313
"${CMAKE_CURRENT_COURCE_DIR}/rpc.h"
1414
],
1515
libraries=["netconf2"],
16-
extra_compile_args=["-Wall", "-I${CMAKE_CURRENT_BINARY_DIR}" @SSH_DEFINE@ @TLS_DEFINE@],
16+
extra_compile_args=["-Wall", "-I${CMAKE_CURRENT_BINARY_DIR}", "-I${LIBYANG_INCLUDE_DIR}" @SSH_DEFINE@ @TLS_DEFINE@],
1717
extra_link_args=["-L${CMAKE_CURRENT_BINARY_DIR}/.."],
1818
)
1919

0 commit comments

Comments
 (0)