[P4-dev] p4c CMake Failed

Andy Fingerhut andy.fingerhut at gmail.com
Mon Dec 24 18:50:02 EST 2018


I have used the bash script that Hemant linked to with many kernel versions
released for Ubuntu 16.04 and Ubuntu 18.04, and have never had trouble
because of the Linux kernel version installed.  I tend to update to the
most recently release Ubuntu Linux kernel versions as the "Software
Updater" program suggests, as they are released.

Andy

On Mon, Dec 24, 2018 at 3:17 PM <hemant at mnkcg.com> wrote:

> Xiaoban,
>
>
>
> If possible, I would cleanup your disk and use Andy’s script below to
> install all software related to p4c and the behavioral model (bmv2).  The
> behavior-model is also needed because a few hundred p4c tests need bmv2
> installed on the machine.
>
>
>
>
> https://github.com/jafingerhut/p4-guide/blob/master/bin/install-p4dev.sh#L67
>
>
>
> I and my colleague have used Andy’s script and it works like a charm.  My
> colleague uses Ubuntu 16.04 and I use 18.04.  A kernel such as yours in
> 4.15xxx should be fine.
>
>
>
> Hemant
>
>
>
> *From:* P4-dev <p4-dev-bounces at lists.p4.org> *On Behalf Of *Wu, Xiaoban
> *Sent:* Monday, December 24, 2018 6:06 PM
> *To:* p4-dev at lists.p4.org
> *Subject:* [P4-dev] p4c CMake Failed
>
>
>
> Dear All,
>
>
>
> I am trying to install p4c on ubuntu 16.04.1 with
> kernel 4.15.0-36-generic. However, I could not get a success after many
> trials. Can anyone please help me point out the possible issue? Thanks very
> much.
>
>
>
> Alternative approach, could anyone tell me your OS and kernel version that
> works for you, then I will try to follow your setup? Thanks very much.
>
>
>
> Best wishes,
>
> Xiaoban
>
>
>
> First, I did "
>
> git clone --recursive https://github.com/p4lang/p4c.git
>
> "
>
>
>
> Second, I did "sudo apt-get install cmake g++ git automake libtool
> libgc-dev bison flex libfl-dev libgmp-dev libboost-dev
> libboost-iostreams-dev libboost-graph-dev llvm pkg-config python
> python-scapy python-ipaddr python-ply tcpdump"
>
>
>
> Third, I did "
>
> $ git clone https://github.com/protocolbuffers/protobuf.git
>
> $ cd protobuf
>
> $ git submodule update --init --recursive
>
>   $ git checkout v3.2.0
>
> $ ./autogen.sh
>
> $ ./configure
>
> $ make
>
> $ make check
>
> $ sudo make install
>
> $ sudo ldconfig # refresh shared library cache.
>
> "
>
>
>
> Fourth, I did "
>
> mkdir build
>
> cd build
>
> cmake ..
>
> "
>
> Then I saw these logs on the screen
>
> "
>
> -- The C compiler identification is GNU 5.4.0
>
> -- The CXX compiler identification is GNU 5.4.0
>
> -- Check for working C compiler: /usr/bin/cc
>
> -- Check for working C compiler: /usr/bin/cc -- works
>
> -- Detecting C compiler ABI info
>
> -- Detecting C compiler ABI info - done
>
> -- Detecting C compile features
>
> -- Detecting C compile features - done
>
> -- Check for working CXX compiler: /usr/bin/c++
>
> -- Check for working CXX compiler: /usr/bin/c++ -- works
>
> -- Detecting CXX compiler ABI info
>
> -- Detecting CXX compiler ABI info - done
>
> -- Detecting CXX compile features
>
> -- Detecting CXX compile features - done
>
> -- Found PythonInterp: /usr/bin/python (found version "2.7.12")
>
> -- Found FLEX: /usr/bin/flex (found version "2.6.0")
>
> -- Found BISON: /usr/bin/bison (found suitable version "3.0.4", minimum
> required is "3.0.2")
>
> -- Looking for pthread.h
>
> -- Looking for pthread.h - found
>
> -- Looking for pthread_create
>
> -- Looking for pthread_create - not found
>
> -- Looking for pthread_create in pthreads
>
> -- Looking for pthread_create in pthreads - not found
>
> -- Looking for pthread_create in pthread
>
> -- Looking for pthread_create in pthread - found
>
> -- Found Threads: TRUE
>
> -- Found Protobuf: /usr/local/lib/libprotobuf.a (Required is at least
> version "3.0.0")
>
> -- Boost version: 1.58.0
>
> -- Found the following Boost libraries:
>
> --   iostreams
>
> --   regex
>
> -- Found LibGc: /usr/lib/x86_64-linux-gnu/libgccpp.so (found suitable
> version "7.4.2", minimum required is "7.2.0")
>
> -- Found LibGmp: /usr/lib/x86_64-linux-gnu/libgmpxx.so
>
> -- Looking for clock_gettime in rt
>
> -- Looking for clock_gettime in rt - found
>
> -- Looking for execinfo.h
>
> -- Looking for execinfo.h - found
>
> -- Looking for ucontext.h
>
> -- Looking for ucontext.h - found
>
> -- Looking for C++ include cxxabi.h
>
> -- Looking for C++ include cxxabi.h - found
>
> -- Looking for memchr
>
> -- Looking for memchr - found
>
> -- Looking for pipe2
>
> -- Looking for pipe2 - found
>
> -- Looking for GC_print_stats
>
> -- Looking for GC_print_stats - found
>
> -- Found PY_difflib: /usr/lib/python2.7/difflib.pyc
>
> -- Found PY_shutil: /usr/lib/python2.7/shutil.pyc
>
> -- Found PY_tempfile: /usr/lib/python2.7/tempfile.pyc
>
> -- Found PY_subprocess: /usr/lib/python2.7/subprocess.pyc
>
> -- Found PY_re: /usr/lib/python2.7/re.pyc
>
> -- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
>
> -- Program 'simple_switch_CLI' (
> https://github.com/p4lang/behavioral-model.git) not found;
>
> Searched .
>
> Will not run BMv2 tests. (missing:  SIMPLE_SWITCH SIMPLE_SWITCH_CLI)
>
> -- Program 'psa_switch_CLI' (
> https://github.com/p4lang/behavioral-model.git) not found;
>
> Searched .
>
> Will not run PSA BMv2 tests. (missing:  PSA_SWITCH PSA_SWITCH_CLI)
>
> -- Performing Test _HAVE_OPTION_Wall_
>
> -- Performing Test _HAVE_OPTION_Wall_ - Success
>
> -- Performing Test _HAVE_OPTION_Wextra_
>
> -- Performing Test _HAVE_OPTION_Wextra_ - Success
>
> -- Performing Test _HAVE_OPTION_Wnooverloadedvirtual_
>
> -- Performing Test _HAVE_OPTION_Wnooverloadedvirtual_ - Success
>
> -- Performing Test _HAVE_OPTION_Wnodeprecated_
>
> -- Performing Test _HAVE_OPTION_Wnodeprecated_ - Success
>
> -- Using the GNU gold linker.
>
> -- Available extensions
>
> CMake Warning at backends/bmv2/CMakeLists.txt:174 (MESSAGE):
>
>   BMv2 simple switch is not available, not adding v1model BMv2 tests
>
>
>
>
>
> CMake Warning at backends/bmv2/CMakeLists.txt:180 (MESSAGE):
>
>   BMv2 PSA switch is not available, not adding PSA BMv2 tests
>
>
>
>
>
> CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:178 (include):
>
>   include could not find load file:
>
>
>
>     /usr/share/llvm/cmake/LLVMExports.cmake
>
> Call Stack (most recent call first):
>
>   backends/ebpf/CMakeLists.txt:111 (find_package)
>
>
>
>
>
> CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include):
>
>   include could not find load file:
>
>
>
>     /usr/share/llvm/cmake/LLVM-Config.cmake
>
> Call Stack (most recent call first):
>
>   backends/ebpf/CMakeLists.txt:111 (find_package)
>
>
>
>
>
> -- Found LLVM 3.8.0
>
> -- Added 14 tests to 'ebpf-kernel' (0 xfails)
>
> -- Added 14 tests to 'ebpf-bcc' (0 xfails)
>
> -- Added 14 tests to 'ebpf' (0 xfails)
>
> -- Added 159 tests to 'p4' (0 xfails)
>
> -- Added 478 tests to 'p4' (1 xfails)
>
> -- Added 198 tests to 'p14_to_16' (0 xfails)
>
> -- CTest parallel: -j 24
>
> -- Configuring incomplete, errors occurred!
>
> See also "/home/acanets/p4c/build/CMakeFiles/CMakeOutput.log".
>
> See also "/home/acanets/p4c/build/CMakeFiles/CMakeError.log".
>
>
>
> "
>
>
>
> Then I checked the CMakeError.log, it says "
>
> Determining if the pthread_create exist failed with the following output:
>
> Change Dir: /home/acanets/p4c/build/CMakeFiles/CMakeTmp
>
>
>
> Run Build Command:"/usr/bin/make" "cmTC_aae04/fast"
>
> /usr/bin/make -f CMakeFiles/cmTC_aae04.dir/build.make
> CMakeFiles/cmTC_aae04.dir/build
>
> make[1]: Entering directory '/home/acanets/p4c/build/CMakeFiles/CMakeTmp'
>
> Building C object CMakeFiles/cmTC_aae04.dir/CheckSymbolExists.c.o
>
> /usr/bin/cc     -o CMakeFiles/cmTC_aae04.dir/CheckSymbolExists.c.o   -c
> /home/acanets/p4c/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
>
> Linking C executable cmTC_aae04
>
> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aae04.dir/link.txt
> --verbose=1
>
> /usr/bin/cc       CMakeFiles/cmTC_aae04.dir/CheckSymbolExists.c.o  -o
> cmTC_aae04 -rdynamic
>
> CMakeFiles/cmTC_aae04.dir/CheckSymbolExists.c.o: In function `main':
>
> CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
>
> collect2: error: ld returned 1 exit status
>
> CMakeFiles/cmTC_aae04.dir/build.make:97: recipe for target 'cmTC_aae04'
> failed
>
> make[1]: *** [cmTC_aae04] Error 1
>
> make[1]: Leaving directory '/home/acanets/p4c/build/CMakeFiles/CMakeTmp'
>
> Makefile:126: recipe for target 'cmTC_aae04/fast' failed
>
> make: *** [cmTC_aae04/fast] Error 2
>
>
>
> File /home/acanets/p4c/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>
> /* */
>
> #include <pthread.h>
>
>
>
> int main(int argc, char** argv)
>
> {
>
>   (void)argv;
>
> #ifndef pthread_create
>
>   return ((int*)(&pthread_create))[argc];
>
> #else
>
>   (void)argc;
>
>   return 0;
>
> #endif
>
> }
>
>
>
> Determining if the function pthread_create exists in the pthreads failed
> with the following output:
>
> Change Dir: /home/acanets/p4c/build/CMakeFiles/CMakeTmp
>
>
>
> Run Build Command:"/usr/bin/make" "cmTC_3db6b/fast"
>
> /usr/bin/make -f CMakeFiles/cmTC_3db6b.dir/build.make
> CMakeFiles/cmTC_3db6b.dir/build
>
> make[1]: Entering directory '/home/acanets/p4c/build/CMakeFiles/CMakeTmp'
>
> Building C object CMakeFiles/cmTC_3db6b.dir/CheckFunctionExists.c.o
>
> /usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o
> CMakeFiles/cmTC_3db6b.dir/CheckFunctionExists.c.o   -c
> /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
>
> Linking C executable cmTC_3db6b
>
> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3db6b.dir/link.txt
> --verbose=1
>
> /usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create
> CMakeFiles/cmTC_3db6b.dir/CheckFunctionExists.c.o  -o cmTC_3db6b
> -rdynamic -lpthreads
>
> /usr/bin/ld: cannot find -lpthreads
>
> collect2: error: ld returned 1 exit status
>
> CMakeFiles/cmTC_3db6b.dir/build.make:97: recipe for target 'cmTC_3db6b'
> failed
>
> make[1]: *** [cmTC_3db6b] Error 1
>
> make[1]: Leaving directory '/home/acanets/p4c/build/CMakeFiles/CMakeTmp'
>
> Makefile:126: recipe for target 'cmTC_3db6b/fast' failed
>
> make: *** [cmTC_3db6b/fast] Error 2
>
>
>
> "
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20181224/585202a7/attachment-0001.html>


More information about the P4-dev mailing list