it was very silent on my blog during the last year, but today I would like to share some insight on how to compile gridlab-d on a Linux x64 platform. This software can be used to simulate the power flow in a power grid and I had to deal with it during some projects I currently work on.
Since I have the feeling that something is misconfigured in the sourceforge svn of gridlab, I provide here some instructions how you can get the source of gridlab-d compiled and working.
First of all, some info about my system, since I think this is helpful/necessary:
$ uname -a Linux machine 3.17.0-031700-generic #201410060605 SMP Mon Oct 6 10:07:09 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ autoreconf --version autoreconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille. --- Autoconf 2.50 chosen by Debian wrapper script. For information and tuning advice see autoconf(1).
Download and compile gridlabd v3.2
For getting version 3.2 of gridlab-d running I am basically following the step described here: http://gridlab-d.sourceforge.net/wiki/index.php/Linux/Unix
- Download the source of the specific branch:
svn co https://svn.code.sf.net/p/gridlab-d/code/branch/3.2 ./gld3.2
- compile with
Fix the occurring error
Here I got the following error:
./core/version.h:11:75: fatal error: build.h: No such file or directory #include "build.h" // BRANCH will be defined automatically from the ticket ^ compilation terminated. make: *** [assert/assert_assert_la-assert.lo] Fehler 1 make: Verzeichnis »~/gld3.2« wird verlassen
Hmm, it seems that a file is missing in /core. After some googling I found this discussion: https://sourceforge.net/p/gridlab-d/discussion/842562/thread/7202ec1d/
My understanding is, that the missing file (./core/build.h) should in some way automatically be created while cloning the repository using svn checkout. Unfortunately, this did not happen for me.
touch ./core/build.h nano ./core/build.h
#define BUILD "$Revision: 5442" #define BUILDNUM 5442
I retrieved the numbers using the “svn info .” command. There you find a field named Revision, which I used to fill the two defines … my understanding is, that this information is just to distinguish the various binaries in the end. Long story short, basically you can provide any number you want, as long as you can make sense of them identifying the binaries you built.
Now, your can rerun these steps:
Testing the compiled binary
After some time and a lot of messages scrolling on your screen, make is finished. Check the version of the compiled binary:
./gridlabd.bin --version GridLAB-D 3.2.1-5442 (Jojoba) 64-bit LINUX RELEASE
you also can check the functionality of gridlab with “./gridlabd.bin –validate”, which gives me a lot of debug output and in the very end an overview like this:
./gridlabd.bin --validate ... Validation report: 469 models tested 4 unexpected errors 465 tests succeeded 99% success rate Total validation elapsed time: 253.9 seconds See '~/gld3.2/validate.txt' for details
This took me some time to figure it out. I hope this helps somebody having the same issues with gridlabd version 3.2. As stated above, this should work for Revision 5442 of the sourceforge svn files, and very likely for earlier stages for branch 3.2