p4lang / tdi

Table-Driven Interface (TDI) for a P4-programmable backend device.
Apache License 2.0
40 stars 23 forks source link

Standalone build is not working on Fedora 33 #45

Closed det-intel closed 2 years ago

det-intel commented 2 years ago

Using generic Fedora and Ubuntu envs, building TDI as per the last couple of lines of the README fails with a cmake error. This is in part because the submodules need to be initialized and updated (which should be noted with the build notes). But even after that, cmake reports errors like:

` -- Looking for inet_network - found CMake Error at third-party/target-utils/third-party/CMakeLists.txt:45 (add_subdirectory): The source directory

.../tdi/third-party/target-utils/third-party/cJSON

does not contain a CMakeLists.txt file.

`

and ` CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: EXPAT_LIB linked by target "clish" in directory .../tdi/third-party/target-utils/third-party/klish LIBEDIT_LIBRARIES (ADVANCED) linked by target "clish" in directory .../tdi/third-party/target-utils/third-party/klish

-- Configuring incomplete, errors occurred!

`

Glancing at the CMakeFiles/CMakeErrors.log, maybe it's just some prereq packages that need to be installed? pcap.h, floor, pow, sqrt are mentioned as undefined.

det-intel commented 2 years ago

Looks like pilot error in not getting all the submodules properly cloned. Probably worth a note in the README for that.

det-intel commented 2 years ago

Oops, still hitting two issues. First, I needed: sudo yum install expat-devel

This is on Fedora 33, by the way.

After that I was still hitting

tdi/third-party/target-utils/third-party/bigcode/include/target-utils/ELS/els.h:36:10: fatal error: editline/readline.h: No such file or directory
   36 | #include <editline/readline.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
saynb commented 2 years ago

Did you install libedit and expat ?

det-intel commented 2 years ago

@saynb : Yes; it would be good to indicate those as prereqs in the readme or some doc. The expat problem was fixed by that, but not the readline problem.

Last note before closing. I couldn't repro the problem on Ubuntu, so will close this since Fedora 33 is no longer supported. Not sure if the problem persists in newer releases.