FennelBuildVariations
From Eigenpedia
The main control over the way Fennel code gets generated is the --with[out]-optimization initBuild.sh flag. The setting for this flag implies defaults for two other flags (--with[out]-debug and --with[out]-assertions), although those two flags can always be specified explicitly.
| initBuild.sh flag | implied default for debug symbols | implied default for assertions | compiler optimizations | STL bounds-checking | cache buffer paranoia | OpaqueInteger impl |
|---|---|---|---|---|---|---|
| --with-optimization | --without-debug | --without-assertions | -O3 | disabled | disabled | weakly typed (primitive int) |
| --without-optimization (default) | --with-debug | --with-assertions | none | enabled | enabled | strongly typed (class) |
- The --with[out]-assert flag controls whether the standard assert macro generates assertion-checking code (--with) or is treated as a NOP (--without). Note that Fennel supports a non-standard permAssert macro which always generates assertion-checking code regardless of this build variation.
- The --with[out]-debug flag only controls whether debug symbols are included in compiled binaries; it does not have any effect on the efficiency of the code generated.
- The --with-assertions option is currently only proposed and has not yet been implemented.
- There are no prohibited combinations, although some combinations aren't very useful.
Shortcuts
Various options exist to reduce the amount of time a Fennel "initial" build takes.
The --with[out]-tests flag controls whether or not unit tests are executed. They are skipped by default, but should be executed before checking in code.
The --without-thirdparty-build flag (also known as --without-fennel-thirdparty-build, --skip-thirdparty-build and --skip-fennel-thirdparty-build) skips building the Boost and STLport libraries. This is safe to do as long as you're certain that neither library has been upgraded since you last built it. The initBuild.sh script builds both the release and debug versions of the libraries, so switching Fennel's optimization and debug symbols is also okay.
In addition, Fennel's makefiles have enough dependency information in them to allow parallel execution in make. Running make -j2 can improve build times significantly. When running initBuild.sh you can specify the environment variable MAKEFLAGS to automatically enable a parallel build:
MAKEFLAGS=-j2 ./initBuild.sh
Note, however, it is unwise to place MAKEFLAGS=-j2 in your shell startup scripts since build errors can occur if you execute a makefile from another project that doesn't have sufficient dependencies between targets.
| Architecture / Build Config | Parallelism | Time (nearest 15s) |
|---|---|---|
| Intel Core 2 Duo, 2GHz, 2GB, Laptop / Unoptimized | none | 11m |
| -j2 | 7m | |
| -j3 | 6m 30s | |
| -j4 | 6m 30s | |
| 4 x dual core AMD Opteron 2210, 1.8 GHz, 8GB, Server / Unoptimized | none | 17m 15s |
| -j2 | 10m | |
| -j4 | 7m | |
| -j8 | 6m 45s | |
| 4 x dual core AMD Opteron 2210, 1.8 GHz, 8 GB, Server / Optimized | none | 22m 30s |
| -j2 | 12m 30s | |
| -j4 | 7m 45s | |
| -j8 | 7m 30s |
These times include only the time it takes to execute Fennel's Makefile after executing make clean.

