Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p4-fusion fails to build on Debian via WSL #85

Open
KiaArmani opened this issue Sep 16, 2024 · 1 comment
Open

p4-fusion fails to build on Debian via WSL #85

KiaArmani opened this issue Sep 16, 2024 · 1 comment

Comments

@KiaArmani
Copy link

KiaArmani commented Sep 16, 2024

I am currently trying to build p4-fusion using the instructions given in the README.md.

I have installed the specified versions of the required libraries as well as the latest mentioned supported version of the P4 API.

Unfortunately, I am getting errors that suggest that zlib libraries are missing which I have compiled & installed, but the error persists.

Here my output. Any help is appreciated!

OpenSSL 1.0.2t  10 Sep 2019
kia@BARRY:~/p4-fusion-1.13$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
kia@BARRY:~/p4-fusion-1.13$ cmake --version
cmake version 3.22.1
kia@BARRY:~/p4-fusion-1.13$ ./generate_cache.sh Release
mkdir: cannot create directory ‘build’: File exists
Using CMake arguments: \n-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF -DBUILD_EXAMPLES=OFF -DUSE_BUNDLED_ZLIB=ON -DREGEX_BACKEND=builtin -DTHREADSAFE=ON -DUSE_SSH=OFF -DUSE_HTTPS=OFF -DUSE_THREADS=ON -DOPENSSL_ROOT_DIR=/usr/local/ssl -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DBUILD_TESTS=OFF -DMTR_ENABLED=OFF
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at vendor/libgit2/CMakeLists.txt:16 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Success
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_NSEC
-- Performing Test HAVE_STRUCT_STAT_NSEC - Success
-- Looking for futimens
-- Looking for futimens - found
-- Performing Test IS_WALL_SUPPORTED
-- Performing Test IS_WALL_SUPPORTED - Success
-- Performing Test IS_WEXTRA_SUPPORTED
-- Performing Test IS_WEXTRA_SUPPORTED - Success
-- Performing Test IS_WDOCUMENTATION_SUPPORTED
-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED - Success
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED - Success
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED - Success
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED - Success
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED - Success
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED - Success
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED - Success
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED - Success
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WINT_CONVERSION_SUPPORTED
-- Performing Test IS_WINT_CONVERSION_SUPPORTED - Success
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED - Failed
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SUPPORTED
-- Performing Test IS_WFORMAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED - Success
-- Checking prototype qsort_r for GIT_QSORT_R_BSD
-- Checking prototype qsort_r for GIT_QSORT_R_BSD - False
-- Checking prototype qsort_r for GIT_QSORT_R_GNU
-- Checking prototype qsort_r for GIT_QSORT_R_GNU - True
-- Looking for qsort_s
-- Looking for qsort_s - not found
-- Looking for getentropy
-- Looking for getentropy - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Found OpenSSL: /usr/local/ssl/lib/libcrypto.a (found version "1.0.2t")
-- http-parser version 2 was not found or disabled; using bundled 3rd-party sources.
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED - Success
-- Could NOT find PCRE (missing: PCRE_LIBRARY PCRE_POSIX_LIBRARY PCRE_INCLUDE_DIR)
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoq
-- Looking for strtoq - found
-- Looking for _strtoi64
-- Looking for _strtoi64 - not found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED - Success
-- LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIR)
-- Enabled features:
 * nanoseconds, support nanosecond precision file mtimes and ctimes
 * futimens, futimens support
 * threadsafe, threadsafe support
 * SHA, using CollisionDetection
 * http-parser, http-parser support (bundled)
 * regex, using bundled PCRE
 * zlib, using bundled zlib

-- Disabled features:
 * debugpool, debug pool allocator
 * debugalloc, debug strict allocators
 * debugopen, path validation in open
 * HTTPS
 * SSH, SSH transport support
 * ntlmclient, NTLM authentication support for Unix
 * SPNEGO, SPNEGO authentication support
 * iconv, iconv encoding conversion support

/usr/local/ssl/lib/libssl.adl
/usr/local/ssl/lib/libcrypto.adl
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    THREADSAFE


