easylogging complied failed with ELPP_THREAD_SAFE - linux

I have been used easylogging with OMP, but I found it should add ELPP_THREAD_SAFE to keep thread safe, it success in win but when failed in ubuntu20.04. When I tried to add definition ELPP_THREAD_SAFE in cmakelist, it complied failed.
PS:-lpthread was also added.
Fail info:
/usr/include/c++/9/mutex:541:5: error: variable or field ??lock?? declared void
541 | lock(_L1& __l1, _L2& __l2, _L3&... __l3)
| ^~~~
/usr/include/c++/9/mutex:543:7: error: expected primary-expression before ??while??
543 | while (true)
...

Related

Issue while setting up Bluez on Ubuntu NUC: tools/mesh-cfgtest.c:132:10:10: error: Initializer element is not constant

I am trying to setup BLE-Mesh Provisioner on my Ubuntu NUC. Since kernel is already build in NUC Ubuntu with version 4.15.0-76 generic. Now I am trying to compile Bluez from source. I have performed following steps on my system:
Compiling dependency needed for bluez
Installing Json-library and Embedded Linux Library
Compiling Bluez
While compiling I am getting an error as:
tools/mesh-cfgtest.c:132:10: error: initializer element is not constant
.path = cli_app_path,
^
tools/mesh-cfgtest.c:132:10: note: (near initialization for ‘client_app.path’)
tools/mesh-cfgtest.c:133:16: error: initializer element is not constant
.agent_path = cli_agent_path,
^
tools/mesh-cfgtest.c:133:16: note: (near initialization for
‘client_app.agent_path’)
tools/mesh-cfgtest.c:141:12: error: initializer element is not constant
.path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:141:12: note: (near initialization for
‘client_app.ele[0].path’)
tools/mesh-cfgtest.c:150:10: error: initializer element is not constant
.path = srv_app_path,
^
tools/mesh-cfgtest.c:150:10: note: (near initialization for ‘server_app.path’)
tools/mesh-cfgtest.c:151:16: error: initializer element is not constant
.agent_path = srv_agent_path,
^
tools/mesh-cfgtest.c:151:16: note: (near initialization for
‘server_app.agent_path’)
tools/mesh-cfgtest.c:159:12: error: initializer element is not constant
.path = srv_ele_path_00,
^
tools/mesh-cfgtest.c:159:12: note: (near initialization for
‘server_app.ele[0].path’)
tools/mesh-cfgtest.c:165:12: error: initializer element is not constant
.path = srv_ele_path_01,
^
tools/mesh-cfgtest.c:165:12: note: (near initialization for
‘server_app.ele[1].path’)
tools/mesh-cfgtest.c:214:9: error: initializer element is not constant
.idx = import_netkey_idx,
^
tools/mesh-cfgtest.c:214:9: note: (near initialization for
‘init_add_netkey_req.idx’)
tools/mesh-cfgtest.c:219:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:219:14: note: (near initialization for
‘init_add_netkey_data.ele_path’)
tools/mesh-cfgtest.c:242:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:242:14: note: (near initialization for
‘init_add_appkey_data.ele_path’)
tools/mesh-cfgtest.c:243:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:243:9: note: (near initialization for
‘init_add_appkey_data.dst’)
tools/mesh-cfgtest.c:244:12: error: initializer element is not constant
.subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:244:12: note: (near initialization for
‘init_add_appkey_data.subnet’)
tools/mesh-cfgtest.c:271:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:271:14: note: (near initialization for
‘test_add_appkey.ele_path’)
tools/mesh-cfgtest.c:272:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:272:9: note: (near initialization for
‘test_add_appkey.dst’)
tools/mesh-cfgtest.c:273:12: error: initializer element is not constant
.subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:273:12: note: (near initialization for
‘test_add_appkey.subnet’)
tools/mesh-cfgtest.c:278:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:278:14: note: (near initialization for
‘common_route.ele_path’)
tools/mesh-cfgtest.c:279:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:279:9: note: (near initialization for ‘common_route.dst’)
tools/mesh-cfgtest.c:280:12: error: initializer element is not constant
. subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:280:12: note: (near initialization for
‘common_route.subnet’)
Makefile:7521: recipe for target 'tools/mesh-cfgtest.o' failed
make[1]: *** [tools/mesh-cfgtest.o] Error 1
Makefile:4468: recipe for target 'all' failed
make: *** [all] Error 2
I am attaching the screenshot for your reference:
Error Message:
I am following this reference to setup Bluez in system:
https://budimir.cc/2022/01/08/compile-bluez-from-source/
Please help me to resolve this problem while setting up bluez on Ubuntu.
I am expecting the exact solution or guide. How to set up Bluetooth-Low-Energy on Ubuntu. Basically when I was trying with Raspberrypi I was not able to install pygattlib and pybluez .. So I switched to Ubuntu and now I am expecting that there would be solution to resolve this issue. Please help me to resolve this issue

