libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

The option 'ENABLE_PYTHON' of libnetconf2 CMakeLists.txt

Open karnyang opened this issue 2 years ago • 1 comments

Hi, I follow the libnetconf2 installation steps, But when I run the python3 backend/, an error 'cannot find netconf2' $ git clone -b devel https://github.com/CESNET/libnetconf2 $ mkdir -p libnetconf2/build && cd libnetconf2/build $ cmake -DENABLE_PYTHON=ON .. This option 'ENABLE_PYTHON' is not available in the CMakeLists.txt. so netconf2 is not compiled. I want to know how to solve it, thanks!

karnyang avatar Mar 16 '23 07:03 karnyang

Where did you find the ENABLE_PYTHON option? If you are simply using from the previous version, the bindings were removed from libnetconf2 a long time ago because they were not maintained and incomplete. All the bindings for our libraries are now separate projects developed by third-parties. It seems that Python bindings for libnetconf2 are pretty much the only bindings that no one cared to implement so it seems there is no demand for them. In summary, it seems they are not available.

michalvasko avatar Mar 16 '23 08:03 michalvasko

Different person, but I can tell you where I found that option, in the build instructions for Netopeer2GUI v2: CESNET/Netopeer2GUI:v2. And judging by the issue https://github.com/CESNET/Netopeer2GUI/issues/26 opened by the same person as this one, they likely found this option in the instructions of that old repository too.

I found the python removal commit, if anyone else is looking to rollback before it: 9be0b29a513f6d34fb7c4bc262701058f6a2f719. The last libnetconf2 version that still has python support appears to be v1.1.48. To build it you will also need libyang v1.0.253 with -DGEN_LANGUAGE_BINDINGS=on, for which you will need libpcre-dev (yes, the first one, easier to build yourself since its no longer shipped to some distros) and swig. I also had to do some slight tweaking of the cmake-generated install script to get it to install correctly, but might be just my version of cmake misbehaving.

I think this should satisfy anyone who's seeking to rebuild the old versions where python bindings were still supported, so probably safe to close this issue - as it is not relevant to modern libnetconf2?

SmiVan avatar Jun 18 '24 15:06 SmiVan

Yes, netopeer2GUI is obviously not supported for several years while the development of libnetconf2 and the other libraries continues.

michalvasko avatar Jun 19 '24 05:06 michalvasko