Is anyone embedded aqua-sim-ng with ns-3.29? - c++

I had tried to configure aqua-sim-ng (according to aqua-sim-ng documentation would only work on ns-3.25,ns-3.26 and ns-3.27) with ns-3.29. I am getting an compiling error which is attached below. Please help how can i solve those compiling error.
In file included from ../src/aqua-sim-ng/model/aqua-sim-phy.h:29:0,
from ../src/aqua-sim-ng/model/aqua-sim-net-device.h:38,
from ../src/aqua-sim-ng/model/aqua-sim-routing.h:35,
from ../src/aqua-sim-ng/model/aqua-sim-routing-vbf.h:24,
from ../src/aqua-sim-ng/model/aqua-sim-routing-vbf.cc:21:
../src/aqua-sim-ng/model/aqua-sim-channel.h:67:20: error: conflicting return type specified for ‘virtual uint32_t ns3::AquaSimChannel::GetNDevices() const’
virtual uint32_t GetNDevices (void) const;
^
In file included from ../src/aqua-sim-ng/model/aqua-sim-channel.h:24:0,
from ../src/aqua-sim-ng/model/aqua-sim-phy.h:29,
from ../src/aqua-sim-ng/model/aqua-sim-net-device.h:38,
from ../src/aqua-sim-ng/model/aqua-sim-routing.h:35,
from ../src/aqua-sim-ng/model/aqua-sim-routing-vbf.h:24,
from ../src/aqua-sim-ng/model/aqua-sim-routing-vbf.cc:21:
./ns3/channel.h:68:23: error: overriding ‘virtual std::size_t ns3::Channel::GetNDevices() const’
virtual std::size_t GetNDevices (void) const = 0;
^
Waf: Leaving directory `/home/jay/Desktop/ns-allinone-3.29/ns-3.29/build'
Build failed
-> task in 'ns3-aqua-sim-ng' failed with exit status 1:
{task 140292841097768: cxx aqua-sim-routing-vbf.cc -> aqua-sim-routing-vbf.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-I.', '-I..', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '../src/aqua-sim-ng/model/aqua-sim-routing-vbf.cc', '-c', '-o/home/jay/Desktop/ns-allinone-3.29/ns-3.29/build/src/aqua-sim-ng/model/aqua-sim-routing-vbf.cc.1.o']

There is a conflict between the types uint32_t and std::size_t. Change all the occurrences of uint32_t to std::size_t in aqua-sim-channel.h and aqua-sim-channel.cc .

Related

Problem in building Aquasim module in NS3

I am getting the following error while building aquasim
In file included from ./ns3/object-base.h:23:0,
from ./ns3/object.h:29,
from ./ns3/energy-source.h:30,
from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:21:
./ns3/type-id.h: In instantiation of ‘static ns3::ObjectBase* ns3::TypeId::AddConstructor()::Maker::Create() [with T = ns3::AquaSimEnergyModel]’:
./ns3/type-id.h:659:3: required from ‘ns3::TypeId ns3::TypeId::AddConstructor() [with T = ns3::AquaSimEnergyModel]’
../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:42:42: required from here
./ns3/type-id.h:656:27: error: invalid new-expression of abstract class type ‘ns3::AquaSimEnergyModel’
ObjectBase * base = new T ();
^~~~~~~~
In file included from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:26:0:
../src/aqua-sim-ng/model/aqua-sim-energy-model.h:45:7: note: because the following virtual functions are pure within ‘ns3::AquaSimEnergyModel’:
class AquaSimEnergyModel : public DeviceEnergyModel
^~~~~~~~~~~~~~~~~~
In file included from ./ns3/device-energy-model-container.h:26:0,
from ./ns3/energy-source.h:34,
from ../src/aqua-sim-ng/model/aqua-sim-energy-model.cc:21:
./ns3/device-energy-model.h:106:16: note: virtual void ns3::DeviceEnergyModel::HandleEnergyChanged()
virtual void HandleEnergyChanged (void) = 0;
^~~~~~~~~~~~~~~~~~~
Waf: Leaving directory `/home/udit/ns-allinone-3.30.1/ns-3.30.1/build'
Build failed
-> task in 'ns3-aqua-sim-ng' failed with exit status 1 (run with -v to display more information)
try to build ns3 according to this, https://www.nsnam.org/wiki/HOWTO_build_old_versions_of_ns-3_on_newer_compilers
or please provide more details of your NS3 version and GCC compiler.

