Coder Social home page Coder Social logo

Unable to build oomd about oomd HOT 6 CLOSED

facebookincubator avatar facebookincubator commented on July 1, 2024
Unable to build oomd

from oomd.

Comments (6)

smita-koralahalli avatar smita-koralahalli commented on July 1, 2024 1

Yes, thank you its been resolved. !!

Lastly I'm getting one linking error now!

The Meson build system
Version: 0.47.2
Source dir: /home/smita/Documents/oomd
Build dir: /home/smita/Documents/oomd/build
Build type: native build
Project name: oomd
Project version: 0.1.0
Native C++ compiler: c++ (gcc 5.4.0 "c++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Native dependency jsoncpp found: YES 1.8.4
Dependency threads found: YES
Dependency GTest found: YES (prebuilt)
Dependency GMock found: YES (prebuilt)
Build targets in project: 10
Found ninja-1.5.1 at /usr/bin/ninja
ninja: Entering directory build' [21/31] Linking target oomd_detector_tests. FAILED: c++ -o oomd_detector_tests 'oomd_detector_tests@exe/OomDetectorTest.cpp.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group liboomd.so /usr/local/lib/x86_64-linux-gnu/libjsoncpp.a -lgtest -lgtest_main -lgmock -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/home/smita/Documents/oomd/build/ oomd_detector_tests@exe/OomDetectorTest.cpp.o: In function __static_initialization_and_destruction_0(int, int)':
/home/smita/Documents/oomd/build/../OomDetectorTest.cpp:41: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void ()(), void ()(), testing::internal::TestFactoryBase*)'
collect2: error: ld returned 1 exit status
[21/31] Compiling C++ object 'oomd_util_tests@exe/util_FsTest.cpp.o'.
ninja: build stopped: subcommand failed.

from oomd.

danobi avatar danobi commented on July 1, 2024

Hi @smita-koralahalli, thanks for the report. Can you try #20 to see if it fixes your issue?

from oomd.

smita-koralahalli avatar smita-koralahalli commented on July 1, 2024

Hi @danobi . It seems the error still exists after the modification in meson.build. Few sample error and warning messages after I get that "compiler and library support error for ISO C++ 2011" are as below:

The Meson build system
Version: 0.47.2
Source dir: /home/smita/Documents/oomd
Build dir: /home/smita/Documents/oomd/build
Build type: native build
Project name: oomd
Project version: 0.1.0
Native C++ compiler: c++ (gcc 5.4.0 "c++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Native dependency jsoncpp found: YES 1.8.4
Dependency threads found: YES
Dependency GTest found: YES (prebuilt)
Dependency GMock found: YES (prebuilt)
Build targets in project: 10
Found ninja-1.5.1 at /usr/bin/ninja
ninja: Entering directory `build'
[6/31] Compiling C++ object 'oomd@sha/OomDetector.cpp.o'.
FAILED: c++ -Ioomd@sha -I. -I.. -I../include -I../shared -I../util -I../ -I../.. -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -O0 -g -fPIC -pthread -MD -MQ 'oomd@sha/OomDetector.cpp.o' -MF 'oomd@sha/OomDetector.cpp.o.d' -o 'oomd@sha/OomDetector.cpp.o' -c ../OomDetector.cpp
In file included from /usr/include/c++/5/chrono:35:0,
from ../../oomd/OomDetector.h:20,
from ../OomDetector.cpp:18:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
^
In file included from ../../oomd/OomDetector.h:26:0,
from ../OomDetector.cpp:18:
../../oomd/shared/OomdContext.h:35:3: warning: identifier ‘noexcept’ is a keyword in C++11 [-Wc++0x-compat]
OomdContext(OomdContext&& other) noexcept;
^
../../oomd/shared/OomdContext.h:65:7: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
std::function<double(const CgroupContext& cgroup_ctx)> getKey = nullptr);
^
In file included from ../../oomd/shared/Tunables.h:24:0,
from ../../oomd/shared/Plugin.h:23,
from ../../oomd/OomDetector.h:27,
from ../OomDetector.cpp:18:
../../oomd/util/Fs.h:40:3: warning: identifier ‘constexpr’ is a keyword in C++11 [-Wc++0x-compat]
static constexpr auto kSubtreeControlFile = "cgroup.subtree_control";
^
In file included from ../../oomd/shared/OomdContext.h:27:0,
from ../../oomd/OomDetector.h:26,
from ../OomDetector.cpp:18:
../../oomd/include/Types.h:24:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11
enum struct OomType {
^
../../oomd/include/Types.h:39:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
OomType type{OomType::NONE};
^
../../oomd/include/Types.h:39:15: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
OomType type{OomType::NONE};
^
../../oomd/include/Types.h:39:16: error: ‘OomType’ is not a class or namespace
OomType type{OomType::NONE};
^
../../oomd/include/Types.h:39:29: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
OomType type{OomType::NONE};
^
../../oomd/include/Types.h:39:29: error: cannot convert ‘’ to ‘Oomd::OomType’ in initialization
../../oomd/include/Types.h:44:17: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
float sec_10{0};
^
../../oomd/include/Types.h:45:17: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
float sec_60{0};
^
../../oomd/include/Types.h:46:18: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
float sec_600{0};
^
../../oomd/include/Types.h:44:15: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_10{0};
^
../../oomd/include/Types.h:44:17: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_10{0};
^
../../oomd/include/Types.h:45:15: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_60{0};
^
../../oomd/include/Types.h:45:17: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_60{0};
^
../../oomd/include/Types.h:46:16: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_600{0};
^
../../oomd/include/Types.h:46:18: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
float sec_600{0};
^
../../oomd/include/Types.h:52:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int64_t current_usage{0};
^
../../oomd/include/Types.h:53:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int64_t average_usage{0};
^
../../oomd/include/Types.h:54:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int64_t memory_low{0};
^
../../oomd/include/Types.h:55:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
int64_t swap_usage{0};
^
../../oomd/include/Types.h:52:24: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t current_usage{0};
^
../../oomd/include/Types.h:52:26: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t current_usage{0};
^
../../oomd/include/Types.h:53:24: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t average_usage{0};
^
../../oomd/include/Types.h:53:26: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t average_usage{0};
^
../../oomd/include/Types.h:54:21: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t memory_low{0};
^
../../oomd/include/Types.h:54:23: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t memory_low{0};
^
../../oomd/include/Types.h:55:21: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t swap_usage{0};
^
../../oomd/include/Types.h:55:23: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
int64_t swap_usage{0};
^
In file included from ../../oomd/OomDetector.h:26:0,
from ../OomDetector.cpp:18:
../../oomd/shared/OomdContext.h:34:20: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
~OomdContext() = default;
^
../../oomd/shared/OomdContext.h:35:26: error: expected ‘,’ or ‘...’ before ‘&&’ token
OomdContext(OomdContext&& other) noexcept;
^
../../oomd/shared/OomdContext.h:35:34: error: invalid constructor; you probably meant ‘Oomd::OomdContext (const Oomd::OomdContext&)’
OomdContext(OomdContext&& other) noexcept;
^
../../oomd/shared/OomdContext.h:35:34: error: expected ‘;’ at end of member declaration
../../oomd/shared/OomdContext.h:35:36: error: ‘noexcept’ does not name a type
OomdContext(OomdContext&& other) noexcept;
^
../../oomd/shared/OomdContext.h:35:36: note: C++11 ‘noexcept’ only available with -std=c++11 or -std=gnu++11
../../oomd/shared/OomdContext.h:36:37: error: expected ‘,’ or ‘...’ before ‘&&’ token
OomdContext& operator=(OomdContext&& other);
^
../../oomd/shared/OomdContext.h:64:51: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::vector<std::pair<std::string, CgroupContext>> reverseSort(
^
../../oomd/shared/OomdContext.h:65:12: error: ‘std::function’ has not been declared
std::function<double(const CgroupContext& cgroup_ctx)> getKey = nullptr);
^
../../oomd/shared/OomdContext.h:65:20: error: expected ‘,’ or ‘...’ before ‘<’ token
std::function<double(const CgroupContext& cgroup_ctx)> getKey = nullptr);

......and so on.

Please let me know where I'm going wrong.

from oomd.

danobi avatar danobi commented on July 1, 2024

Hmm I might have missed another cpp_args parameter in the library target. I forced pushed the PR. Can you retry?

from oomd.

danobi avatar danobi commented on July 1, 2024

Do you think it could be this issue? https://stackoverflow.com/questions/39207940/undefined-reference-when-linking-with-googletest

from oomd.

smita-koralahalli avatar smita-koralahalli commented on July 1, 2024

I got it built and executable oomd_bin created at usr/local/bin. Thanks for your help!

from oomd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.