Pushing Results to KiwiTCMS using RobotFramework Ride Issue

I am trying to get Robotframework(Ride) work with KiwiTCMS.
I am making the connection to the KIWI server (local) but I am getting these errors that I am not sure where(In RIDE? or the .conf file?) to fix:
[ ERROR ] Calling method 'start_suite' of listener 'zealand.listener.KiwiTCMS' failed: ENVIRONFILE Version value not defined, missing one of TCMS_PRODUCT_VERSION, TRAVIS_COMMIT, TRAVIS_PULL_REQUEST_SHA or GIT_COMMIT
[ ERROR ] Calling method 'end_test' of listener 'zealand.listener.KiwiTCMS' failed: TypeError: 'NoneType' object is not subscriptable
TestKiwiRide | PASS |
------------------------------------------------------------------------------
KiwiTest.TestKiwi | PASS |
1 test, 1 passed, 0 failed
==============================================================================
KiwiTest | PASS |
1 test, 1 passed, 0 failed
==============================================================================
Output: C:\Users\hendri\Documents\KiwiTest\output.xml
Log: C:\Users\hendri\Documents\KiwiTest\log.html
Report: C:\Users\hendri\Documents\KiwiTest\report.html
(kiwi-env) C:\Users\hendri\Documents\KiwiTest>
Please assit?
Details goes into the bat file you use to call the test cases
check here : https://kiwitcms.readthedocs.io/en/stable/plugins/automation-frameworks.html
In plugin configuration section, you have to passe configuration as environment variables. e.g.
export TCMS_PLAN_ID=*PLAN_ID*

How can I change the CONFIG_ARCH_OPTIONAL_KERNEL_RWX value? by changing arch/Kconfig file directly?

