forked from jfriesne/muscle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILDOPTIONS.txt
349 lines (284 loc) · 16.4 KB
/
BUILDOPTIONS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
muscled should compile fine with nothing more than a "cd muscle/server ; make"
but if you feel like hacking around, here is a list of some
compile-time constants that you can define in the CXXFLAGS variable
of your Makefile to alter muscle's behaviour:
-DMUSCLE_ENABLE_SSL
Set this to enable built-in support for SSL connections via OpenSSL.
(e.g. ReflectServer::SetSSLPrivateKey())
-DMUSCLE_AVOID_CPLUSPLUS11
Set this to avoid C++11-specific features such as move-constructors
(i.e. so that you can build MUSCLE under older, pre-C++11 compilers)
-DMUSCLE_AVOID_CPLUSPLUS11_THREADS
Set this to avoid using the C++11-specific APIs (thread, mutex,
etc) as back-ends for the MUSCLE Thread/Mutex/AtomicCounter etc
classes if you are compiling using C++11 but nevertheless you still
want those classes to use OS-specific back-end APIs instead.
-DMUSCLE_AVOID_CPLUSPLUS11_BITCHORD
Set this to avoid the C++11 implementation of the BitChord class and
fall back to the legacy/C++03 implementation instead. (Useful for
old/broken C++11 compilers that don't quite grok the C++11 implementation)
-DMUSCLE_AVOID_CPLUSPLUS11_THREAD_LOCAL_KEYWORD
Tells the ThreadLocalStorage class to avoid using the C++11 thread_local
keyword even through C++11 support is enabled. Defined automatically for
older (pre-MSVC2015) Microsoft compilers that are known not to support
this keyword; but it can also be defined manually if necessary (e.g.
because your compiler doesn't support the thread_local keyword either)
-DMUSCLE_AVOID_IPV6
Set this to indicate that Muscle should be compiled without IPv6
support. The main difference with this flag is that muscle_ip_address
will be defined a typedef'd alias for a uint32 (rather than a C++ class
that holds 128 bits of data).
-DMUSCLE_AVOID_STDINT
If for some reason you want to force MuscleSupport.h to not include
stdint.h and inttypes.h (and instead hand-roll its typedefs from
scratch) you can define this. Probably only useful on very old compilers.
-DMUSCLE_SINGLE_THREAD_ONLY
Makes the Mutex class's methods compile down to no-ops. Specify this if
you are able to guarantee that your program will never access MUSCLE
code from more than one thread.
-DMUSCLE_USE_EPOLL
Causes the SocketMultiplexer class to use the epoll() Linux system
call instead of select(). This method is less portable, but
avoids the FD_SETSIZE limitation that select() introduces.
Note that this flag is mutually exclusive with -DMUSCLE_USE_KQUEUE and
-DMUSCLE_USE_POLL.
-DMUSCLE_USE_POLL
Causes the SocketMultiplexer class to use the poll() system
call instead of select(). This method is slightly less portable, but
avoids the FD_SETSIZE limitation that select() introduces.
Note that this flag is mutually exclusive with -DMUSCLE_USE_KQUEUE
and -DMUSCLE_USE_EPOLL.
-DMUSCLE_USE_KQUEUE
Causes the SocketMultiplexer class to use the kqueue() and kevent()
system calls instead of select(). This method is less portable, but
avoids the FD_SETSIZE limitation that select() introduces.
Note that this flag is mutually exclusive with -DMUSCLE_USE_POLL and
-DMUSCLE_USE_EPOLL.
-DMUSCLE_MAX_ASYNC_CONNECT_DELAY_MICROSECONDS=(#micros)
If specified, MUSCLE's AddNewConnectSession() calls
will force an asynchronous connection to fail after this
many microseconds have elapsed. If not defined, the
default behavior is to let the operating system determine
when the asynchronous connection should time out and fail.
-DMUSCLE_CATCH_SIGNALS_BY_DEFAULT
If specified, ReflectServer will by default set up a signal
handler to catch signals (e.g. Control-C), and gracefully
exit its event loop when they are detected. Without this
flag, MUSCLE signal-handling routines will only be set up
if you explicitly call SetSignalHandlingEnabled(true)
somewhere in your code.
-DMUSCLE_USE_LIBRT
If specified, GetRunTime64() and Snooze64() will use librt's
high-resolution timing functions instead of the low-resolution
ones supplied by older operating systems. Note that if you
specify this flag, you should link with librt as well (-lrt).
-DMUSCLE_AVOID_MULTICAST_API
Set this to omit the multicast API calls in NetworkUtilityFunctions.h.
This might be useful to do if compiling on a platform where multicast
APIs aren't supported.
-DMUSCLE_DISABLE_KEEPALIVE_API
Set this to avoid attempting to compile the TCP-keepalive API calls in
NetworkUtilityFunctions.{cpp,h} under Linux.
-DMUSCLE_64_BIT_PLATFORM
Set this to indicate that compilation is being done on a 64-bit platform.
This flag will be set automatically in support/MuscleSupport.h if defines
indicating a known 64-bit platform are detected; if not, you can set it
yourself in the Makefile if necessary.
-DMUSCLE_USE_LLSEEK
Force the FileDescriptorDataIO class to use the non-standard _llseek() command
when compiled under Linux. This should be done automatically in most cases
where it is necessary, but you can force it also.
-DMUSCLE_PREFER_QT_OVER_WIN32
Tell the Muscle Thread/Mutex/etc classes to prefer to use Qt Threading APIs over Win32 calls
when both are available. (By default, Win32 calls are preferred when running under Windows)
-DMUSCLE_ENABLE_MEMORY_PARANOIA=N
Put N overwrite-guards before and after each malloc() buffer, watch them for memory corruption
-DMUSCLE_NO_EXCEPTIONS
Tells muscle that exceptions won't be used.
-DMUSCLE_ENABLE_MEMORY_TRACKING
Enables system memory usage tracking (wrappers for new and delete that allow muscled to
put an upper bound on the amount of memory it dynamically allocates, etc)
-DMUSCLE_AVOID_ASSERTIONS
makes MASSERT statements into no-ops
-DMUSCLE_AVOID_SIGNAL_HANDLING
Disables the built-in support for catching signals and doing an orderly shutdown of
the ReflectServer event loop in response.
-DMUSCLE_AVOID_INLINE_ASSEMBLY
tells muscle to use boring old C/C++ code and avoid using any clever assembly-language code
-DMUSCLE_ENABLE_ZLIB_ENCODING
enables support for zlib compression of Messages
-DMUSCLE_TRACE_CHECKPOINTS=N
enable TCHECKPOINT tracing of last N checkpoints
-DMUSCLE_DISABLE_MESSAGE_FIELD_POOLS
turn off Object pooling for Message field objects; helpful for debugging
-DMUSCLE_INLINE_LOGGING
turn Log(), LogTime(), etc into simple printf() passthroughs
-DMUSCLE_DISABLE_LOGGING
turn Log(), LogTime(), etc into no-ops
-DMUSCLE_USE_MUTEXES_FOR_ATOMIC_OPERATIONS
Use Mutexes to simulate atomic inc/dec operations; useful if no other method is available
-DMUSCLE_MUTEX_POOL_SIZE=N
If -DMUSCLE_USE_MUTEXES_FOR_ATOMIC_OPERATIONS is defined, then this can be defined to set the size of the Mutex pool to use. Defaults to 256.
-DMUSCLE_POWERPC_TIMEBASE_HZ=N
Use mftb/mftbu for GetRunTime64() calls. N is the frequency at which the register is incremented
-DMUSCLE_USE_PTHREADS
Use pthreads for thread operations
-DMUSCLE_DEFAULT_TCP_STALL_TIMEOUT=N
Number of microseconds to wait for a client to read TCP data before
giving up and closing his connection (defaults to 20 minutes' worth)
-DMUSCLE_FD_SETSIZE=N
Redefine the fd_setsize to another value (useful under Windows, where the default setsize is a measly 64)
-DMUSCLE_AVOID_NEWNOTHROW
Turns newnothrow into a synonym for "new", instead of "new (nothrow)"
-DMUSCLE_AVOID_FORKPTY
Tells the ChildProcessDataIO class not to compile in calls to forkpty(); instead it will use fork() only
-DMUSCLE_HASHTABLE_DEFAULT_CAPACITY=X
Number of value slots to initially pre-allocate in a Hashtable, by default (defaults to 7)
Note that the pre-allocation is done the first time an object is Put() into the Hashtable.
A new, empty Hashtable will have no pre-allocated slots.
-DSMALL_QUEUE_SIZE=N
Number of value slots to initially pre-allocate in a Queue, by default. (defaults to 3)
-DSMALL_MUSCLE_STRING_LENGTH=N
strings <= this length will be stored inline in the String object to avoid a malloc()... default is 7
-DMUSCLE_USE_QUERYPERFORMANCECOUNTER
Tells MUSCLE's GetRunTime64() to use the higher-resolution
QueryPerformanceCounter() API instead of timeGetTime() when running under Windows.
Specifying this flag increases GetRunTime64()'s accuracy, but QueryPerformanceCounter()
is known not to work on some hardware.
-DMUSCLE_INCLUDE_SOURCE_LOCATION_IN_LOGTIME
Compiles MUSCLE's and LogTime() function as a macro that includes the
source code location in the _LogCallback() call. If enabled, the log
preamble string (at the start of each log-line) will include a four-character
location-code (e.g. "RS4P") that corresponds to the filename and line
number of the LogTime() call that generated it. (You can later use the
muscle/test/findsourcelocations.cpp program to find out which
source-code-location(s) the four-character-location-code refers to, or
the muscle/test/printsourcelocations.cpp to generate a list of all the
four-character-location-codes that your program might print out)
-DMUSCLE_LOG_VERBOSE_SOURCE_LOCATIONS
Compiles MUSCLE's and LogTime() function as a macro that includes the
source code location in the _LogCallback() call. If enabled, the log
preamble string (at the start of each log-line) will include the
filename and line number (e.g. "ReflectServer.cpp:388") of the LogTime()
call that generated it.
-DMUSCLE_WARN_ABOUT_LOUSY_HASH_FUNCTIONS=200
If defined, the Hashtable::EnsureSize() method will do some paranoia
checking every time it resizes the Hashtable, to see if the Hashtable's
average lookup-count (as calculated by CountAverageLookupComparisons())
is greater than 2.00f (or whatever the preprocessor-define's value is,
divided by 100). If it is, a log message, debug info, and a stack trace
will be printed. Only enable this compiler flag when doing debugging/
development/optimization (i.e. when you want to check to see if you
have any hash functions that aren't performing well), since it will
significantly slow down your program when it is enabled.
-DMUSCLE_ENABLE_DEADLOCK_FINDER
If specified, calls to Mutex::Lock() and Mutex::Unlock() will
print trace information to stdout that can later be used by
the deadlockfinder program (in the tests folder) to detect
potential deadlocks in the code caused by inconsistent lock
acquisition ordering.
-DMUSCLE_DEFAULT_RUNTIME_DISABLE_DEADLOCK_FINDER
If this is specified in addition to -DMUSCLE_ENABLE_DEADLOCK_FINDER,
then deadlock-detection will be compiled into the code but the
printouts will be disabled by default. To enable them at runtime,
set the global variable _enableDeadlockFinderPrints to true.
-DMUSCLE_POOL_SLAB_SIZE
This can be set to a number indicating the number of bytes that should be
allocated in each "slab" of data malloc()'d by the ObjectPool class. If left
unset, slabs of approximately 8 kilobytes will be used. Large slabs mean
fewer memory allocations, but potentially more memory wasted if all the objects
in the slabs aren't needed. This value should be specified in bytes.
-DMUSCLE_AVOID_BITSTUFFING
If set, this flag will cause the RefCount and ByteBuffer classes
to use a separate boolean state value, rather than stuffing that bit
into its held pointer. This flag might be necessary on systems
that don't word-align their object pointers (if such systems exist)
-DMUSCLE_AVOID_CHECK_THREAD_STACK_USAGE
If set, calls to the CHECK_THREAD_STACK_USAGE macro will be
converted into no-ops.
-DMUSCLE_ENABLE_OBJECT_COUNTING
If defined, the CountedObject<> class will be enabled, so that
PrintCountedObjectInfo() will print out tallies of the numbers
of various kinds of objects currently in memory.
Otherwise it is compiled down to a no-op, and the
DECLARE_COUNTED_OBJECT macro likewise becomes a no-op.
-DMUSCLE_AVOID_THREAD_LOCAL_STORAGE
If defined, the MUSCLE code will try to avoid using the ThreadLocalStorage
class where possible (in particular, it will use Mutexes inside the
ZLibUtilityFunctions.cpp file rather than ThreadLocalStorage objects --
this might be useful on systems where ThreadLocalStorage isn't implemented)
-DMUSCLE_AVOID_MINIMIZED_HASHTABLES
If defined, the MUSCLE Hashtable class will not used variable-sized
indexing in its HashtableEntries. Variable-sized indexing saves memory
when tables have less than 65,535 slots in them, but increases the
number of "if" statements in common Hashtable codepaths. Whether or
not it increases or decreases performance will depend on the architecture
of the host computer (e.g. on cache size, CPU speed, etc).
-DMUSCLE_AVOID_THREAD_SAFE_HASHTABLE_ITERATORS
As of v5.90, the Hashtable class includes logic to ensure that
HashtableIterators are thread safe, even if multiple threads are
iterating over the same Hashtable at the same time (as long the
Hashtable is not being modified, at least). This extra safety
does impose some overhead, though -- about 16 bytes of RAM per
Hashtable object, and a small amount of CPU overhead imposed
by using an AtomicCounter. If you want to avoid that overhead
and you're confident that you will always supply the
HTIT_FLAG_NOREGISTER argument whenever you are doing
concurrent iterations over a Hashtable (or Message), you can
supply this flag on the command line to avoid the overhead.
-DMUSCLE_FAKE_SHARED_MEMORY
If defined, the SharedMemory class will allocate a non-shared memory
buffer (using muscleAlloc()) rather than actual shared memory. Handy
for debugging if you suspect that shared-memory is causing a problem.
-DMUSCLE_COUNT_STRING_COPY_OPERATIONS
If this flag is defined, the String class will tally the number
of times that String objects are moved and the number of times
they are copied. This is handy for verifying that the C++11
move semantics are being used as expected.
-DMUSCLE_AVOID_XENOMAI
Tells MUSCLE not to use Xenomai APIs, not even if
TARGET_PLATFORM_XENOMAI is defined.
-DDEBUG_LARGE_MEMORY_ALLOCATIONS_THRESHOLD=n
If defined, whenever muscleAlloc() is called with a request size
greater than (n), information about the allocation and a stack
trace will be printed to stdout. Good for quickly figuring out who
is allocating big contiguous chunks of memory.
-DMUSCLE_AVOID_AUTOCHOOSE_SWAP
If set, MuscleSupport.h will define muscleSwap() the simple,
old-fashioned way. This is less efficient, but avoiding the SFINAE
mumbo-jumbo helps the code compile on older compilers (e.g. gcc 3.x)
that don't handle SFINAE correctly.
-DMUSCLE_RECORD_REFCOUNTABLE_ALLOCATION_LOCATIONS
If set, the RefCountable and ObjectPool code will be instrumented
such that every time a RefCountable object is obtained from an
ObjectPool, the thread's current stack trace will be recorded and
associated with the RefCountable object. What this does (apart from
making your program really slow and memory-hungry) is allow the
assertion failures in the ObjectPool class's destructor to tell you
exactly where a "leaked" object had been allocated, rather than just
telling you that an object is still in use. That can make it much
easier to track down where the leaked-references problem is and fix it.
-DMUSCLE_ENABLE_QTHREAD_EVENT_LOOP_INTEGRATION
If set, and if MUSCLE is using Qt's QThread class to implement its
Thread functionality, then the Thread::InternalThreadEntry() method
will call QThread::exec() to implement its event loop instead of
using its own while(WaitForNextMessage()) loop. This can be useful
if you want to use Qt objects in the thread, and those Qt objects
depend on QThread::exec()'s functioning in order to work properly.
-DMUSCLE_AVOID_LINUX_DETECT_NETWORK_HARDWARE_TYPES
If set, then NetworkUtilityFunctions.cpp will not attempt to
determine network hardware type using SIOCGIFHWADDR when compiled
under Linux.
-DMUSCLE_USE_CPLUSPLUS11_THREADS
This define is typically defined for you when appropriate, inside
MuscleSupport.h You shouldn't have to define it manually. It tells
the MUSCLE headers to use C++11 APIs as back-ends for the MUSCLE
Thread/Mutex/AtomicCounter/etc classes.
-DMUSCLE_USE_DUMMY_DETECT_NETWORK_CONFIG_CHANGES_SESSION
Tells the DetectNetworkConfigChangesSession class to build but
not do anything useful.
-DMUSCLE_ENABLE_AUTHORIZATION_EXECUTE_WITH_PRIVILEGES
If specified, the ChildProcessDataIO class will enable the
SetRequestRootAccessForChildProcessEnabled() method and attendant
functionality for launching a root-enabled child process under
MacOS/X.