From: Su Yue Date: Tue, 10 Sep 2019 07:30:57 +0000 (+0800) Subject: tests: add missing header cmath to test/mon/test_mon_memory_target.cc X-Git-Tag: v15.1.0~1571^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9acfb351a3965c28d390822fd8f2ec5675b29064;p=ceph.git tests: add missing header cmath to test/mon/test_mon_memory_target.cc While building ceph, the complier complains: ================================================================= [ 86%] Building CXX object src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/test_mon_memory_target.cc.o /root/ceph/src/test/mon/test_mon_memory_target.cc: In int main(int, : /root/ceph/src/test/mon/test_mon_memory_target.cc:66:16: was not declared in this scope 66 | auto stdev = sqrt(sump / results.size()); | ^~~~ make[2]: *** [src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/build.make:63: src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/test_mon_memory_target.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:15575: src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 ================================================================= This's caused by lack of header cmath which is required by std::sqrt(). Fix it by add the header then build continues. Fixes: https://tracker.ceph.com/issues/41739 Signed-off-by: Su Yue --- diff --git a/src/test/mon/test_mon_memory_target.cc b/src/test/mon/test_mon_memory_target.cc index da3a86d6517d..e8f975b47bb1 100644 --- a/src/test/mon/test_mon_memory_target.cc +++ b/src/test/mon/test_mon_memory_target.cc @@ -1,4 +1,5 @@ #include +#include #include #include #include