Friday, February 8, 2008

Modify a DGL program

If you wish to change the DGL program, you pretty much need to change the
code and rebuild.

The good news is that you don't have to rebuild everything if you just change
a class implementation or DSO.

For example, if you change DGLWindow.cpp, all you need to do is to cd to the
directory it's in and type "make install".

If you change an include file you pretty much need to rebuild everything.

Do you do out of core builds and installs? That's where you give cmake the
CMAKE_INSTALL_PREFIX option to tell it where to install stuff, and you give
cmake a final option about where to find the source.

For example, say you keep your source, build and install directories all
under a directory called $DIVERSE. It has a single directory, source, that
you downloaded DIVERSE into.

cd $DIVERSE
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=$DIVERSE
/installed ../source

This will tell cmake to read files from the source directory and install in
the install directory.

If you change DGLWindow.cpp, you edit it in the source directory,
$DIVERSE/source/dgl/lib/dgl and run the "make install" command in the build
directory, $DIVERSE/build/dgl/lib/dgl

If you need to chanhe the include file, DGLWindow.h, you edit the source in
$DIVERSE/source/dgl/include/dgl. Build in $DIVERSE/build/dgl

Use the "j" option to make to do parallel makes. If you have two CPUs,
type: "make -j2 install" and things will go up to twice as fast.

No comments: