Getting Started with GridLAB-D
Copyright (C) 2008 Battelle Memorial Institute

Building GridLAB-D with the Auto-Toolset Under Linux and Other Unix Variants
You must have autoconf, automake, libtool, and xerces-c install to
build GridLAB-D in this way.

If you are building from a release distribution you must first run:

      % cd <source-path>
	  % autoreconf -if
      % ./configure --enable-silent-rules 'CFLAGS=-g -O0 -w' 'CXXFLAGS=-g -O0 -w' 'LDFLAGS=-g -O0 -w'
      % make
	  % make install

Build GridLAB-D from the makefiles provided in the distribution, which will
create targets in the same directory as the input source.  Libraries are
created using libtool which outputs libraries in a directory named '.libs' in
the input's source directory.  Use 'make install' to install GridLAB-D on the
system.  You must be superuser (or use sudo) to install to the system. If you
want to install GridLAB-D to a different location, add the following option to the configure step:

      % ./configure ... --prefix=<install-path>.

where <install-path> is the full path to the installation directory.

To enable the MATLAB link with GridLAB-D add the following option to the configure step:

	  % ./configure ... --with-matlab=<matlab-install-path>

The matlab-install-path should point to where the extern folder is located. An example could be /usr/local/MATLAB/R2015a. In order to successfully run GridLAB-D with MATLAB, LD_LIBRARY_PATH must contain the location to libeng.so and libmx.so. An example location could be:

	  % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB/R2015a/bin/glnxa64

To enable FNCS with GridLAB-D add the following option to the configure step:

	  % ./configure ... --with-fncs=<fncs-install-path>

The matlab-install-path should point to where the extern folder is located. An example could be /usr/local. In order to successfully run GridLAB-D with FNCS, LD_LIBRARY_PATH must contain the location to libfncs.so, libzmq.so and libczmq.so. An example location could be:

	  % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Whenever changes have been made to configure.ac or any of the makefile.am
files, the following build steps must be executed from the source-path folder:
	1. Use 'autoreconf -if' to update the configure script.
	2. Use './configure' to create the makefiles.
	3. Repeat the above command to make the project as usual.

Make should detect changes to configure.ac and makefile.am files and
automatically rerun steps 1 and 2 as needed.  If files are added to a module,
add the filename to makefile.am in that module's directory and remake. If make
does not automatically perform the required steps, rerun autoreconf -if and
./configure manually.

To distribute the source code, it is best to check out a clean copy of the
source code and then package the resulting source tree using the
utilities/release-src command from the <source-path> directory.
