| 1 |
The GNU APL interpreter can be configured by means of ./configure options. |
| 2 |
The standard ./configure options are described in file INSTALL in this |
| 3 |
directory. |
| 4 |
|
| 5 |
In addition to the standard options provided by ./configure the following GNU |
| 6 |
APL specific ./configure options are recognized. If an option is NOT given |
| 7 |
on the ./configure command line, then either the default value for the option |
| 8 |
is used (if the option has one), or else the behavior described below for |
| 9 |
the option will not occur. |
| 10 |
|
| 11 |
--with-android |
| 12 |
This option prevents the instantiation of CIN, COUT, and CERR. This may |
| 13 |
be needed when GNU APL is compiled for Android, since Android applications |
| 14 |
use a different I/O model than standard C++ programs. |
| 15 |
|
| 16 |
--with-libapl |
| 17 |
This option builds GNU APL as a shared library (libapl.so) rather than an |
| 18 |
executable program. This option is often combined with option |
| 19 |
--with-android, and is automatically set by option --with-erlang. The |
| 20 |
--with-libapl option not only creates approproate Makefiles, but it also |
| 21 |
changes the GNU APL code in some places. |
| 22 |
|
| 23 |
It is important to note that the libapl.so library needs to be initialized |
| 24 |
with its function init_libapl() before calling any of its other functions. |
| 25 |
IOW: the top-level main() function of an executable that uses libapl.so |
| 26 |
should look like this: |
| 27 |
|
| 28 |
int |
| 29 |
main(int argc, char * argv[]) |
| 30 |
{ |
| 31 |
init_libapl(argv[0], /* no start-up-logging */ 0); |
| 32 |
... |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
The first argument of init_libapl() is, by convention, the name of the |
| 37 |
executable program. The second argument, if non-zero, enables start-up |
| 38 |
logging of the interpreter (for debugging purposes). |
| 39 |
|
| 40 |
--with-sqlite3=[ARG] |
| 41 |
Build the native function for SQL using sqlite3. ARG may provide the |
| 42 |
non-default location of the sqlite3 library. |
| 43 |
|
| 44 |
--with-postgresql=[ARG] |
| 45 |
Build the native function for SQL using PostgreSQL. ARG may provide the |
| 46 |
non-default location of the postgresql library. |
| 47 |
|
| 48 |
ASSERT_LEVEL_WANTED=n |
| 49 |
There are numerous Assert() and Assert1() macros in the source code of the |
| 50 |
APL interpreter. These macros check more (Assert1) or less (Assert) |
| 51 |
obvious assumptions that throw exceptions if they turn out to be wrong. |
| 52 |
Like for dynamic logging, these macros have negative performance impacts |
| 53 |
and they can be disabled. |
| 54 |
|
| 55 |
By default, ASSERT_LEVEL_WANTED=1 and that disables the Assert1() macro |
| 56 |
and enables the Assert() macro |
| 57 |
|
| 58 |
ASSERT_LEVEL_WANTED=2 enables both macros. |
| 59 |
ASSERT_LEVEL_WANTED=1 (default) enable Assert(), but disable Assert1(). |
| 60 |
ASSERT_LEVEL_WANTED=0 disable both macros; this gives the maximum |
| 61 |
performance, but at the same time bears the risk that internal errors |
| 62 |
of the APL interpreter are not being detected. Example: |
| 63 |
|
| 64 |
./configure ASSERT_LEVEL_WANTED=2 |
| 65 |
|
| 66 |
SECURITY_LEVEL_WANTED=n |
| 67 |
Some capabilities of the APL intepreter can be disabled to improve the |
| 68 |
security of, for example, a web server that uses CGI scripts written in APL. |
| 69 |
SECURITY_LEVEL_WANTED=2 disables all capabilities that can be disabled |
| 70 |
SECURITY_LEVEL_WANTED=1 disables those capabilities that are configured in |
| 71 |
one of the preferences files. |
| 72 |
SECURITY_LEVEL_WANTED=0 enables all capabilities. This level is the default |
| 73 |
and gives the maximum performance of the interpreter. |
| 74 |
|
| 75 |
APSERVER_TRANSPORT |
| 76 |
APSERVER_PORT |
| 77 |
APSERVER_PATH |
| 78 |
APserver is a program that is needed to support shared variables. APserver |
| 79 |
is started automatically and maintains a communication channel to every APL |
| 80 |
interpreter instance and to every AP started (manually or automatically |
| 81 |
by an APL interpreter instance). The communication channel can be TCP, |
| 82 |
abstract Unix domain sockets, or normal Unix domain sockets. |
| 83 |
|
| 84 |
1. TCP communication is the default communication channel that is also |
| 85 |
used when APSERVER_TRANSPORT is not ./configured. APserver listens on |
| 86 |
port number 16366 by default; this can be changed via APSERVER_PORT |
| 87 |
like this: |
| 88 |
|
| 89 |
./configure APSERVER_TRANSPORT=TCP APSERVER_PORT=40000 |
| 90 |
|
| 91 |
2. Abstract Unix domain sockets are a GNU/linux specific socket variant |
| 92 |
that pretty much works like standard Unix domain sockets, but do not |
| 93 |
need an actual file in the the underlying file system. |
| 94 |
APserver listens on a socket named "/tmp/GNU-APL/APserver" by default; |
| 95 |
the name can be changed with APSERVER_PATH like this: |
| 96 |
|
| 97 |
./configure APSERVER_TRANSPORT=LINUX APSERVER_PATH=my-APserver-path |
| 98 |
|
| 99 |
3. Normal Unix domain sockets are a socket variant that requires a file name |
| 100 |
in the local file system to work. The permissions of that file control |
| 101 |
which programs can connect to APserver (BUT MAY ALSO PREVENT APserver |
| 102 |
FROM OPERATING PROPERLY!). Due to the many different possibilities for |
| 103 |
the ownership and permissions for the file, GNU APL does not create the |
| 104 |
file but leaves that to the user. By default APserver listens on the |
| 105 |
socket named "/tmp/GNU-APL/APserver" (and a file with that name |
| 106 |
needs to exist before APL is started); the name can be changed with |
| 107 |
APSERVER_PATH like this: |
| 108 |
|
| 109 |
./configure APSERVER_TRANSPORT=UNIX APSERVER_PATH=my-APserver-path |
| 110 |
|
| 111 |
CORE_COUNT_WANTED |
| 112 |
This experimental option specifies the number of CPU cores the |
| 113 |
intepreter shall use. The value is either a number, or else one of |
| 114 |
the strings 'all', 'argv', or 'syl' (without quotes). For some of its |
| 115 |
pimitives the GNU APL interpreter has both sequential and parallel code |
| 116 |
which is selected with ./configure as follows: |
| 117 |
|
| 118 |
╔═════════════════╤════════════╤═══════════════════════════════════════════╗ |
| 119 |
║ ./configure │ APL code │ Comment ║ |
| 120 |
║ string │ number │ │ ║ |
| 121 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 122 |
║ │ 0 │ sequential │ one core is used (default) ║ |
| 123 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 124 |
║ │ 1 │ parallel │ one core is used ║ |
| 125 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 126 |
║ │ N │ parallel │ N > 0 cores are used ║ |
| 127 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 128 |
║ all │ -1 │ parallel │ all existing cores are being used, ║ |
| 129 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 130 |
║ argv │ -2 │ parallel │ the number of cores can be set by command ║ |
| 131 |
║ │ │ │ line option -cc N (default: all) ║ |
| 132 |
╟────────┼────────┼────────────┼───────────────────────────────────────────╢ |
| 133 |
║ syl │ -3 │ │ initially 1 core is used, but the number ║ |
| 134 |
║ │ │ parallel │ of cores can be later be increased ║ |
| 135 |
║ │ │ │ dynamically in APL via ⎕SYL; ║ |
| 136 |
╚════════╧════════╧════════════╧═══════════════════════════════════════════╝ |
| 137 |
|
| 138 |
Example: |
| 139 |
|
| 140 |
./configure CORE_COUNT_WANTED=4 |
| 141 |
|
| 142 |
CIN_COLOR_WANTED |
| 143 |
CERR_COLOR_WANTED |
| 144 |
COUT_COLOR_WANTED |
| 145 |
RESET_COLORS_WANTED |
| 146 |
CLEAR_EOL_WANTED |
| 147 |
These now obsolete options were used in GNU APL 1.0 to configure output |
| 148 |
coloring. Output coloring can now be specified in GNU APL's preference |
| 149 |
file, which is more flexible than configuring the colors at compile time. |
| 150 |
|
| 151 |
DYNAMIC_LOG_WANTED=yes |
| 152 |
The APL interpreter has more than 40 log categories. Each log category can |
| 153 |
be turned on or off if needed in order to troubleshoot the APL interpreter. |
| 154 |
There are two ways to control the logging categories: statically or |
| 155 |
dynamically. |
| 156 |
|
| 157 |
Statically means that it is decided at compile time if a log category |
| 158 |
shall be on or off. Dynamically means that a log category can be turned |
| 159 |
on or off at run-time (with the debug command ]LOG). |
| 160 |
|
| 161 |
Dynamic logging has a small performance penalty since every potential log |
| 162 |
printout is controlled by an if () statement that checks if the log |
| 163 |
category is turned on or off. With static logging this if () statement |
| 164 |
has a constant value that will be optimized away by the C++ compiler. |
| 165 |
Dynamic logging also slightly increases the size of the APL interpreter. |
| 166 |
|
| 167 |
In both cases (static or dynamic logging), the file src/Logging.def defines |
| 168 |
the logging categories at start-up of the APL interpreter. If the first |
| 169 |
argument of the log_def() macro is 0 then the log category is initially |
| 170 |
disabled (and remains disabled if static logging is used); if it is 1 |
| 171 |
then the log category is initially enabled. The default for this option |
| 172 |
is static logging. Example: |
| 173 |
|
| 174 |
./configure DYNAMIC_LOG_WANTED=yes |
| 175 |
|
| 176 |
CXX_WERROR=yes/no |
| 177 |
Do/do not add the C++ compiler flag -Werror. The -Werror compile flag |
| 178 |
turns compiler warnings into compiler errors. By default GNU APL is |
| 179 |
being compiled without -Werror, making it more portable on different |
| 180 |
platforms/compilers. |
| 181 |
Up to SVN version 1304 the default was CXX_WERROR=yes, but due to a |
| 182 |
recent inflation of bogus compiler warnings this default was changed |
| 183 |
to CXX_WERROR=no. |
| 184 |
|
| 185 |
The old behaviour can be reestablished by, for example: |
| 186 |
|
| 187 |
./configure CXX_WERROR=yes |
| 188 |
|
| 189 |
Note that `make develop' also sets CXX_WERROR=yes. |
| 190 |
|
| 191 |
DEVELOP_WANTED |
| 192 |
This option enables a number of internal checks in the GNU APL interpreter |
| 193 |
that are useful for maintainers of GNU APL. |
| 194 |
|
| 195 |
Example: |
| 196 |
./configure DEVELOP_WANTED=yes |
| 197 |
|
| 198 |
Users who wish to submit patches for GNU APL should compile and test the |
| 199 |
patched intepreter with DEVELOP_WANTED=yes. |
| 200 |
|
| 201 |
MAX_RANK_WANTED=n |
| 202 |
Set the maximum rank of APL values to n. The default value is 8. Max ranks |
| 203 |
smaller than 4 should be avoided. There is no performance penalty for |
| 204 |
increasing the max. rank, but every additional dimension takes 4-8 bytes |
| 205 |
of memory for every APL value (even those with a smaller rank), Example: |
| 206 |
|
| 207 |
./configure MAX_RANK_WANTED=10 |
| 208 |
|
| 209 |
ALT_MAP_WANTED=n |
| 210 |
Enable an APL input mechanism that allows the input of APL characters |
| 211 |
without installing a keyboard mapping. This is primarily for Windows |
| 212 |
machines where no reliable mechanism for entering APL characters exists. |
| 213 |
The parameter n specifies a profile as sollows: |
| 214 |
|
| 215 |
n=0 : disable the mecxhanism |
| 216 |
n=1 : ^A (ASCII SOH) maps the next ASCII character to an APL character |
| 217 |
^N (ASCII SO) maps all subsequenct ASCII characters (until ^N is |
| 218 |
entered again). Like CAPS LOCK for mapping lowercase |
| 219 |
characters to uppercase. |
| 220 |
|
| 221 |
Example: |
| 222 |
|
| 223 |
./configure ALT_MAP_WANTED=1 |
| 224 |
|
| 225 |
|
| 226 |
PRINT_SEMA_WANTED=yes |
| 227 |
This option is now obsolete. |
| 228 |
|
| 229 |
|
| 230 |
VALUE_CHECK_WANTED=yes |
| 231 |
There is a function called check_value() that checks every new APL value |
| 232 |
for completeness. This check helps finding faults in the interpreter, but |
| 233 |
decreases its performance. Example: |
| 234 |
|
| 235 |
./configure VALUE_CHECK_WANTED=yes |
| 236 |
|
| 237 |
VALUE_HISTORY_WANTED=yes |
| 238 |
There is a macro called ADD_EVENT that records the history of APL values. |
| 239 |
This history helps finding faults in the interpreter, but |
| 240 |
decreases its performance. Example: |
| 241 |
|
| 242 |
./configure VALUE_HISTORY_WANTED=yes |
| 243 |
|
| 244 |
|
| 245 |
PERFORMANCE_COUNTERS_WANTED=yes |
| 246 |
GNU APL has some build-in counters for performace measurements. These |
| 247 |
counters are normally disabled, but can be enabled via this option. |
| 248 |
Example: |
| 249 |
|
| 250 |
./configure PERFORMANCE_COUNTERS_WANTED=yes |
| 251 |
|
| 252 |
|
| 253 |
VF_TRACING_WANTED=yes |
| 254 |
You can enable tracing of changes to value flags. This creates a lot of |
| 255 |
debug output and consequently has considerable performance impacts. Example: |
| 256 |
|
| 257 |
./configure VF_TRACING_WANTED=yes |
| 258 |
|
| 259 |
|
| 260 |
SHORT_VALUE_LENGTH_WANTED=12 |
| 261 |
The interpreter distinguishes between long and short APL values. Short |
| 262 |
values are allocated with a single call to "new" that allocates the Shape of |
| 263 |
the value and its ravel. Long values allocate the value header with one call |
| 264 |
to "new" and then the ravel with another call to "new". Long values are |
| 265 |
therefore a little slower than short values. By increasing |
| 266 |
SHORT_VALUE_LENGTH_WANTED you get fewer new calls (and consequently better |
| 267 |
performance) at the cost of more memory. Example: |
| 268 |
|
| 269 |
./configure SHORT_VALUE_LENGTH_WANTED=42 |
| 270 |
|
| 271 |
|
| 272 |
GPROF_WANTED=yes |
| 273 |
Setting GPROF_WANTED adds the flag -pg to CXXFLAGS and LDFLAGS and that |
| 274 |
enables support for gprof profiling of the apl interpreter. Example: |
| 275 |
|
| 276 |
./configure GPROF_WANTED=yes |
| 277 |
make clean all |
| 278 |
cd src; ./apl -f file... |
| 279 |
|
| 280 |
The above will create a profile named 'gmon.out' that can then be analysed |
| 281 |
with the utility gprof, for example: |
| 282 |
|
| 283 |
gprof -b ./apl |
| 284 |
|
| 285 |
GCOV_WANTED=yes |
| 286 |
Setting GCOV_WANTED adds the flags -fprofile-arcs and -ftest-coverage |
| 287 |
to CXXFLAGS and that enables support for gcov coverage testing of the apl |
| 288 |
interpreter. Example: |
| 289 |
|
| 290 |
./configure GCOV_WANTED=yes |
| 291 |
make clean all |
| 292 |
cd src; ./apl -f file... |
| 293 |
gcov *.gcda # convert .gcda files to .gcov files |
| 294 |
|
| 295 |
VISIBLE_MARKERS_WANTED=yes |
| 296 |
GNU APL uses a handful of Unicode characters as internal pad characters |
| 297 |
when formatting its output. Normally these pad characters are in a private |
| 298 |
Unicode range to minimize the chance that they are output on purpose. |
| 299 |
Unfortunately that makes debugging of the output formatting difficult. |
| 300 |
With VISIBLE_MARKERS_WANTED=yes, visible characters ⁰, ¹, ... are used as |
| 301 |
internal pad characters. The internal pad characters are always replaced |
| 302 |
by blanks in normal APL output, but using visible pad characters |
| 303 |
simplifies the debugging of the internal APL formatting considerably. |
| 304 |
|
| 305 |
./configure VISIBLE_MARKERS_WANTED=yes |
| 306 |
|
| 307 |
RATIONAL_NUMBERS_WANTED=yes |
| 308 |
This enables support for rational numbers in GNU APL. The precision of some |
| 309 |
computations is increased while having a negative impact on performance. |
| 310 |
This feature is currently experimental. Example: |
| 311 |
|
| 312 |
./configure RATIONAL_NUMBERS_WANTED=yes |
| 313 |
|
| 314 |
without-optional_libs |
| 315 |
This option pretends that any of yje optional library is missing. |
| 316 |
It patches the config.h file produced by ./configure (though not the LIBS |
| 317 |
shell variable set by ./configure). IOW: the compiler is told that these |
| 318 |
libraries are not available, but the liker will still link agains them |
| 319 |
(with no effect). The purpose of this option is to compile (for test |
| 320 |
purposes) also those paths in the GNU APL source code that were disabled |
| 321 |
by the presence of an optional library. Examples: |
| 322 |
|
| 323 |
./configure --without-optional_libs |
| 324 |
|
| 325 |
./configure --without-optional_libs \ |
| 326 |
--enable-maintainer-mode \ |
| 327 |
DEVELOP_WANTED=yes \ |
| 328 |
DYNAMIC_LOG_WANTED=yes \ |
| 329 |
CXX_WERROR=yes |
| 330 |
|
| 331 |
------------------------------------------------------------------------------- |
| 332 |
|
| 333 |
The typical setting for users that are not interested in troubleshooting |
| 334 |
the APL interpreter is to not use any options, i.e: |
| 335 |
|
| 336 |
./configure |
| 337 |
|
| 338 |
The typical setting for software development of the APL interpreter is: |
| 339 |
|
| 340 |
./configure DEVELOP_WANTED=yes |
| 341 |
|
| 342 |
which is a shortcut for: |
| 343 |
|
| 344 |
./configure VALUE_CHECK_WANTED=yes \ |
| 345 |
VALUE_HISTORY_WANTED=yes \ |
| 346 |
PERFORMANCE_COUNTERS_WANTED=yes \ |
| 347 |
DYNAMIC_LOG_WANTED=yes \ |
| 348 |
ASSERT_LEVEL_WANTED=2 |
| 349 |
|
| 350 |
After the first ./configure run (which is needed to create the top level |
| 351 |
Makefile) you can invoke: |
| 352 |
|
| 353 |
make develop |
| 354 |
|
| 355 |
which runs ./configure with the typical development options above. |
| 356 |
|
| 357 |
------------------------------------------------------------------------------- |
| 358 |
|
| 359 |
Some ./configure tips... |
| 360 |
|
| 361 |
Occasionally it could happen that the different tools involved in building |
| 362 |
GNU APL (primarily autoconf, automake, libtool) get out-of sync. This then |
| 363 |
creates problems already before the compilation and the linking of GNU APL |
| 364 |
starts. |
| 365 |
|
| 366 |
If that happens, you may want to follow some of the recommendations given here: |
| 367 |
|
| 368 |
https://stackoverflow.com/questions/3096989/libtool-version-mismatch-error |
| 369 |
|
| 370 |
The most promising proposal from the link above (and the one that the author |
| 371 |
usually tries first) is this: |
| 372 |
|
| 373 |
autoreconf --force --install |
| 374 |
./configure |
| 375 |
make |
| 376 |
|
| 377 |
Other measures that may be helpful are these (all run in the top-level |
| 378 |
directory of the GNU APL package): |
| 379 |
|
| 380 |
make maintainer-clean |
| 381 |
make mrproper |
| 382 |
|
| 383 |
libtoolize |
| 384 |
|
| 385 |
Sometimes the above need to be executed in a particular (and somewhat obscure) |
| 386 |
order, so keep trying. |
| 387 |
|