kphp
kphp copied to clipboard
Compiling KPHP from source always fails
Trying to install KPHP from source on a Ubuntu 20.04 where PHP 8.2 is installed is not possible:
# sudo su -
# echo 'deb [arch=amd64] https://artifactory-external.vkpartner.ru/artifactory/kphp focal main' | tee /etc/apt/sources.list.d/vkpartner.list
# apt-get update
# apt install git cmake make g++ gperf python3-minimal python3-jsonschema curl-kphp-vk libuber-h3-dev kphp-timelib libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php8.2-dev libmysqlclient-dev libnuma-dev postgresql postgresql-server-dev-all libpq-dev libldap-dev libkrb5-dev
# git clone https://github.com/VKCOM/kphp.git
# cd kphp
# mkdir build
# cd build
# cmake .. -DDOWNLOAD_MISSING_LIBRARIES=On -DKPHP_TESTS=Off
... (left out for brevity) ...
# make -j$(nproc)
... (left out for brevity) ...
[ 99%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/termformat/termformat.cpp.o
[ 99%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/tl2php/combinator-to-php.cpp.o
[ 99%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/tl2php/constructor-to-php.cpp.o
[100%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/tl2php/function-to-php.cpp.o
[100%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/tl2php/php-classes.cpp.o
[100%] Building CXX object CMakeFiles/kphp2cpp_src.dir/common/tl2php/tl-to-php-classes-converter.cpp.o
[100%] Building CXX object CMakeFiles/kphp2cpp_src.dir/objs/generated/auto/compiler/rewrite-rules/early_opt.cpp.o
[100%] Built target kphp2cpp_src
Scanning dependencies of target kphp2cpp
[100%] Building CXX object CMakeFiles/kphp2cpp.dir/compiler/kphp2cpp.cpp.o
[100%] Linking CXX executable ../objs/bin/kphp2cpp
/usr/bin/ld: /usr/bin/ld: DWARF error: can't find .debug_ranges section.
/usr/lib/libfmt.a(format.cc.o): in function `fmt::v7::basic_memory_buffer<wchar_t, 500ul, std::allocator<wchar_t> >::grow(unsigned long)':
format.cc:(.text._ZN3fmt2v719basic_memory_bufferIwLm500ESaIwEE4growEm[_ZN3fmt2v719basic_memory_bufferIwLm500ESaIwEE4growEm]+0x87): undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: /usr/lib/libfmt.a(format.cc.o): in function `fmt::v7::basic_memory_buffer<unsigned int, 32ul, std::allocator<unsigned int> >::grow(unsigned long)':
format.cc:(.text._ZN3fmt2v719basic_memory_bufferIjLm32ESaIjEE4growEm[_ZN3fmt2v719basic_memory_bufferIjLm32ESaIjEE4growEm]+0x87): undefined reference to `std::__throw_bad_array_new_length()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/kphp2cpp.dir/build.make:508: ../objs/bin/kphp2cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:787: CMakeFiles/kphp2cpp.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
I also tried with same build with php7.4-dev installed and that gives the same result ???
Please help !