I had asked a quesion at kernelnewbies email list and later I thought I found the answer (I thought I can put it in my defconfig). But then later found it was my mistake. So I still have the question and I ask it here to get answer.
This is what I see when I search “KERNEL_RWX” during “make menuconfig” for arm64 kernel(5-10.0-rc5).
The Kconfig file says CONFIG_STRICT_KERNEL_RWX is for setting text and rodata read-only.
Symbol: ARCH_OPTIONAL_KERNEL_RWX [=n]
Type : bool
Defined at arch/Kconfig:928
Symbol: ARCH_OPTIONAL_KERNEL_RWX_DEFAULT [=n]
Type : bool
Defined at arch/Kconfig:931
Symbol: STRICT_KERNEL_RWX [=y]
Type : bool
Defined at arch/Kconfig:937
Prompt: Make kernel text and rodata read-only
Depends on: ARCH_HAS_STRICT_KERNEL_RWX [=y]
Visible if: ARCH_HAS_STRICT_KERNEL_RWX [=y] && ARCH_OPTIONAL_KERNEL_RWX [=n]
Location:
(1) -> General architecture-dependent options
I wanted to try setting STRICT_KERNEL_RWX to =n. The 'Visible if' descriptionn says this option is visible when ARCH_OPTIONAL_KERNEL_RWX is =y which is now =n. (The STRICT_KERNEL_RWX menu didn't appear as a configurable menu in the menuconfig at this time). This is the lines in arch/Kconfig.
config ARCH_OPTIONAL_KERNEL_RWX
def_bool n
So I modified to ARCH_OPTIONAL_KERNEL_RWX=y in arch/Kconfig line 928. (BTW, This is question : is it correct to modify this Kconfig file directly? I’m not sure at the moment)
Then I could see the STRICT_KERNEL_RWX menu in the menuconfig and I set it to =n as I wanted.
But when I build the kernel, I see this errors.
ckim#ckim-ubuntu:~/ProjX/LinuxDevDrv/kernel-release-RD-INFRA-2020.11.30$ makeit
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC arch/arm64/mm/mmu.o
arch/arm64/mm/mmu.c: In function 'parse_rodata':
arch/arm64/mm/mmu.c:595:28: error: 'rodata_enabled' undeclared (first use in this function)
595 | int ret = strtobool(arg, &rodata_enabled);
| ^~~~~~~~~~~~~~
arch/arm64/mm/mmu.c:595:28: note: each undeclared identifier is reported only once for each function it appears in
arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
arch/arm64/mm/mmu.c:614:18: error: 'rodata_enabled' undeclared (first use in this function)
614 | pgprot_t prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
| ^~~~~~~~~~~~~~
arch/arm64/mm/mmu.c: In function 'map_kernel':
arch/arm64/mm/mmu.c:669:23: error: 'rodata_enabled' undeclared (first use in this function)
669 | pgprot_t text_prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
| ^~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:283: arch/arm64/mm/mmu.o] Error 1
make[1]: *** [scripts/Makefile.build:500: arch/arm64/mm] Error 2
make: *** [Makefile:1799: arch/arm64] Error 2
variable “rodata_enabled” is defined in init/main.c as below.
#if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
bool rodata_enabled __ro_after_init = true;
static int __init set_debug_rodata(char *str)
{
return strtobool(str, &rodata_enabled);
}
__setup("rodata=", set_debug_rodata);
#endif
But now that CONFIG_STRICT_KERNEL_RWX=n, the above lines are not compiled here (CONFIG_STRICT_MODULE_RWX=n too). However, arch/arm64/mm/mmu.c code is still using rodata_enabled. Is this a bug of the code? Or am I missing something?
I can modify init/main.c and include/linux/init.h so that this rodata_enabled and related functions be defined regardless of these CONFIG values and make the errors go away, but I’m curious if this a kind of kernel bug raising compiler error.
So again my question is how should I change ARCH_OPTIONAL_KERNEL_RWX value? I tried setting it in my defconfig file but when I do make xxx_defonfig, the .config file shows still ARCH_OPTIONAL_KERNEL_RWX=n. Should I edit the arch/Kconfig file really?

How to implement a TBB input_node?