-- Build files have been written to: /home/kia/p4-fusion-1.13/build
kia@BARRY:~/p4-fusion-1.13$ ./build.sh
Consolidate compiler generated dependencies of target http-parser
Consolidate compiler generated dependencies of target minitrace
Consolidate compiler generated dependencies of target zlib
Consolidate compiler generated dependencies of target pcre
[  0%] Built target http-parser
[  1%] Built target minitrace
[  5%] Built target zlib
[ 15%] Built target pcre
Consolidate compiler generated dependencies of target git2internal
[ 89%] Built target git2internal
[ 89%] Built target git2
Consolidate compiler generated dependencies of target p4-fusion
[ 90%] Linking CXX executable p4-fusion
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libp4script.a(dmextensiondata.o): in function `ExtensionData::Unzip(StrBuf const&, std::optional<StrBuf>, std::optional<StrBuf>, Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:715: undefined reference to `unzOpen64'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:727: undefined reference to `unzGetGlobalInfo'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:743: undefined reference to `unzGetCurrentFileInfo'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:752: undefined reference to `unzClose'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:794: undefined reference to `unzOpenCurrentFile'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:816: undefined reference to `unzReadCurrentFile'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:863: undefined reference to `unzCloseCurrentFile'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:871: undefined reference to `unzGoToNextFile'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:876: undefined reference to `unzClose'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:721: undefined reference to `unzClose'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:823: undefined reference to `unzCloseCurrentFile'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:824: undefined reference to `unzClose'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:882: undefined reference to `unzClose'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:799: undefined reference to `unzClose'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libp4script.a(dmextensiondata.o): in function `ExtensionData::LoadManifest(Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:504: undefined reference to `WeakUUID::WeakUUID()'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:504: undefined reference to `BaseUUID::Parse(StrBuf const&)'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:504: undefined reference to `WeakUUID::~WeakUUID()'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmextensiondata.cc:504: undefined reference to `WeakUUID::~WeakUUID()'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libp4script.a(dmetypes.o): in function `DmtExtName::ParseExt(StrPtr const&, DmtExtType, Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmetypes.cc:35: undefined reference to `MsgServer2::InvalidExtName'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/dme/dmetypes.cc:108: undefined reference to `MsgServer2::InvalidExtName'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libp4script.a(p4script53.o): in function `p4script::impl53::doBindings()':
/tmp/167398305/depot/r22.1/p4-bin/../p4/script/p4script53.cc:681: undefined reference to `luaopen_lsqlite3(p4lua53_lua_State*)'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/script/p4script53.cc:683: undefined reference to `luaopen_lcurl(p4lua53_lua_State*)'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/script/p4script53.cc:684: undefined reference to `luaopen_lcurl_safe(p4lua53_lua_State*)'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libclient.a(p4libs.o): in function `P4Libraries::Initialize(int, Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/client/p4libs.cc:124: undefined reference to `sqlite3_initialize'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libclient.a(p4libs.o): in function `P4Libraries::Shutdown(int, Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/client/p4libs.cc:175: undefined reference to `sqlite3_shutdown'
/usr/bin/ld: /tmp/167398305/depot/r22.1/p4-bin/../p4/client/p4libs.cc:178: undefined reference to `curl_global_cleanup'
/usr/bin/ld: /home/kia/p4-fusion-1.13/p4-fusion/../vendor/helix-core-api/linux/lib/libclient.a(p4libs.o): in function `P4Libraries::Initialize(int, Error*)':
/tmp/167398305/depot/r22.1/p4-bin/../p4/client/p4libs.cc:128: undefined reference to `curl_global_init_mem'
collect2: error: ld returned 1 exit status
gmake[2]: *** [p4-fusion/CMakeFiles/p4-fusion.dir/build.make:470: p4-fusion/p4-fusion] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:379: p4-fusion/CMakeFiles/p4-fusion.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
@JoshHarmon
Copy link

Take a look at #79 (which relates to a discussion that happened in #78).

The gist is "you should be able to use a 2023.1 or newer P4API and link against p4script_cstub instead of the other stuff, which should alleviate many problems with transitive dependencies that aren't actually needed for p4-fusion."

I know the README doesn't mention this; I think it's fair to say the README is (and will continue to be) out of date until someone takes the time to properly update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants