Coder Social home page Coder Social logo

Comments (16)

SauravPrakash98 avatar SauravPrakash98 commented on July 19, 2024

I want to attempt this, please can you explain a bit more.

from oomd.

danobi avatar danobi commented on July 19, 2024

@SauravPrakash98 , sure. a21a584 adds install support to the meson build. When oomd gets installed via sudo ninja install, oomd's name is /usr/local/bin/oomd_bin. It'd be great if the name was /usr/local/bin/oomd.

from oomd.

rahgurung avatar rahgurung commented on July 19, 2024

I have a question, why exactly can't we configure it to install as /usr/local/bin/oomd , is it because system will look at it like tests, please explain ?

from oomd.

SauravPrakash98 avatar SauravPrakash98 commented on July 19, 2024

@gurungrahul2 In meson.build after you change the name of the executable from oomd_bin to oomd, then running meson build && ninja test -C build is unable to create the binary in the build folder

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

it is easy just change the executable name and then it installs as oomd
it is not a bug just a change in file name :) happy to apply patch @danobi

from oomd.

danobi avatar danobi commented on July 19, 2024

@Hyperion101010 I'm not sure what you mean, could you supply a patch?

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

here are some updates i ran the build ,so it installed correctly "the oomd named binary in the usr/local/bin" but when i went to run the binary it gave permission error ,
----------------------------------the output message------------------------------------------------------
open: Permission denied
(inl) [../Log.cpp:88] Unable to open outfile (default=/dev/kmsg), not logging
terminate called after throwing an instance of 'std::system_error'
what(): Permission denied
Aborted (core dumped)

now i looked for it in log.cpp it was a file open(permission) issue ,so i ran it in superuser ,but it gave fatal error
resulting in core dump
i'll run this with systrace and then get back to you with updates

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

https://github.com/Hyperion101010/oomd

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

just run diff

from oomd.

danobi avatar danobi commented on July 19, 2024

Ignoring the changed meson files (which should not be part of the commit), it looks like you changed the executable target from oomd_bin to oomd. I'm not sure this will work. When I build with that change, I get this output:

$ git --no-pager diff
diff --git a/meson.build b/meson.build
index 8c53421..217b0e0 100644
--- a/meson.build
+++ b/meson.build
@@ -51,7 +51,7 @@ oomd_lib = library('oomd',
                    cpp_args : cpp_args,
                    install: true,
                    dependencies : deps)
-executable('oomd_bin',
+executable('oomd',
            files('Main.cpp'),
            include_directories : inc,
            cpp_args : cpp_args,

$ ninja
[1/13] Linking target oomd.
FAILED: oomd 
c++  -o oomd 'oomd@exe/Main.cpp.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group liboomd.so /usr/lib64/libjsoncpp.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/:XXXXXXXX' -Wl,-rpath-link,/home/dlxu/dev/oomd/biuld/  
/bin/ld: cannot open output file oomd: Is a directory
collect2: error: ld returned 1 exit status
[6/13] Linking target oomd_killer_tests.
ninja: build stopped: subcommand failed.

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

now try running it .
took me two days but its fine i did something ,
the issue was in meson build
1>if we gave it name as "oomd" then there was a directory created for fixtures
thus now when main.cpp was running it saw it as a directory rather than a oomd binary
------------------------solution---------------------------------------------------
2>what i did was renamed the mkdir to make "oomd_fix" rather than "oomd" file for fixtures so it now doesn't conflicts with it and creates a binary named oomd
feeling great :)

from oomd.

danobi avatar danobi commented on July 19, 2024

@Hyperion101010 That works for creating the executable but it would break the tests. Unfortunately the fixtures have to stay in a folder named oomd. It's kind of crappy, I know. I was really hoping there was a meson option to install the binary as a different name.

from oomd.

Hyperion101010 avatar Hyperion101010 commented on July 19, 2024

yes i think you are right :(
one way to work around this will be to write a script to directly run
1>the meson.build at first which will create oomd_bin
2>then it'll run ninja and test it as well
3>at last it'll rename the files and thus we can get everything in oomd the "oomd_fix" made can be just copied at last to oomd so we can have a neat single command to make all things happen
4>automatically install required dependencies "gmock" and "gtest"

so that for a new user we can reduce the fuzz of running multiple things
but i am doubtful about fourth point
i am thinking of writing it in python !
awaiting your reply

from oomd.

danobi avatar danobi commented on July 19, 2024

I don’t think wrapping the build system with what sounds like another build system is a good idea. I think the correct way to do this would be to find the correct meson option or try to implement this feature in meson itself. Or if possible, generate the executable inside another directory so there’s no name collisions.

from oomd.

ufo19890607 avatar ufo19890607 commented on July 19, 2024

Hi, all , I'm sure that I've setup the jsoncpp and ninja, but when I run 'meson build && ninja -C build'

[root@bogon oomd]# meson build && ninja -C build
The Meson build system
Version: 0.47.2
Source dir: /home/ufo/oomd
Build dir: /home/ufo/oomd/build
Build type: native build
Project name: oomd
Project version: 0.1.0
Native C++ compiler: c++ (gcc 4.8.5 "c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.27.1)

meson.build:72:0: ERROR: Native dependency 'jsoncpp' not found

A full log can be found at /home/ufo/oomd/build/meson-logs/meson-log.txt

from oomd.

RunningDroid avatar RunningDroid commented on July 19, 2024

Sorry for bumping an old issue but it looks like 33c4bda resolves this

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.