-
Notifications
You must be signed in to change notification settings - Fork 31
Building Guide
This build guide is intended for developers who will be frequently building and debugging multiple versions of HiPAS GridLAB-D on their systems.
HiPAS GridLAB-D uses autotools
to configure and build gridlabd
. Aside from the required build files Makefile.am
and configure.ac
a number of ancillary files and folders are also used during the configure and make processes.
-
.github/
: This folder contains the files needed by GitHub to run automated actions. It also contains the issues template. -
build_aux/
: This folder contains a version identification script use bymake
and platform-specific setup scripts used byinstall.sh
. -
docker/
: This folder contains the files need to build docker images. -
`m4/': This folder contains the autom4te files needed to build required libraries and packages, including SuperLU, Xerces, Doxygen, Pthread, and Curses.
-
third_party/
: This folder contains the third-party libraries needed to buildgridlabd
. -
utilities/
: This folder contains support utilities used byconfigure
andmake
to buildgridlabd
.
-
am include.mk
: This file containsautomake
rules for components in GridLAB-D. -
checkpkgs
: This script is used to verify that the directories list inMakefile.am
are ready for use byautoreconf
. -
configure.ac
: This file is the mainautoconf
configuration control file for GridLAB-D. -
configure.opt
: This file contains the default configuration options used when runningconfigure
. -
custom.mk
: The file contains the list of optional modules enabled when building GridLAB-D. -
customize
: This script controls the options used by theconfigure
script. -
gldmake
: This script provides a shell menu-based build environment. -
gridlabd.spec.in
: This file contains theconfigure
specification for the GridLAB-D application -
install.conf-default
: This file contains the default options for theinstall.sh
setup script. -
install.sh
: This script is used to install GridLAB-D on a new system. -
Makefile.am
: This file contains the mainmakefile
template for GridLAB-D. -
modules.mk
: This file contains a list of the modules that must be built for a complete GridLAD-B installation -
requirements.txt
: This file contains the Python modules and versions required by GridLAB-D.
-
.../Makefile.mk
: Many folders includeMakefile.mk
which will be consulted whenmake
is run. -
.../requirements.txt
: All files namedrequirements.txt
will be consulted when python is updated.
There are many targets support by make
. To get a comprehensive list, use make help
. The most important targets are the following:
-
install
: This target installsgridlabd
in the target folder. By default, the target folder is/usr/local/opt/gridlabd/VERSION-BUILD-BRANCH
. Use the--prefix=FOLDER
to change the target folder. -
system
: This target installgridalbd
in the target folder and link the system files to that target so all users will have access to it from the/usr/local/bin/gridlabd
. -
clean
: This target removes all the intermediate files created during a build. -
clean-wc
: This target removes all the untracked files in the source tree. -
reconfigure
: This target regenerates and runs theconfigure
file after the branch name has changed. This is necessary before usingmake system
to avoid target folder inconsistencies due to the change in the branch name.
HiPAS GridLAB-D includes a version control subcommand that allow developers to quickly change the version in use by the local host.
-
Show the current version:
gridlabd version show
-
Obtain a list of installed versions:
gridlabd version list
-
Set the version for the system:
gridlabd version set NAME
-
Remove a version from the system:
gridlabd version delete NAME
In addition, the docker
subcommand can be used to enable the use of a docker image instead of the locally installed build. When a docker image tag name gridlabd
exists, then the local gridlabd will use the docker image instead of the local install.
-
To enable a docker image:
gridlabd docker enable NAME
-
To disable a docker image:
gridlabd docker disable
-
To determine the docker image status:
gridlabd docker status
When developing code in docker images you can map your local host's files in the source volume in the docker container. For example, you can clone the repository on your local host:
$ git clone https://source.gridlabd.us/ -b develop gridlabd
This allows you to edit and do git operation on your local host.
Then you can start the docker container to build and test the system:
$ docker run -it -v $PWD/gridlabd:/usr/local/src/gridlabd slacgismo/gridlabd:latest bash
# cd /usr/local/src/gridlabd
# export MAKEFLAGS=-j$(nproc)
# autoreconf -isf && ./configure && make system
...
# gridlabd -T 0 --validate
...
If you want to test installs from scratch, the do the following:
$ docker run -it -v $PWD/gridlabd:/usr/local/src/gridlabd BASEIMAGE bash
# cd /usr/local/src/gridlabd
# ./install.sh -v
...
where BASEIMAGE
is the desired docker base container image, e.g., debian:10
, ubuntu:20_04
.
Copyright © 2020-2022, Regents of the Leland Stanford Junior University
This site is maintained by SLAC GISMo at SLAC National Accelerator National Laboratory, which is operated by Stanford University for the US Department of Energy under Contract DE-AC02-76RL00515.