Apparently in tbb::flow the source_node has been deprecated, and starting in the 2021.1 version we are only supposed to use input_node. Simply replacing the class does not seem to work, though. I have a working code using source_node in version 2020.3. If I try using input_node I get a cryptic message.
It seems input_node expects Body to implement a function that takes a flow_control object. Is this the case? Otherwise what is wrong here?
I cannot seem to be able to run any example codes with input_body.
====================[ Build | capybara | Debug-System ]==========================
/home/nicolau/bin/clion-2020.1.1/bin/cmake/linux/bin/cmake --build /home/nicolau/src/capybara/cmake-build-debug-system --target capybara -- -j 9
Scanning dependencies of target capybara
[ 50%] Building CXX object CMakeFiles/capybara.dir/main.cpp.o
In file included from /home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/flow_graph.h:345:0,
from /home/nicolau/src/capybara/main.cpp:9:
/home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/detail/_flow_graph_body_impl.h: In instantiation of ‘Output tbb::detail::d1::input_body_leaf<Output, Body>::operator()(tbb::detail::d1::flow_control&) [with Output = std::tuple<cv::Mat, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > > >; Body = main(int, char**)::<lambda(imgtv&)>]’:
/home/nicolau/src/capybara/main.cpp:424:1: required from here
/home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/detail/_flow_graph_body_impl.h:88:66: error: no match for call to ‘(main(int, char**)::<lambda(imgtv&)>) (tbb::detail::d1::flow_control&)’
Output operator()(flow_control& fc) override { return body(fc); }
^
/home/nicolau/src/capybara/main.cpp:350:58: note: candidate: main(int, char**)::<lambda(imgtv&)>
tbb::flow::input_node<imgtv> src(g, [&](imgtv &v) -> bool {
^~~~
/home/nicolau/src/capybara/main.cpp:350:58: note: no known conversion for argument 1 from ‘tbb::detail::d1::flow_control’ to ‘imgtv& {aka std::tuple<cv::Mat, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > > >&}’
CMakeFiles/capybara.dir/build.make:82: recipe for target 'CMakeFiles/capybara.dir/main.cpp.o' failed
make[3]: *** [CMakeFiles/capybara.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/capybara.dir/all' failed
make[2]: *** [CMakeFiles/capybara.dir/all] Error 2
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/capybara.dir/rule' failed
make[1]: *** [CMakeFiles/capybara.dir/rule] Error 2
Makefile:138: recipe for target 'capybara' failed
make: *** [capybara] Error 2
Apparently the interface has changed compared to source_node, and the function is now supposed to take a flow_control reference and return the new input object as output.
https://github.com/oneapi-src/oneTBB/issues/270#issuecomment-683645172

Jansson build errors

I am pretty new to Linux and I am having problems integrating an external software into my program. When I am following the instructions on integrating a couple of lines that includes Jansson (Add G4Sipm to your CMakeLists.txt in this document enter link description here) I get errors which I suspect is the problem of integration itself since it does separately build on its own. The errors I get are after command build -j2. Here is a part of the terminal output:
Scanning dependencies of target jansson
Scanning dependencies of target gtest
Scanning dependencies of target G4GeneralParticleSource
[ 1%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/dump.c.o
[ 2%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/error.c.o
[ 2%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/hashtable.c.o
[ 3%] Building CXX object G4BasicObjects/G4PropertyFileReadInTools/CMakeFiles/G4PropertyFileReadInTools.dir/src/PropertyToolsManager.cc.o
[ 4%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/hashtable_seed.c.o
[ 4%] Building CXX object G4BasicObjects/G4PropertyFileReadInTools/CMakeFiles/G4PropertyFileReadInTools.dir/src/GoddessProperties.cc.o
[ 4%] Building CXX object G4BasicObjects/G4PropertyFileReadInTools/CMakeFiles/G4PropertyFileReadInTools.dir/src/VectorUtil.cc.o
[ 5%] Building CXX object externals/g4sipm/externals/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 6%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/load.c.o
[ 6%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/memory.c.o
[ 7%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/pack_unpack.c.o
[ 7%] Building C object externals/g4sipm/externals/jansson/CMakeFiles/jansson.dir/src/strbuffer.c.o
In file included from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/hashtable.h:11,
from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson_private.h:11,
from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/dump.c:12:
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:101:22: error: unknown type name ‘json_int_t’; did you mean ‘json_t’?
101 | json_t *json_integer(json_int_t value);
| ^~~~~~~~~~
| json_t
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:280:1: error: unknown type name ‘json_int_t’; did you mean ‘json_auto_t’?
280 | json_int_t json_integer_value(const json_t *integer);
| ^~~~~~~~~~
| json_auto_t
In file included from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/hashtable.h:11,
from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson_private.h:11,
from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/error.c:1:
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:101:22: error: unknown type name ‘json_int_t’; did you mean ‘json_t’?
101 | json_t *json_integer(json_int_t value);
| ^~~~~~~~~~
| json_t
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:288:39: error: unknown type name ‘json_int_t’; did you mean ‘json_auto_t’?
288 | int json_integer_set(json_t *integer, json_int_t value);
| ^~~~~~~~~~
| json_auto_t
In file included from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/dump.c:12:
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson_private.h:60:5: error: unknown type name ‘json_int_t’
60 | json_int_t value;
| ^~~~~~~~~~
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:280:1: error: unknown type name ‘json_int_t’; did you mean ‘json_auto_t’?
280 | json_int_t json_integer_value(const json_t *integer);
| ^~~~~~~~~~
| json_auto_t
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:288:39: error: unknown type name ‘json_int_t’; did you mean ‘json_auto_t’?
288 | int json_integer_set(json_t *integer, json_int_t value);
| ^~~~~~~~~~
| json_auto_t
In file included from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/error.c:1:
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson_private.h:60:5: error: unknown type name ‘json_int_t’
60 | json_int_t value;
| ^~~~~~~~~~
In file included from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/hashtable.h:11,
from /home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/hashtable.c:19:
/home/abhinab1/goddess/source/externals/g4sipm/externals/jansson/src/jansson.h:101:22: error: unknown type name ‘json_int_t’; did you mean ‘json_t’?
101 | json_t *json_integer(json_int_t value);
| ^~~~~~~~~~
| json_t
I tried adding #include <jansson_config.h> instead of #include "jansson_config.h" however errors still persisted. I tried contacting the project lead however it seems they have all moved on from the project. Any help and suggestions would be greatly appreciated, thank you!
Edit 1: for clarification, I am using the latest version of Jansson

Resources