dmakarov / p4ls Goto Github PK
View Code? Open in Web Editor NEWLSP server for P4 language
License: MIT License
LSP server for P4 language
License: MIT License
I am not able to compile with the scripts used in the CICD pipelines and also not with the homebrew setup mentioned in the README.
I also tried using gcc-9 with g++-9, but that didnt work either.
Output from the compile step:
-- [hunter] ZLIB_ROOT: /home/p4/.hunter/_Base/c2296fd/278e076/5022c31/Install (ver.: 1.2.11-p1) CMake Error at /home/p4/.hunter/_Base/c2296fd/278e076/5022c31/Install/lib/cmake/ZLIB/ZLIBConfig.cmake:36 (add_library): add_library cannot create ALIAS target "ZLIB::ZLIB" because target "ZLIB::zlib" is IMPORTED.
Hi !
Tried to compile p4ls
on Debian 11 (bullseye) and it failed at lining process.
I had to install beforehand all boost pacakge and rapidjson: (and maybe other i forgot)
sudo apt -y install libboost-all-dev rapidjson-dev
I also had to remove all occurence of -Werror
in build.ninja
otherwise it stopped at dispatcher.cpp.o
compilation.
(Warnings considered as error ...)
Build succeeds but fails at linking process. Here is CMakeError.log
:
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/floui/p4ls/build/ninja/release/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_dfb29 && [1/2] Building C object CMakeFiles/cmTC_dfb29.dir/src.c.o
[2/2] Linking C executable cmTC_dfb29
FAILED: cmTC_dfb29
: && /usr/bin/cc -Wno-error -DCMAKE_HAVE_LIBC_PTHREAD CMakeFiles/cmTC_dfb29.dir/src.c.o -o cmTC_dfb29 && :
/usr/bin/ld: CMakeFiles/cmTC_dfb29.dir/src.c.o: in function `main':
src.c:(.text+0x2f): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x3b): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x47): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x58): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/floui/p4ls/build/ninja/release/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_fae13 && [1/2] Building C object CMakeFiles/cmTC_fae13.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_fae13
FAILED: cmTC_fae13
: && /usr/bin/cc -Wno-error -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_fae13.dir/CheckFunctionExists.c.o -o cmTC_fae13 -lpthreads && :
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Any idea on how to solved this ?
I tred to use my favorite search engine and all resources afferent to CMake and pthreads but no luck.
Thanks for your help !
Frederic
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.