Git Product home page Git Product logo

Comments (2)

jjgcc avatar jjgcc commented on September 27, 2024

Fixed, the way I did it was the following:

Instead of installing the libyaml-cpp-dev from Ubuntu official repositories, I downloaded the latest version from https://github.com/jbeder/yaml-cpp/archive/master.zip, as stated in the doc/INSTALL.txt (alternative way).

Once yaml-cpp was built and installed in a custom folder of mine, I modified the noxim Makefile to read:

##### LIBRARIES CONFIGURATION #####

SYSTEMC := /home/juanjosegcc/local/systemc/2.3.1a
YAML    := /home/juanjosegcc/local/yaml-cpp/0.5.3


##### DIRECTORIES #####

SYSTEMC_LIBS := $(wildcard $(SYSTEMC)/lib-*)

SRCDIR  := ../src
SUBDIRS := $(filter %/,$(wildcard $(SRCDIR)/*/))
OBJDIR  := ./build

SRCS := $(wildcard $(SRCDIR)/*.cpp) $(wildcard $(addsuffix *.cpp,$(SUBDIRS)))
OBJS := $(subst $(SRCDIR),$(OBJDIR),$(SRCS:.cpp=.o))

MODULE := noxim


##### COMPILER OPTIONS #####

CXX      := g++
OPT      := -O3
DEBUG    := # -g -DDEBUG
OTHER    := -Wall -DSC_NO_WRITE_CHECK -std=c++11# -Wno-deprecated
CXXFLAGS := $(OPT) $(OTHER) $(DEBUG)

INCDIR := -I$(SRCDIR) -isystem $(SYSTEMC)/include -I$(YAML)/include
LIBDIR := -L$(SRCDIR) -L$(SYSTEMC_LIBS) -L$(YAML)/lib

LIBS := -lsystemc -lm -lyaml-cpp 

SPACE := $(subst ,, )
VPATH := $(SRCDIR):$(subst $(SPACE),:,$(SUBDIRS))

##### RULES #####

$(MODULE): $(OBJS)
	$(CXX) $(LIBDIR) $^ $(LIBS) -o $@ 2>&1 | c++filt

$(OBJDIR)/%.o: %.cpp
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) $(INCDIR) -c $< -o $@

clean:
	rm -f $(OBJS) $(MODULE) *~

depend: 
	makedepend $(SRCS) -Y -f- 2>/dev/null | sed 's_$(SRCDIR)_$(OBJDIR)_' > Makefile.deps

-include Makefile.deps

As you can see the variables SYSTEMC and YAML at the beginning were modified with my custom folders (just as the doc/INSTALL.txt suggests), but also in variable OTHER you should add the compiler option -std=c++11 in order to build with the yaml-cpp library.

Thats it! Looks like the latests version in Ubuntu repositories of yaml-cpp is v.0.5.2, but the version downloaded from the author's repository is v0.5.3.

Kind regards

from noxim.

Jiji10 avatar Jiji10 commented on September 27, 2024

Hello,
I have the same problem, when I execute Noxim, I have the following error:
./noxim -config ../config_examples/default_config.yaml

SystemC 2.3.1-Accellera --- Nov 20 2017 10:56:41
Copyright (c) 1996-2014 by all Contributors,
ALL RIGHTS RESERVED

Noxim - the WNoC Simulator
(C) University of Catania

Adaptations by LGGM - UdeA

Loading configuration from file "../config_examples/default_config.yaml"... Done
Loading power configurations from file "power.yaml"... Done

Error: (E549) uncaught exception: yaml-cpp: error at line 0, column 0: invalid node; this may result from using a map iterator as a sequence iterator, or vice-versa
In file: ../../../../src/sysc/kernel/sc_except.cpp:100

The noxim Makefile is as follow:
`##### LIBRARIES CONFIGURATION #####
SYSTEMC := /usr/local/systemc-2.3.1
YAML := /usr/local/include/yaml-cpp

DIRECTORIES

SYSTEMC_LIBS := $(wildcard $(SYSTEMC)/lib-*)

SRCDIR := ../src
SUBDIRS := $(filter %/,$(wildcard $(SRCDIR)/*/))
OBJDIR := ./build

SRCS := $(wildcard $(SRCDIR)/*.cpp) $(wildcard $(addsuffix *.cpp,$(SUBDIRS)))
OBJS := $(subst $(SRCDIR),$(OBJDIR),$(SRCS:.cpp=.o))
DEPS := $(OBJS:.o=.d)

MODULE := noxim

COMPILER OPTIONS

CXX := g++
OPT := -O3 -MMD
DEBUG := #-g -DDEBUG
#OTHER := -Wall# -Wno-deprecated
OTHER := -Wall -DSC_NO_WRITE_CHECK -std=c++11# -Wno-deprecated
...
`

from noxim.

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.