Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

377 lines (327 sloc) 16.755 kb
<?xml version="1.0" encoding="utf-8"?>
<!--
################################################################################
# Copyright (C) 2011 HPCC Systems.
#
# All rights reserved. This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
################################################################################
-->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<book lang="en_US">
<bookinfo>
<title>HPCC Source</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/redswoo0.jpg" />
</imageobject>
</mediaobject>
<author>
<surname>Boca Documentation Team</surname>
</author>
<legalnotice>
<para>
We welcome your comments and feedback about this document via
email to <email>docfeedback@lexisnexis.com</email> Please include
<emphasis role="bold">Documentation Feedback</emphasis> in the subject
line and reference the document name, page numbers, and current Revision
Number in the text of the message.
</para>
<para>
LexisNexis and the Knowledge Burst logo are registered trademarks
of Reed Elsevier Properties Inc., used under license. Other products and
services may be trademarks or registered trademarks of their respective
companies. All names and example data used in this manual are
fictitious. Any similarity to actual persons, living or dead, is purely
coincidental.
</para>
<para></para>
</legalnotice>
<releaseinfo>
Copyright (C) 2011 HPCC Systems.
All rights reserved. This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see http://www.gnu.org/licenses
</releaseinfo>
<date>2011-01-11</date>
<corpname>LexisNexis</corpname>
<copyright>
<year>2011 LexisNexis Risk Solutions. All rights reserved</year>
</copyright>
<mediaobject role="logo">
<imageobject>
<imagedata fileref="images/LN_Horz.gif" scale="45" />
</imageobject>
</mediaobject>
</bookinfo>
<chapter>
<title>Overview</title>
<para>
This manual contains a description of the HPCC sources.
</para>
</chapter>
<chapter>
<title>Getting the sources</title>
<para>
The HPCC Platform sources are hosted on GitHub at
https://github.com/hpcc-systems/HPCC-Platform. You can download a
snapshot of any branch using the download button there, or you can set
up a git clone of the repository. If you are planning to contribute
changes to the system, see the file CONTRIBUTORS at
https://github.com/hpcc-systems/HPCC-Platform/blob/master/CONTRIBUTORS
for information about how to set up a GitHub fork of the project
through which pull-requests can be made.
</para>
</chapter>
<chapter>
<title>Building the system from sources
</title>
<sect1>
<title>Requirements</title>
<para>
The HPCC platform requires a number of third party tools and libraries in order to build.
On Ubuntu 11, the following commands will install the required libraries
<programlisting>
sudo apt-get install cmake
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libicu-dev
sudo apt-get install libboost-regex-dev
sudo apt-get install binutils-dev
sudo apt-get install libxerces-c2-dev
sudo apt-get install libxalan110-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libssl-dev
sudo apt-get install libldap2-dev
sudo apt-get install expect
</programlisting>
</para>
</sect1>
<sect1>
<title>Building the system</title>
<para>
The HPCC system is built using the cross-platform build tool cmake,
which is available for Windows, virtually all flavors of Linux,
FreeBSD, and other platforms. You should install cmake version
2.8.3 or later before building the sources.
On some distros you will need to build cmake from sources if the version
of cmake in the standard repositories for that distro is not modern enough.
It is good practice in cmake to separate the build directory where
objects and executables are made from the source directory, and the
HPCC cmake scripts will enforce this.
To build the sources, create a directory where the built files should
be located, and from that directory, run
<programlisting>
cmake &lt;source directory&gt;
</programlisting>
Depending on your operating system and the compilers installed on it,
this will create a makefile, Visual Studio .sln file, or other build
script for building the system. If cmake was configured to create a
makefile, then you can build simply by typing
<programlisting>
make
</programlisting>
If a Visual Studio solution file was created, you can load it simply
by typing the name:
<programlisting>
lexisnexisrs.sln
</programlisting>
This will load the solution in Visual Studio where you can build in the
usual way.
</para>
</sect1>
<sect1>
<title>Packaging</title>
<para>
To make an installation package on a supported linux system, use the
command
<programlisting>
make package
</programlisting>
This will first do a make to ensure everything is up to date, then will
create the appropriate package for your operating system, Currently supported
package formats are rpm (for RedHat/Centos and SuSE) and .deb (for Debian and
Ubuntu). If the operating system is not one of the above, or is not recognized,
make package will create a tarball.
</para>
</sect1>
<sect1>
<title>Debugging a system</title>
<para>
On linux systems, the makefile generated by cmake will build a specific
version (debug or release) of the system depending on the options selected
when cmake is first run in that directory. The default is to build a release
system. In order to build a debug system instead, use
command
<programlisting>
cmake -DCMAKE_BUILD_TYPE=Debug &lt;source directory&gt;
</programlisting>
You can then run make or make package in the usual way to build the system.
</para>
<para>
On a Windows system, cmake always generates s solution file with both debug and
release target platforms in it, so you can select which one to build within
Visual Studio.
</para>
</sect1>
</chapter>
<chapter>
<title>Coding conventions</title>
<sect1>
<title>Why coding conventions</title>
<para>
Everyone has their own ideas of what the best code formatting style is, but most
would agree that code in a mixture of styles is the worst of all worlds. A
consistent coding style makes unfamiliar code easier to understand and navigate.
In an ideal world, the HPCC sources would adhere to the coding standards described
perfectly. In reality, there are many places that do not. These are being cleaned up
as and when we find time.
</para>
</sect1>
<sect1>
<title>C++ coding conventions</title>
<para>
For the most part out coding style conventions match those described at
http://geosoft.no/development/cppstyle.html, with a few exceptions or extensions as
noted below.
</para>
<sect2>
<title>Source files</title>
<para>
We use the extension .cpp for C++ source files, and .h or .hpp for header files.
Header files with the .hpp extension should be used for headers that are internal
to a single library, while header files with the .h extension should be used for
the interface that the library exposes. There will typically be one .h file per
library, and one .hpp file per cpp file.
Source file names within a single shared library should share a common prefix to aid
in identifying where they belong.
Header files with extension .ipp (i for internal) and .tpp (t for template) will
be phased out in favour of the scheme described above.
</para>
</sect2>
<sect2>
<title>Identifiers</title>
<para>
We generally follow the java conventions for identifier naming and formatting.
</para>
<para>
Class and interface names are in CamelCase with a leading capital letter.
Interface names should be prefixed capital I followed by another capital.
Class names may be prefixed with a C if there is a corresponding I-prefixed
interface name, but need not be otherwise.
</para>
<para>
Variables, function and method names, and parameters use camelCase starting with a
lower case letter. Parameters may be prefixed with underscore.
</para>
</sect2>
<sect2>
<title>Indentation</title>
<para>
We use 4 spaces to indent each level. TAB characters should not be used. There is
some discussion about possibly changing to a 2-space indentation convention at some
point in the future.
</para>
<para>
The { that starts a new scope and the corresponding } to close it are placed on a
new line by themselves, and are not indented. This is sometimes known as the Allman
or ANSI style.
</para>
</sect2>
<sect2>
<title>Comments</title>
<para>
We generally believe in the philosophy that well written code is self-documenting.
javadoc-formatted comments for classes and interfaces are being added.
</para>
</sect2>
<sect2>
<title>Namespaces</title>
<para>
We do not use namespaces. We probably should, following the Google style guide&apos;s
guidelines - see http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces
</para>
</sect2>
<sect2>
<title>Other</title>
<para>
We often pretend we are coding in Java and write all our class members inline.
</para>
</sect2>
</sect1>
<sect1>
<title>Other coding conventions</title>
<sect2>
<title>ECL code</title>
<para>
The ECL style guide is published separately.
</para>
</sect2>
<sect2>
<title>Javascript, XML, XSL etc</title>
<para>
We use the commonly accepted conventions for formatting these files.
</para>
</sect2>
</sect1>
</chapter>
<chapter>
<title>Design Patterns</title>
<sect1>
<title>Why Design Patterns?</title>
<para>
Consistent use of design patterns helps make the code easy to understand.
</para>
</sect1>
<sect1>
<title>Interfaces</title>
<para>
While C++ does not have explicit support for interfaces (in the java sense), an
abstract class with no data members and all functions pure virtual can be used
in the same way.
</para>
</sect1>
<sect1><title>Reference counted objects</title><para/></sect1>
<sect1><title>STL</title><para/></sect1>
</chapter>
<chapter>
<title>Structure of the HPCC source tree</title>
<section>
<title>Introduction</title>
<para/>
</section>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cmake_modules/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="common/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dali/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="deployment/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ecl/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ecllibrary/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="esp/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="initfiles/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="plugins/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="roxie/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="rtl/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="services/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="system/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="testing/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="thorlcr/sourcedoc.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tools/sourcedoc.xml" />
</chapter>
</book>
Jump to Line
Something went wrong with that request. Please try again.