Troubleshooting
Compilation steps
Executing 'make' in the directory where powerDEVS-code was downloaded can give some error. Here are some of them and how to solve them.
use 'locate qmake' to check where QT was installed. Then run the following commands acordingly:
export PATH=/usr/lib64/qt4/bin/:$PATH (replace with the path in your machine)
and try compiling again.
the source is developed to compile using QT4. This error can be because you are trying to compile with a newer version. To check the version of QT you can use: 'which qmake':
/usr/lib64/
qt4/bin/qmake
Another way is to use qmake --version. This will show you something like this:
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib/x86_64-linux-gnu
If the Qt version is less than the one in the example (even if it is 4.X.X) it may not work. In this case, you could install a new version using this command: sudo apt-get install libqt4-dev qt4-dev-tools qt4-doc
(in CENTOS: sudo yum install opt-libqt4-devel. You will probably need to change the path of qmake in the Makefile to /usr/lib64/qt4/bin/qmake)
GNU Plot
In order to use gnuplot graphs, update the gnuplot.cpp file:
Line: 125
If(getOS = WINDOWS)
Strcpy(buff,
“pause 3600”);
Network Library
- Install GSL
- sudo yum install -y qt-creator
- use /engine/makefile.include as attached. Contains the following lines (inboldthings I changed):
ifeq ($(UNAME), Linux)
..
CXXFLAGS = -Wall $(OPTFLAGS)-DO_BINARY=0
..
GSLLIB = /usr/local/lib
GSLINC = /usr/local/include/gsl
LIBS = -lsimpd -lgsl-L$(GSLLIB)
..
INCLUDES = -I$(SRCENGINE) -I$(ATOMICS) -I$(BUILD) -L$(BUILDLIB)-I$(GSLINC) -lgslcblas
- add PDNL models to Atomic folder (sinks, hybrid and examples folder).
- If you get this compilation error: "open with O_CREAT in second argument needs 3 arguments"
- It might be related to a bug in gcc version.
- Change lines 18 and 20 of file hybrids/logtoscilabtool.cpp adding the 3rd argunemt with value 0666 as follows:
if (getOs()==WINDOWS)
FOutHandler = open(FName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666 );
else
FOutHandler = open(FName, O_WRONLY | O_CREAT | O_TRUNC, 0666);
GCC
In SCL6 you might need to update GCC version.
Or you can also set the devtoolset g++ for your system:
Moving Powerdevs out home directory
If you need to have your installation of
PowerDEVS outside the HOME folder, you need to:
-
Update the /powerdevs/bin/loadBackDoor.sce file as follows:
[a,err]=file('open', pwd() + '/../bin/BackDoor/loader.sce',"old");
if err==240 then
exec(pwd() + '/../bin/BackDoor/builder.sce','errcatch');
exec(pwd() + '/../bin/BackDoor/builder.sce');
end
exec(pwd() + '/../bin/BackDoor/loader.sce');
--
LucioEmilioSanti - 2018-08-10