How to fix errors during installation 'opencv4nodejs' module

Hi I'm trying to use opencv in my Node.js project so I decided to use opencv4nodejs. So I used brew to install cmake that is required to install mentioned module. But when I'm trying to install opencv4nodejs the following errors occurs:
...
...
...
Scanning dependencies of target opencv_text
[ 84%] Building CXX object modules/text/CMakeFiles/opencv_text.dir/src/erfilter.cpp.o
[ 84%] Building CXX object modules/tracking/CMakeFiles/opencv_tracking.dir/src/feature.cpp.o
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/precomp.hpp:54:
In file included from /usr/local/include/tesseract/baseapi.h:26:
In file included from /usr/local/include/tesseract/apitypes.h:23:
/usr/local/include/tesseract/publictypes.h:33:1: error: unknown type name 'constexpr'
constexpr int kPointsPerInch = 72;
^
/usr/local/include/tesseract/publictypes.h:33:11: error: expected unqualified-id
constexpr int kPointsPerInch = 72;
^
/usr/local/include/tesseract/publictypes.h:38:1: error: unknown type name 'constexpr'
constexpr int kMinCredibleResolution = 70;
^
/usr/local/include/tesseract/publictypes.h:38:11: error: expected unqualified-id
constexpr int kMinCredibleResolution = 70;
^
/usr/local/include/tesseract/publictypes.h:40:1: error: unknown type name 'constexpr'
constexpr int kMaxCredibleResolution = 2400;
^
/usr/local/include/tesseract/publictypes.h:40:11: error: expected unqualified-id
constexpr int kMaxCredibleResolution = 2400;
^
/usr/local/include/tesseract/publictypes.h:45:1: error: unknown type name 'constexpr'
constexpr int kResolutionEstimationFactor = 10;
^
/usr/local/include/tesseract/publictypes.h:45:11: error: expected unqualified-id
constexpr int kResolutionEstimationFactor = 10;
^
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/precomp.hpp:54:
In file included from /usr/local/include/tesseract/baseapi.h:30:
In file included from /usr/local/include/tesseract/resultiterator.h:27:
In file included from /usr/local/include/tesseract/ltrresultiterator.h:27:
/usr/local/include/tesseract/unichar.h:171:8: error: function definition does not declare parameters
char chars[UNICHAR_LEN]{};
^
/usr/local/include/tesseract/unichar.h:60:12: error: use of undeclared identifier 'chars'
memset(chars, 0, UNICHAR_LEN);
^
/usr/local/include/tesseract/unichar.h:78:15: error: use of undeclared identifier 'chars'
int len = chars[UNICHAR_LEN - 1];
^
/usr/local/include/tesseract/unichar.h:84:12: error: use of undeclared identifier 'chars'
return chars;
^
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/precomp.hpp:54:
In file included from /usr/local/include/tesseract/baseapi.h:30:
/usr/local/include/tesseract/resultiterator.h:103:63: error: a space is required between consecutive right angle brackets (use '> >')
virtual std::vector<std::vector<std::pair<const char*, float>>>*
^
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/erfilter.cpp:43:
In file included from /Users/iwanowicz/Documents/testApp/node_modules/opencv-build/opencv/opencv_contrib/modules/text/src/precomp.hpp:54:
In file included from /usr/local/include/tesseract/baseapi.h:31:
/usr/local/include/tesseract/serialis.h:43:1: error: unknown type name 'constexpr'
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:17: error: expected ';' at end of declaration
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:18: error: C++ requires a type specifier for all declarations
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:26: error: use of undeclared identifier 'T'
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:43:41: error: expected ';' after top level declarator
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:55:40: error: unknown type name 'size_t'
bool DeSerialize(FILE* fp, char* data, size_t n = 1);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [modules/text/CMakeFiles/opencv_text.dir/src/erfilter.cpp.o] Error 1
make[1]: *** [modules/text/CMakeFiles/opencv_text.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object modules/calib3d/CMakeFiles/opencv_calib3d.dir/src/dls.cpp.o
ld: warning: building for macOS, but linking in object file (../../3rdparty/ippicv/ippicv_mac/icv/lib/intel64/libippicv.a(pscopye9as_l9.o)) built for
[ 89%] Built target opencv_calib3d
make: *** [all] Error 2
ERR! child process exited with code 2 (for more info, set '--loglevel silly')
npm WARN testapp#1.0.0 No description
npm WARN testapp#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv-build#0.1.9 install: `node ./install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv-build#0.1.9 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/iwanowicz/.npm/_logs/2019-09-09T06_14_39_892Z-debug.log
As I understand there are some problems with building(?) opencv but I can`t find solutions for.
Could you help me finish the proces of installation opencv4nodejs?

Error with Protobuf while compiling Tensorflow

I am currently trying use Tensorflow's shared libraries in a non-bazel project.
So I built the .so file using:
bazel build //tensorflow:libtensorflow.so
Then I loaded the dependencies as described here.
I added the following flags to my Makefile:
CFLAGS += -I/home/alpy/tensorflow/bazel-genfiles
CFLAGS += -I/home/alpy/tensorflow/
CFLAGS += -I/home/alpy/tensorflow/tensorflow/contrib/makefile/downloads/eigen-latest/
LDFLAGS += -L../resources/
LDFLAGS += -ltensorflow.so
When I do this, I get this rather strange error:
In file included from /home/alpy/tensorflow/tensorflow/core/public/session.h:22:0,
from ../src/conversion.h:14,
from ../src/conversion.cpp:1:
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:143:3: error: ‘PROTOBUF_DEPRECATED_ATTR’ does not name a type
PROTOBUF_DEPRECATED_ATTR void clear_version();
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:144:3: error: ‘PROTOBUF_DEPRECATED_ATTR’ does not name a type
PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3;
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:145:3: error: ‘PROTOBUF_DEPRECATED_ATTR’ does not name a type
PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const;
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:146:3: error: ‘PROTOBUF_DEPRECATED_ATTR’ does not name a type
PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value);
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:273:37: error: no ‘void tensorflow::GraphDef::clear_version()’ member function declared in class ‘tensorflow::GraphDef’
inline void GraphDef::clear_version() {
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:276:54: error: no ‘google::protobuf::int32 tensorflow::GraphDef::version() const’ member function declared in class ‘tensorflow::GraphDef’
inline ::google::protobuf::int32 GraphDef::version() const {
^
/home/alpy/tensorflow/bazel-genfiles/tensorflow/core/framework/graph.pb.h:280:66: error: no ‘void tensorflow::GraphDef::set_version(google::protobuf::int32)’ member function declared in class ‘tensorflow::GraphDef’
inline void GraphDef::set_version(::google::protobuf::int32 value) {
BTW, I loaded protobuf as it was described on the page I linked above.
I think the problem is resolved as described here: Google Groups discussion
Just add a new CFLAG:
-DPROTOBUF_DEPRECATED_ATTR=""

How to compile a program from .cpp files and a makefile

I recently downloaded a program. A patient specific survival prediction CLI, http://pssp.srv.ualberta.ca/
The readme included states:
"1 Compilation
The code should compile on Linux without any modification. To compile, just type ’make’. There should
be 2 executables after compilation, mtlr train and mtlr test."
I download an extracted the folder to my location, when I go into the directory and type make I get:
x#x-laptop:/pssp_source$ make
g++ -c -O3 DenseVector.cpp -o DenseVector.o
In file included from DenseVector.cpp:1:0:
DenseVector.h:9:2: error: ‘size_t’ does not name a type
size_t m_dim;
^
DenseVector.h:18:21: error: expected ‘)’ before ‘n’
DenseVector(size_t n);
^
DenseVector.h:26:33: error: ‘size_t’ does not name a type
double const& operator[](const size_t i) const
^
DenseVector.h:26:40: error: ISO C++ forbids declaration of ‘i’ with no type [-fpermissive]
double const& operator[](const size_t i) const
^
DenseVector.h:31:27: error: ‘size_t’ does not name a type
double& operator[](const size_t i)
^
DenseVector.h:31:34: error: ISO C++ forbids declaration of ‘i’ with no type [-fpermissive]
double& operator[](const size_t i)
^
DenseVector.h:38:2: error: ‘size_t’ does not name a type
size_t dim() const
^
DenseVector.h: In member function ‘void DenseVector::push_back(double)’:
DenseVector.h:23:3: error: ‘m_dim’ was not declared in this scope
m_dim++;
^
DenseVector.cpp: At global scope:
DenseVector.cpp:6:1: error: prototype for ‘DenseVector::DenseVector(size_t)’ does not match any in class ‘DenseVector’
DenseVector::DenseVector(size_t n): m_dim(n)
^
In file included from DenseVector.cpp:1:0:
DenseVector.h:5:7: error: candidates are: DenseVector::DenseVector(const DenseVector&)
class DenseVector
^
DenseVector.h:12:2: error: DenseVector::DenseVector()
DenseVector(void);
^
DenseVector.cpp: In constructor ‘DenseVector::DenseVector()’:
DenseVector.cpp:16:2: error: class ‘DenseVector’ does not have any field named ‘m_dim’
:m_dim(0)
^
DenseVector.cpp: In member function ‘void DenseVector::clear()’:
DenseVector.cpp:27:22: error: ‘m_dim’ was not declared in this scope
for (size_t i=0; i<m_dim; i++)
^
In file included from /usr/include/c++/4.8/cassert:43:0,
from DenseVector.cpp:3:
DenseVector.cpp: In function ‘double sprod_nn(const DenseVector&, const DenseVector&)’:
DenseVector.cpp:37:11: error: ‘const class DenseVector’ has no member named ‘dim’
assert(a.dim() == b.dim());
^
DenseVector.cpp:37:22: error: ‘const class DenseVector’ has no member named ‘dim’
assert(a.dim() == b.dim());
^
DenseVector.cpp:38:15: error: ‘const class DenseVector’ has no member named ‘dim’
size_t n = a.dim();
^
In file included from /usr/include/c++/4.8/cassert:43:0,
from DenseVector.cpp:3:
DenseVector.cpp: In function ‘void multadd_nn(DenseVector&, const DenseVector&, double)’:
DenseVector.cpp:49:11: error: ‘class DenseVector’ has no member named ‘dim’
assert(w.dim()==a.dim());
^
DenseVector.cpp:49:20: error: ‘const class DenseVector’ has no member named ‘dim’
assert(w.dim()==a.dim());
^
DenseVector.cpp:50:15: error: ‘class DenseVector’ has no member named ‘dim’
size_t n = w.dim();
^
DenseVector.cpp: In function ‘void smult_n(DenseVector&, double)’:
DenseVector.cpp:62:15: error: ‘class DenseVector’ has no member named ‘dim’
size_t n = w.dim();
^
make: *** [DenseVector.o] Error 1
The contents of the folder look like:
x#x-laptop:/pssp_source$ ls
common.cpp data_type_api.h DenseVector.h Main.cpp Makefile Sparm.cpp Sparm.o SparseVector.h test_model.mltr Util.h
common.h DenseVector.cpp example_data Main.o readme.pdf Sparm.h SparseVector.cpp Test.cpp test_model.mlty
I looked up the basic packages needed for compiling c++ code, as well as basics on how to run it and none have gotten me past this issue. It looks as if it has a problem with size_t not having a type.
The start of DenseVector.cpp is :
#include "DenseVector.h"
#include <cassert>
#include <iostream>
DenseVector::DenseVector(size_t n): m_dim(n)
{
m_dvector.reserve(n);
for (size_t i=0; i<n; i++)
{
m_dvector.push_back(0);
}
}
I have never compiled code like this before, so I am probably missing something obvious. If its needed I am running ubuntu 14.04, g++ version is
4.8.4.
Thanks
It sounds like the README lied. Probably it happened to work with a different version of the standard library.
Try adding
#include <stddef.h>
near the top of DenseVector.h.
Open the file DenseVector.h in the root directory of the program and modify it, inserting
#pragma once
#include <vector>
#include <cstddef> // <--- Add this line to the file
class DenseVector
{
protected:
// ...
Save it and try again!
I don't think you are using the correct version of C; I think you need C11. Instead of using the -03 flag, use -11 or -std=c11. Then recompile it.

Cassandra cpp-driver compile error

I'm trying to install Cassandra cpp-driver in Ubuntu.
I've done the steps specified in DataStax C/C++ Driver for Apache Cassandra (Beta), but i keep getting the following compile error.
[ 1%] Building CXX object CMakeFiles/cassandra.dir/src/buffer_collection.cpp.o
In file included from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/session.hpp:29:0, from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/types.hpp:22, from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/buffer_collection.cpp:19:
/root/libraries/cass_cpp-driver/git2/cpp-driver/src/logger.hpp: In member function 'int cass::Logger::init()':
/root/libraries/cass_cpp-driver/git2/cpp-driver/src/logger.hpp:40:59: error: no matching function for call to 'cass::AsyncQueue<cass::MPMCQueue<cass::Logger::LogMessage*> >::init(uv_loop_t*, cass::Logger* const, void (&)(uv_async_t*, int))'
int init() { return log_queue_.init(loop(), this, on_log); }
^
/root/libraries/cass_cpp-driver/git2/cpp-driver/src/logger.hpp:40:59: note: candidate is:
In file included from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/event_thread.hpp:21:0,
from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/session.hpp:20,
from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/types.hpp:22,
from /root/libraries/cass_cpp-driver/git2/cpp-driver/src/buffer_collection.cpp:19:
/root/libraries/cass_cpp-driver/git2/cpp-driver/src/async_queue.hpp:34:7: note: int cass::AsyncQueue<Q>::init(uv_loop_t*, void*, uv_async_cb) [with Q = cass::MPMCQueue<cass::Logger::LogMessage*>; uv_loop_t = uv_loop_s; uv_async_cb = void (*)(uv_async_s*); uv_async_t = uv_async_s] <near match>
int init(uv_loop_t* loop, void* data, uv_async_cb async_cb) {
^
/root/libraries/cass_cpp-driver/git2/cpp-driver/src/async_queue.hpp:34:7: note: no known conversion for argument 3 from 'void(uv_async_t*, int) {aka void(uv_async_s*, int)}' to 'uv_async_cb {aka void (*)(uv_async_s*)}'
make[2]: *** [CMakeFiles/cassandra.dir/src/buffer_collection.cpp.o] Error 1
make[1]: *** [CMakeFiles/cassandra.dir/all] Error 2
make: *** [all] Error 2
I've already fixed this compile errors in Cassandra cpp-driver, by down-versioning libuv to version libuv-0.10, the compile errors will be gone.
It seems that the latest updates for libuv is not yet supported by Cassandra cpp-driver.