|
| 1 | +Installing and building - all platforms |
| 2 | +--------------------------------- |
| 3 | +Hector relies on several libraries, all of which are freely available |
| 4 | +under a GPL or similar license. In order to build and run Hector, you |
| 5 | +will need to download and install these libraries on your system. These include: |
| 6 | + |
| 7 | +* *REQUIRED*: Boost. Free peer-reviewed portable C++ source libraries, available at http://www.boost.org/. |
| 8 | +Hector uses only the parts of Boost that are implemented as header libraries (i.e., all of the code is |
| 9 | +contained in header files that are included and compiled with the Hector source). Therefore, all you need to |
| 10 | +do to set up Boost is to download and extract it. Hector requires Boost version ≥ 1_52_0. |
| 11 | + |
| 12 | +* *REQUIRED*: Gnu Scientific Library. A numerical library for C and C++, available at http://www.gnu.org/software/gsl/. You will need to download and follow the Boost README instructions. You will need to compile and install the GSL. To do this, unpack the GSL tar file in the location of your choice. Follow the setup instructions in the GSL README file. Briefly, they comprise three steps: `./configure`, `make`, and `make install`. You will need to have root (superuser) privilege to perform the last step, unless you choose an install directory somewhere under your own home directory (see the GSL README for instructions on how to do this). Hector has been tested with, and is currently using, GSL version 1.16. |
| 13 | + |
| 14 | +Installing and building - Mac OS X (Xcode) |
| 15 | +--------------------------------- |
| 16 | + |
| 17 | +These directions assume a basic familiarity with Xcode and Mac OS X software installation. (If you're going to use `make` and not Xcode, see Linux directions below.) |
| 18 | + |
| 19 | +* Install [Xcode](https://developer.apple.com/xcode/downloads/) if necessary. Hector has been built and tested with Mac OS 10.8.5 ~~and 10.10 (Yosemite)~~. The project files are for Xcode 5.1.1. |
| 20 | +* Download and install Boost and GSL, following instructions above. |
| 21 | +* Download the [Hector zip file](https://github.com/JGCRI/hector/archive/master.zip) or check out the repository using Git. |
| 22 | +* From Xcode, open the project file in `project_files/Xcode/hector.cxodeproj`. |
| 23 | +* Build the project. See below if you encounter errors. |
| 24 | +* Change the current Scheme settings (Scheme->Edit Scheme) and add a command-line argument (*Arguments* tab, e.g. "input/hector_rcp45.ini"). |
| 25 | +* Run! |
| 26 | + |
| 27 | +Xcode Build Settings to check/change if you encounter build errors: |
| 28 | +* *Architectures-Base SDK*: OS X 10.8 [or OS X version on machine] |
| 29 | +* *Build Options-Compiler for C/C++/Objective-C*: Default compiler (Apple LLVM 5.1) |
| 30 | +* *Search Paths-Header Search Paths*: "/usr/local/include /usr/local/lib/boost_1_52_0/" [or other header directories] |
| 31 | +* *Search Paths-Library Search Paths*: "/usr/local/lib/" [or other library directories] |
| 32 | +* *LLVM-Language-C++-C++ Standard Library*: libc++ (LLVM C++ standard library with C++11 support) |
| 33 | +* *Linking-Other Linker Flags*: "-lgsl -lgslcblas -lm" |
| 34 | +* *User-Defined*: "GCC_MODEL_TUNING" defined as "G5" |
| 35 | + |
| 36 | + |
| 37 | +Installing and building - Windows |
| 38 | +--------------------------------- |
| 39 | +* Install Visual Studio, if necessary. |
| 40 | +* Download and install *Boost* and *GSL*, following instructions above. |
| 41 | +* Download the [Hector zip file](https://github.com/JGCRI/hector/archive/master.zip) or check out the repository using Git. |
| 42 | +* TODO |
| 43 | + |
| 44 | +Installing and building - Linux |
| 45 | +--------------------------------- |
| 46 | +The Hector makefiles look for the required libraries (above) in certain default |
| 47 | +locations, but those defaults can be overridden by setting the |
| 48 | +environment variables described below. |
| 49 | + |
| 50 | +**Boost** |
| 51 | + |
| 52 | +Environment variables: |
| 53 | + |
| 54 | +* BOOSTROOT (default `$(HOME)/src/boost_$(BOOSTVERSION)`). |
| 55 | +This variable should contain the full name of the directory created |
| 56 | +when you unpacked Boost. If you unpacked Boost in `$(HOME)/src`, then |
| 57 | +all you need to do is set the `BOOSTVERSION` variable (*q.v.* below) and leave this variable |
| 58 | +at its default value. If you unpacked Boost somewhere else, or if you changed the name |
| 59 | +of the directory that was created when you unpacked it, then you will |
| 60 | +need to set this variable explicitly. |
| 61 | + |
| 62 | +* BOOSTVERSION (default: `1_52_0`). This variable should contain the |
| 63 | +version number of the version of Boost that you installed. The |
| 64 | +version number will appear in the name of the tar file you |
| 65 | +downloaded. The `BOOSTVERSION` variable is used in the default value of `BOOSTROOT` to determine the default installation |
| 66 | +directory. If you override the default value of `BOOSTROOT` you can ignore this variable. |
| 67 | + |
| 68 | +**GNU Scientific Library (GSL)** |
| 69 | + |
| 70 | +The default |
| 71 | +install location for GSL is /usr/local, and that is also the default for |
| 72 | +Hector. Therefore, if you use the GSL default installation procedure, |
| 73 | +you will not need to override the Hector defaults. If you choose to |
| 74 | +install GSL somewhere else, use the environment variable below to indicate |
| 75 | +where you installed it. |
| 76 | + |
| 77 | +Environment variables: |
| 78 | + |
| 79 | +* GSLROOT (default: `/usr/local`). |
| 80 | + Set this variable to the same install directory that you used when you |
| 81 | + configured GSL. |
| 82 | + |
| 83 | +**Shared Library Search Path** |
| 84 | + |
| 85 | +Some of the libraries used by Hector (such as the GSL) will be |
| 86 | +compiled into shared libraries that will loaded at run time. It is |
| 87 | +best if these libraries are in directories that are part of your |
| 88 | +system's shared library search path. On many systems `/usr/local` is |
| 89 | +already in that path. If you install the libraries somewhere else, |
| 90 | +you may need to add the installation directories to the list given in |
| 91 | +`/etc/ld.so.conf`. Whether or not you install the GSL libraries in the default location, when you compile and install them |
| 92 | +you may need to refresh the library cache by running |
| 93 | +`ldconfig` (which generally requires root privilege), or by rebooting your system |
| 94 | +(which does not). |
| 95 | + |
| 96 | +If you are unable to add your library installation directory to the |
| 97 | +library search path, you will need to add the installation directory |
| 98 | +to the environment variable `LD_LIBRARY_PATH`. Try not to use this approach if you |
| 99 | +can help it because it can cause some conflicts with other software on your system. |
| 100 | +Instead, ask your system administrator if ldconfig is right for you. |
| 101 | + |
| 102 | +**Building Hector** |
| 103 | + |
| 104 | +Once the necessary libraries are installed, change to the top-level |
| 105 | +Hector directory and type `make hector`. The hector executable will |
| 106 | +be built in the `source/` subdirectory. If you ever need to rebuild, |
| 107 | +you can type `make clean` to clear away the executable and all of the |
| 108 | +intermediate files. |
| 109 | + |
| 110 | +There are two additional environment variables that you can use to |
| 111 | +fine-tune the build process. The `CXXEXTRA` variable is passed to the |
| 112 | +C++ compiler. You can use this variable to pass extra options to the |
| 113 | +compiler without changing the Makefile. In particular, specifying |
| 114 | +optimization options in `CXXEXTRA` such as -O or -O0 will override the |
| 115 | +default value of -O3. |
| 116 | + |
| 117 | +The `CXXPROF` variable is passed both to the compiler and the linker. |
| 118 | +It is intended to turn on performance profiling, which must be |
| 119 | +specified at both the compile and link stages of the build, so it |
| 120 | +generally should be either unset (for normal operation) or set to -pg |
| 121 | +(for profiling). Profiling slows the code down dramatically, so if you use it, be |
| 122 | +sure to unset `CXXPROF`, clean the build directories with `make clean`, |
| 123 | +and rebuild when you are ready to go back to |
| 124 | +production runs. |
| 125 | + |
| 126 | +Installing and building - iOS/Android |
| 127 | +--------------------------------- |
| 128 | +Not yet. ;) |
0 commit comments