Ubuntu 22.04.1 LTS (Jammy Jellyfish) version when i am installing drachtio_version:v0.8.22 i am getting error related to prometheus
Closed this issue · 2 comments
On ubuntu 22.04.1 LTS (Jammy Jellyfish) version when i am installing drachtio_version:v0.8.22 i am getting below error:
cd ../deps/prometheus-cpp && mkdir -p build && cd build &&
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=pwd
&&
make && make install
-- Found GoogleBenchmark: /usr/lib/x86_64-linux-gnu/libbenchmark.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/drachtio-server/deps/prometheus-cpp/build
make[1]: Entering directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make[2]: Entering directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make[3]: Entering directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
Consolidate compiler generated dependencies of target core
make[3]: Leaving directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make[3]: Entering directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
[ 2%] Building CXX object core/CMakeFiles/core.dir/src/histogram.cc.o
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc: In member function ‘prometheus::ClientMetric prometheus::Histogram::Collect() const’:
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:36:38: error: ‘numeric_limits’ is not a member of ‘std’
36 | ? std::numeric_limits::infinity()
| ^~~~~~~~~~~~~~
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:36:53: error: expected primary-expression before ‘double’
36 | ? std::numeric_limits::infinity()
| ^~~~~~
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:36:53: error: expected ‘:’ before ‘double’
36 | ? std::numeric_limits::infinity()
| ^~~~~~
| :
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:36:53: error: expected primary-expression before ‘double’
36 | ? std::numeric_limits::infinity()
| ^~~~~~
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:36:53: error: expected ‘)’ before ‘double’
36 | ? std::numeric_limits::infinity()
| ^~~~~~
| )
/usr/local/src/drachtio-server/deps/prometheus-cpp/core/src/histogram.cc:35:26: note: to match this ‘(’
35 | bucket.upper_bound = (i == bucket_boundaries_.size()
| ^
make[3]: *** [core/CMakeFiles/core.dir/build.make:216: core/CMakeFiles/core.dir/src/histogram.cc.o] Error 1
make[3]: Leaving directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make[2]: *** [CMakeFiles/Makefile2:262: core/CMakeFiles/core.dir/all] Error 2
make[2]: Leaving directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make[1]: *** [Makefile:146: all] Error 2
make[1]: Leaving directory '/usr/local/src/drachtio-server/deps/prometheus-cpp/build'
make: *** [Makefile:1540: ../deps/prometheus-cpp/build/lib/libprometheus-cpp-core.a] Error 2
Its seems that g++ & gcc version are 11 on ubuntu 22.04 and on debian the version is old its 10.
And Binutils version on new server is 2.38 and on debian the version is old its 2.35.2
Can you please make it work on ubuntu latest version 22.04.1 LTS if possible.
This issue is that in latest g++ compiler, the limits header file is not added to the cpp file above. this issue error in prometheus-cpp and it's fixed in prometheus-cpp latest version.
This require to upgrade drachtio server to use latest version of prometheus-cpp, it might require more effort from me. To unlock you now, here is step:
1/ / open drachtio-server/deps/prometheus-cpp/core/src/histogram.cc
2/ add below line to it.
#include <limits>
3/ build it again.
@xquanluu thanks its working fine....