CMakeLists.txt 79.4 KB
Newer Older
thomasl's avatar
thomasl committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
################################################################################
#   OpenAirInterface
#   Copyright(c) 1999 - 2014 Eurecom
#
#   OpenAirInterface is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   OpenAirInterface 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 General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with OpenAirInterface.The full GNU General Public License is
#  included in this distribution in the file called "COPYING". If not,
#  see <http://www.gnu.org/licenses/>.
#
# Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr
23
# OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
thomasl's avatar
thomasl committed
24
25
#
# Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
knopp's avatar
knopp committed
26
# Author: laurent THOMAS, Lionel GAUTHIER
thomasl's avatar
thomasl committed
27
28
29
30
###############################################################################

cmake_minimum_required (VERSION 2.8)

31
#############################################
thomasl's avatar
thomasl committed
32
33
34
35
36
37
38
# Base directories, compatible with legacy OAI building
################################################
set (OPENAIR_DIR     $ENV{OPENAIR_DIR})
set (OPENAIR1_DIR    ${OPENAIR_DIR}/openair1)
set (OPENAIR2_DIR    ${OPENAIR_DIR}/openair2)
set (OPENAIR3_DIR    ${OPENAIR_DIR}/openair3)
set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets)
39
set (OPENAIR3_DIR    ${OPENAIR_DIR}/openair3)
thomasl's avatar
thomasl committed
40
41
42
43
44
set (OPENAIR_CMAKE   ${OPENAIR_DIR}/cmake_targets)
set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})

project (OpenAirInterface)

45
46
47
48
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m)
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR)
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C)

thomasl's avatar
thomasl committed
49
50
51
###########################################
# macros to define options as there is numerous options in oai
################################################
thomasl's avatar
thomasl committed
52
53
54
55
56
57
58
59
60
61
macro(add_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  add_definitions("-D${name}=${value}")
endmacro(add_option)

thomasl's avatar
thomasl committed
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
macro(add_boolean_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  set_property(CACHE ${name} PROPERTY TYPE BOOL)
  if (${value})
    add_definitions("-D${name}")
  endif (${value})
endmacro(add_boolean_option)

macro(add_integer_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  add_definitions("-D${name}=${value}")
endmacro(add_integer_option)

macro(add_list1_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
  if(NOT "${value}" STREQUAL "False")
    add_definitions("-D${name}=${value}")
  endif()
endmacro(add_list1_option)

macro(add_list2_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
  if(NOT "${value}" STREQUAL "False")
    add_definitions("-D${value}=1")
  endif()
endmacro(add_list2_option)

111
112
113
114
115
116
117
118
119
120
121
122
macro(add_list_string_option name val helpstr)
  if(DEFINED ${name})
    set(value ${${name}})
  else(DEFINED ${name})
    set(value ${val})
  endif()
  set(${name} ${value} CACHE STRING "${helpstr}")
  set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
  if(NOT "${value}" STREQUAL "False")
    add_definitions("-D${name}=\"${value}\"")
  endif()
endmacro(add_list_string_option)
123
####################################################
thomasl's avatar
thomasl committed
124
125
# compilation flags
#############################################
thomasl's avatar
thomasl committed
126
127
128
if (CMAKE_BUILD_TYPE STREQUAL "")
   set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
129
add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." Debug Release RelWithDebInfo MinSizeRel)
thomasl's avatar
thomasl committed
130

131
132
Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
133
  set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt")
134
else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
135
136
137
138
139
140
  if(EXISTS  "/proc/cpuinfo")
    file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
    if (CPUINFO MATCHES "avx2")
      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
    endif()
    if (CPUINFO MATCHES "sse4_1")
141
      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mavx2")
142
143
144
145
146
147
    endif()
    if (CPUINFO MATCHES "ssse3")
      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
    endif()
  else()
    Message("/proc/cpuinfo does not exit. We will use manual CPU flags")
148
  endif()
149
endif()
150
151
152

set(C_FLAGS_PROCESSOR " ${C_FLAGS_PROCESSOR} ${CFLAGS_PROCESSOR_USER}")

153
154
Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")

155
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
156
  if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
157
    Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ")
158
159
  endif()
endif()
160

thomasl's avatar
thomasl committed
161
#
162
set(CMAKE_C_FLAGS
163
  "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
164
# add autotools definitions that were maybe used!
165
set(CMAKE_C_FLAGS
166
167
  "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
)
168
set(CMAKE_CXX_FLAGS
knopp's avatar
knopp committed
169
  "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 "
170
)
171
172
173


#########################
174
set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
175
#########################
176
177
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
178
add_definitions(-DCMAKER)
179
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
180
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3") 
thomasl's avatar
thomasl committed
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

set(GIT_BRANCH        "UNKNOWN")
set(GIT_COMMIT_HASH   "UNKNOWN")
set(GIT_COMMIT_DATE   "UNKNOWN")


find_package(Git)
if(GIT_FOUND)
  message("git found: ${GIT_EXECUTABLE}")
  # Get the current working branch
  execute_process(
    COMMAND git rev-parse --abbrev-ref HEAD
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_BRANCH
    OUTPUT_STRIP_TRAILING_WHITESPACE
  )

  # Get the latest abbreviated commit hash of the working branch
  execute_process(
    COMMAND git log -1 --format=%h
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_COMMIT_HASH
    OUTPUT_STRIP_TRAILING_WHITESPACE
  )
  
  # Get the latest commit date of the working branch
  execute_process(
    COMMAND git log -1 --format=%cd
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_COMMIT_DATE
    OUTPUT_STRIP_TRAILING_WHITESPACE
  )
endif()

thomasl's avatar
thomasl committed
216
217
218

# Below is a hard-coded info
set (FIRMWARE_VERSION "No svn information")
thomasl's avatar
thomasl committed
219
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
220
221
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
thomasl's avatar
thomasl committed
222
223
224
225
226



# Debug related options
#########################################
227
228
229
230
231
232
233
234
add_boolean_option(ASN_DEBUG           False "ASN1 coder/decoder Debug")
add_boolean_option(EMIT_ASN_DEBUG      False "ASN1 coder/decoder Debug")
add_boolean_option(MSG_PRINT           False "print debug messages")
add_boolean_option(DISABLE_XER_PRINT   False "print XER Format")
add_boolean_option(XER_PRINT           False "print XER Format")
add_boolean_option(RRC_MSG_PRINT       False "print RRC messages")
add_boolean_option(PDCP_MSG_PRINT      False "print PDCP messages to /tmp/pdcp.log")
add_boolean_option(DEBUG_PDCP_PAYLOAD  False "print PDCP PDU to stdout")  # if true, make sure that global and PDCP log levels are trace 
235
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace 
236
237
238
239
240
add_boolean_option(TRACE_RLC_PAYLOAD   False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace 
add_boolean_option(TEST_OMG            False "???")
add_boolean_option(DEBUG_OMG           False "???")
add_boolean_option(XFORMS              False "This adds the possibility to see the signal oscilloscope")
add_boolean_option(PRINT_STATS         False "This adds the possibility to see the status")
241

242
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
thomasl's avatar
thomasl committed
243

244
add_boolean_option(ENABLE_ITTI True "ITTI is internal messaging, should remain enabled for most targets")
thomasl's avatar
thomasl committed
245
246
set (ITTI_DIR ${OPENAIR_DIR}/common/utils/itti)
if (${ENABLE_ITTI})
247
  add_library(ITTI
thomasl's avatar
thomasl committed
248
249
250
251
252
253
254
255
256
    # add .h files if depend on (this one is generated)
    ${ITTI_DIR}/intertask_interface.h
    ${ITTI_DIR}/intertask_interface.c
    ${ITTI_DIR}/intertask_interface_dump.c
    ${ITTI_DIR}/backtrace.c
    ${ITTI_DIR}/memory_pools.c
    ${ITTI_DIR}/signals.c
    ${ITTI_DIR}/timer.c
    )
257
  set(ITTI_LIB ITTI)
gauthier's avatar
gauthier committed
258
  set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c)
thomasl's avatar
thomasl committed
259
260
261
262
263
264
265
266
267
268
269
270
endif (${ENABLE_ITTI})

add_boolean_option(RTAI False "Use RTAI")


#############################
# ASN.1 grammar C code generation & dependancies
################################
# A difficulty: asn1c generates C code of a un-predictable list of files
# so, generate the c from asn1c once at cmake run time
# So, if someone modify the asn.1 source file in such as way that it will create
# (so creating new asn.1 objects instead of modifying the object attributes)
271
# New C code source file, cmake must be re-run (instead of re-running make only)
thomasl's avatar
thomasl committed
272
#############
273
set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
Cédric Roux's avatar
Cédric Roux committed
274
set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_asn1")
thomasl's avatar
thomasl committed
275
276
set(asn1_generated_dir ${OPENAIR_BIN_DIR})

277
278
279
set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
set(protobuf_generated_dir ${OPENAIR_BIN_DIR})

thomasl's avatar
thomasl committed
280
281
# RRC
######
thomasl's avatar
thomasl committed
282
add_list2_option(RRC_ASN1_VERSION "Rel10" "ASN.1 version of RRC interface" "Rel8" "Rel10" "CBA")
thomasl's avatar
thomasl committed
283
284
285

if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
  set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn)
thomasl's avatar
thomasl committed
286
287
288
elseif (${RRC_ASN1_VERSION} STREQUAL "CBA")
  set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn)
else()
thomasl's avatar
thomasl committed
289
290
291
292
293
294
295
  set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn)
endif  (${RRC_ASN1_VERSION} STREQUAL "Rel8")

set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION})
if(NOT EXISTS ${asn1c_call})
  message( FATAL_ERROR "The script ${asn1c_call} must be present" )
endif(NOT EXISTS ${asn1c_call})
Cédric Roux's avatar
Cédric Roux committed
296
297
298
299
300
execute_process(COMMAND ${asn1c_call}  ${RRC_FULL_DIR} ${RRC_GRAMMAR}
                RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
Cédric Roux's avatar
Cédric Roux committed
301
302
303
if(NOT EXISTS ${fix_asn1c_call})
  message( FATAL_ERROR "The script ${fix_asn1c_call} must be present" )
endif(NOT EXISTS ${fix_asn1c_call})
Cédric Roux's avatar
Cédric Roux committed
304
305
execute_process(COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
                RESULT_VARIABLE ret)
Cédric Roux's avatar
Cédric Roux committed
306
307
308
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${fix_asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
thomasl's avatar
thomasl committed
309
310
311
312
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
set(rrc_source  ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c)
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn1_constants.h)
313
set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
314
add_library(RRC_LIB ${rrc_h} ${rrc_source})
thomasl's avatar
thomasl committed
315
316
317
318
319
320
321
include_directories ("${RRC_FULL_DIR}")

# add the command to generate the source code
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
add_custom_command (
  OUTPUT ${RRC_FULL_DIR}/asn1_constants.h
  COMMAND ${asn1c_call}  ${RRC_FULL_DIR} ${RRC_GRAMMAR}
Cédric Roux's avatar
Cédric Roux committed
322
  COMMAND ${fix_asn1c_call}  ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
thomasl's avatar
thomasl committed
323
324
325
326
327
328
329
  DEPENDS ${RRC_GRAMMAR}
  )

# S1AP
# Same limitation as described in RRC: unknown generated file list
# so we generate it at cmake time
##############
thomasl's avatar
thomasl committed
330
331
add_list1_option(S1AP_VERSION R10 "S1AP Asn.1 grammar version" R8 R9 R10)

gauthier's avatar
gauthier committed
332
set(S1AP_DIR ${OPENAIR3_DIR}/S1AP)
thomasl's avatar
thomasl committed
333
334
335
336
337
338
339
340
341
342
343
if (${S1AP_VERSION} STREQUAL "R10")
  set (ASN1RELDIR R10.5)
  add_definitions("-DUPDATE_RELEASE_9 -DUPDATE_RELEASE_10")
elseif (${S1AP_VERSION} STREQUAL "R9")
  set (ASN1RELDIR R9.8)
  add_definitions("-DUPDATE_RELEASE_9")
else(${S1AP_VERSION} STREQUAL "R8")
  set (ASN1RELDIR R8.10)
endif(${S1AP_VERSION} STREQUAL "R10")
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
set(S1AP_ASN_FILES
344
345
346
  ${S1AP_ASN_DIR}/S1AP-CommonDataTypes.asn
  ${S1AP_ASN_DIR}/S1AP-Constants.asn
  ${S1AP_ASN_DIR}/S1AP-IEs.asn
thomasl's avatar
thomasl committed
347
348
349
  ${S1AP_ASN_DIR}/S1AP-PDU.asn
  )
set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
350
#message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}")
Cédric Roux's avatar
Cédric Roux committed
351
352
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
                RESULT_VARIABLE ret)
353
354
355
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
Cédric Roux's avatar
Cédric Roux committed
356
357
execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
                RESULT_VARIABLE ret)
358
359
360
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "asn1tostruct.py: error")
endif (NOT ${ret} STREQUAL 0)
Cédric Roux's avatar
Cédric Roux committed
361
362
execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
                RESULT_VARIABLE ret)
Cédric Roux's avatar
Cédric Roux committed
363
364
365
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${fix_asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
thomasl's avatar
thomasl committed
366
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
367

368
set(S1AP_OAI_generated
thomasl's avatar
thomasl committed
369
370
371
  ${S1AP_C_DIR}/s1ap_decoder.c
  ${S1AP_C_DIR}/s1ap_encoder.c
  ${S1AP_C_DIR}/s1ap_xer_print.c
372
  ${S1AP_C_DIR}/s1ap_compare.c
thomasl's avatar
thomasl committed
373
374
375
  ${S1AP_C_DIR}/s1ap_ies_defs.h
  )
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
376
377
set(s1ap_h ${s1ap_h} )

thomasl's avatar
thomasl committed
378
379
380
381
add_custom_command (
  OUTPUT ${S1AP_OAI_generated}
  COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
  COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
Cédric Roux's avatar
Cédric Roux committed
382
  COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
383
  DEPENDS ${S1AP_ASN_FILES}
thomasl's avatar
thomasl committed
384
  )
385
386
add_library(S1AP_LIB
  ${S1AP_OAI_generated}
387
388
389
390
  ${S1AP_source}
  ${S1AP_DIR}/s1ap_common.c
  )

thomasl's avatar
thomasl committed
391
392
include_directories ("${S1AP_C_DIR}")
include_directories ("${S1AP_DIR}")
thomasl's avatar
thomasl committed
393

394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
add_library(S1AP_ENB
  ${S1AP_C_DIR}/s1ap_ies_defs.h
  ${S1AP_DIR}/s1ap_eNB.c
  ${S1AP_DIR}/s1ap_eNB_context_management_procedures.c
  ${S1AP_DIR}/s1ap_eNB_decoder.c
  ${S1AP_DIR}/s1ap_eNB_encoder.c
  ${S1AP_DIR}/s1ap_eNB_handlers.c
  ${S1AP_DIR}/s1ap_eNB_itti_messaging.c
  ${S1AP_DIR}/s1ap_eNB_management_procedures.c
  ${S1AP_DIR}/s1ap_eNB_nas_procedures.c
  ${S1AP_DIR}/s1ap_eNB_nnsf.c
  ${S1AP_DIR}/s1ap_eNB_overload.c
  ${S1AP_DIR}/s1ap_eNB_trace.c
  ${S1AP_DIR}/s1ap_eNB_ue_context.c
  )
thomasl's avatar
thomasl committed
409

410

411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433

#X2AP
# Same limitation as described in RRC/S1AP: unknown generated file list
# so we generate it at cmake time
##############
add_list1_option(X2AP_VERSION R11 "X2AP Asn.1 grammar version" R10 R11)
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
if (${X2AP_VERSION} STREQUAL "R11")
  set (ASN1RELDIR R11.2)
elseif (${X2AP_VERSION} STREQUAL "R10")
  set (ASN1RELDIR R.UNKNOWN)
endif(${X2AP_VERSION} STREQUAL "R11")
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
set(X2AP_ASN_FILES
  ${X2AP_ASN_DIR}/X2AP-CommonDataTypes.asn
  ${X2AP_ASN_DIR}/X2AP-Constants.asn
  ${X2AP_ASN_DIR}/X2AP-IEs.asn
  ${X2AP_ASN_DIR}/X2AP-PDU.asn
  ${X2AP_ASN_DIR}/X2AP-Containers.asn
  )

set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
#message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}")
Cédric Roux's avatar
Cédric Roux committed
434
435
execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
                RESULT_VARIABLE ret)
436
437
438
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
Cédric Roux's avatar
Cédric Roux committed
439
440
execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
                RESULT_VARIABLE ret)
441
442
443
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "asn1tostruct.py: error")
endif (NOT ${ret} STREQUAL 0)
Cédric Roux's avatar
Cédric Roux committed
444
445
execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
                RESULT_VARIABLE ret)
Cédric Roux's avatar
Cédric Roux committed
446
447
448
if (NOT ${ret} STREQUAL 0)
  message(FATAL_ERROR "${fix_asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0)
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)

set(X2AP_OAI_generated
  ${X2AP_C_DIR}/x2ap_decoder.c
  ${X2AP_C_DIR}/x2ap_encoder.c
  ${X2AP_C_DIR}/x2ap_xer_print.c
  ${X2AP_C_DIR}/x2ap_ies_defs.h
  )
file(GLOB x2ap_h ${X2AP_C_DIR}/*.h)
set(x2ap_h ${x2ap_h} )

#message("calling ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}")
add_custom_command (
  OUTPUT ${X2AP_OAI_generated}
  COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
  COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
Cédric Roux's avatar
Cédric Roux committed
465
  COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
466
467
468
469
470
471
472
473
474
475
476
477
  DEPENDS ${X2AP_ASN_FILES}
  )

add_library(X2AP_LIB
  ${X2AP_OAI_generated}
  ${X2AP_source}
  ${X2AP_DIR}/x2ap_common.c
  )

include_directories ("${X2AP_C_DIR}")
include_directories ("${X2AP_DIR}")

thomasl's avatar
thomasl committed
478
479
# Hardware dependant options
###################################
thomasl's avatar
thomasl committed
480
481
482
483
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")

484
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
485

486
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
487

knopp's avatar
knopp committed
488

489
490
# include RF devices / transport protocols library modules
######################################################################
thomasl's avatar
thomasl committed
491

492
493
494
495
496
include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
#set (option_HWEXMIMOLIB_lib "-l ")
set(HWLIB_EXMIMO_SOURCE 
  ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
497
#  ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
498
499
500
501
502
503
504
505
506
  )
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )

include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
set (option_HWUSRPLIB_lib "-l uhd")
set(HWLIB_USRP_SOURCE 
  ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
  )
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
thomasl's avatar
thomasl committed
507

508
509
510
511
512
513
514
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
set (option_HWBLADERFLIB_lib "-l bladerf")
set(HWLIB_BLADERF_SOURCE 
  ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
  )
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )

515
516
517
518
519
520
521
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
set(HWLIB_LMSSDR_SOURCE 
  ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
  )
add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )

522
523
524
525
526
527
528
529
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
set(TPLIB_ETHERNET_SOURCE 
  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
  )
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )

530

531
532
# RF devices / transport protocols settings
######################################################################
thomasl's avatar
thomasl committed
533
if (${RF_BOARD} STREQUAL "EXMIMO")
thomasl's avatar
thomasl committed
534
535
536
  set(DRIVER2013)
  include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
  include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
537
  set(HW_SOURCE ${HW_SOURCE}
538
539
    ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c)
#    ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
540
  set(option_HW_lib "-rdynamic -ldl")
541

542
elseif (${RF_BOARD} STREQUAL "OAI_USRP")
thomasl's avatar
thomasl committed
543
  include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
thomasl's avatar
thomasl committed
544
  include_directories("/opt/include/uhd")
thomasl's avatar
thomasl committed
545
546
  set(HW_SOURCE ${HW_SOURCE}
    ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
thomasl's avatar
thomasl committed
547
  LINK_DIRECTORIES("/opt/lib")
548
  set(option_HW_lib "-luhd -rdynamic -ldl")
549

550
551
552
553
554
555
556
elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
  include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
  include_directories("${OPENAIR2_DIR}/UTIL/LOG")
  include_directories("/usr/include")
  set(HW_SOURCE ${HW_SOURCE}
    ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
    )
navid's avatar
navid committed
557
  LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
558

559
  set(option_HW_lib "bladeRF -rdynamic -ldl")
navid's avatar
navid committed
560

561
562
563
564
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
565
566
  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
knopp's avatar
knopp committed
567
  LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
568
569
570
  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
571
  set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
572
  set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
knopp's avatar
knopp committed
573

thomasl's avatar
thomasl committed
574
575
576
577
578
elseif (${RF_BOARD} STREQUAL "CPRIGW")
  set(HW_SOURCE ${HW_SOURCE}
    ${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
    )
  include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
579
580
  set(option_HW_lib "-rdynamic dl")
  
thomasl's avatar
thomasl committed
581
endif (${RF_BOARD} STREQUAL "EXMIMO")
582

583

584
585
if (${TRANSP_PRO} STREQUAL "ETHERNET")
  
thomasl's avatar
thomasl committed
586
  include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
587
  set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
588
    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
589
590
    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
591
    )
592
  set(option_TP_lib "-rdynamic -ldl")
593

594
  
595
596
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
##########################################################
597

thomasl's avatar
thomasl committed
598
599
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")

laurent's avatar
laurent committed
600
Message("DEADLINE_SCHEDULER flag  is ${DEADLINE_SCHEDULER}")
Rohit Gupta's avatar
Rohit Gupta committed
601
Message("CPU_Affinity flag is ${CPU_AFFINITY}")
thomasl's avatar
thomasl committed
602
603
604
605
606
607
608
609

##############################################################
#    ???!!! TO BE DOCUMENTED OPTIONS !!!???
##############################################################
add_boolean_option(ENABLE_SECURITY         True  "Enable LTE integrity and ciphering between RRC UE and eNB")
add_boolean_option(ENABLE_USE_MME          True  "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
add_boolean_option(NO_RRM                  True  "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
add_boolean_option(USER_MODE True "????")
610
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
thomasl's avatar
thomasl committed
611
612

add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
613
add_boolean_option(DISABLE_USE_NAS False "???")
laurent's avatar
laurent committed
614
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
Rohit Gupta's avatar
Rohit Gupta committed
615
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
616
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
617
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
thomasl's avatar
thomasl committed
618
add_boolean_option(OAISIM False "specific to oaisim")
thomasl's avatar
thomasl committed
619
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
	add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
	add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
	add_boolean_option(MESSAGE_CHART_GENERATOR False         "For generating sequence diagrams")
	add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
	add_boolean_option(MESSAGE_CHART_GENERATOR_PHY     False "trace some PHY exchanges in sequence diagrams")

	add_boolean_option(ENB_AGENT                   True         "enable eNB agent to inteface with a SDN contrller")

	########################
	# Include order
	##########################
	add_boolean_option(ENB_MODE True "Swap the include directories between openair2 and openair3" )

	##########################
	# Emulation options
	##########################
	add_boolean_option(ENABLE_PGM_TRANSPORT    False "specific to oaisim, emulation through ethernet, reliable multicast")
	add_boolean_option(ADDR_CONF               False "specific to oaisim, IP autoconf of user-plane IP interface")
	add_boolean_option(OPENAIR_EMU             False "specific to oaisim")
	add_boolean_option(OAI_EMU                 False "specific to oaisim")
	add_boolean_option(PHY_ABSTRACTION         False "specific to oaisim")

	##########################
	# SCHEDULING/REAL-TIME/PERF options
	##########################
	add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
	add_boolean_option(ENABLE_VCD              True  "always true now, time measurements of proc calls and var displays")
	add_boolean_option(ENABLE_VCD_FIFO         True  "time measurements of proc calls and var displays sent to FIFO (one more thread)")
	add_boolean_option(HARD_RT                 False "???")
	add_boolean_option(LINUX                   False "used in weird memcpy() in pdcp.c ???")
	add_boolean_option(LINUX_LIST              False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
	add_boolean_option(LOG_NO_THREAD           True  "Disable thread for log, seems always set to true")
	add_boolean_option(OPENAIR_LTE             True "Seems legacy: keep it to true")

	##########################
	# PHY options
	##########################
	add_boolean_option(DRIVER2013              True "only relevant for EXMIMO")
	add_boolean_option(ENABLE_FXP              True "????")
	add_boolean_option(ENABLE_NEW_MULTICAST    False "specific to oaisim")
	add_boolean_option(EXMIMO_IOT              True "????")
	add_boolean_option(LARGE_SCALE             False "specific to oaisim: defines max eNB=2 and max UE=120")
	add_boolean_option(LOCALIZATION            False "???")
	add_integer_option(MAX_NUM_CCs             1     "????")
	add_boolean_option(MU_RECEIVER             False "????")
	add_boolean_option(NEW_FFT                 True "????")
	add_boolean_option(OPENAIR1                True "????")
	add_boolean_option(PBS_SIM                 False "????")
	add_boolean_option(PC_DSP                  True "????")
	add_boolean_option(PC_TARGET               True "????")
	add_boolean_option(PERFECT_CE              False "????")
	add_boolean_option(PHYSIM                  True  "for L1 simulators (dlsim, ulsim, ...)")
	add_boolean_option(PHY_CONTEXT             True "not clear: must remain False for dlsim")
	add_boolean_option(PHY_EMUL                False "not clear: must remain False for dlsim")
	add_boolean_option(PUCCH                   True "????")
	add_boolean_option(RANDOM_BF               False "????")
	add_boolean_option(SMBV                    False "Rohde&Schwarz SMBV100A vector signal generator")
	add_boolean_option(DEBUG_PHY               False "Enable PHY layer debugging options")
	add_boolean_option(DEBUG_PHY_PROC          False "Enable debugging of PHY layer procedures")
	add_boolean_option(DEBUG_DLSCH             False "Enable debugging of DLSCH physical layer channel")

	##########################
	# 802.21 options
	##########################
	add_boolean_option(ENABLE_RAL              False "ENABLE 802.21 INTERFACE")
	add_boolean_option(USE_3GPP_ADDR_AS_LINK_ADDR False "As per attribute name")

	##########################
	# NAS LAYER OPTIONS
	##########################
	add_boolean_option(ENABLE_NAS_UE_LOGGING   True  "????")
	add_boolean_option(NAS_BUILT_IN_UE         True  "UE NAS layer present in this executable")
	add_boolean_option(NAS_UE                  True  "NAS UE INSTANCE (<> NAS_MME)")


	##########################
	# ACCESS STRATUM LAYER2 OPTIONS
	##########################
	add_boolean_option(MAC_CONTEXT             True  "specific to oaisim")
	add_boolean_option(JUMBO_FRAME             True  "ENABLE LARGE SDU in ACCESS STRATUM (larger than common MTU)")

	##########################
	# RLC LAYER OPTIONS
	##########################
	add_boolean_option(OPENAIR2                True  "Access Stratum layer 2 built in executable")
	add_boolean_option(TRACE_RLC_PAYLOAD       False "Fatal assert in this case")
	add_boolean_option(RLC_STOP_ON_LOST_PDU    False "Fatal assert in this case")

	add_boolean_option(TRACE_RLC_MUTEX         True  "TRACE for RLC, possible problem in thread scheduling")
	add_boolean_option(TRACE_RLC_AM_BO         False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_FREE_SDU   False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_HOLE       False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_PDU        False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_RESEGMENT  False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_RX         False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_RX_DECODE  False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_TX         False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_TX_STATUS  False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_AM_STATUS_CREATION   False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")

	add_boolean_option(STOP_ON_IP_TRAFFIC_OVERLOAD      False "")
	add_boolean_option(TRACE_RLC_UM_DAR        False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_UM_DISPLAY_ASCII_DATA  False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_UM_PDU        False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_UM_RX         False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_UM_SEGMENT    False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")
	add_boolean_option(TRACE_RLC_UM_TX_STATUS  False "TRACE for RLC UM, TO BE CHANGED IN A MORE GENERAL FLAG")


	##########################
	# PDCP LAYER OPTIONS
	##########################
	add_boolean_option(PDCP_USE_NETLINK            False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
	add_boolean_option(PDCP_USE_NETLINK_QUEUES     False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
	add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER  False "For eNB, PDCP communicate with a IP driver")
	add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U     True  "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")

	##########################
	# RRC LAYER OPTIONS
	##########################
	add_boolean_option(RRC_DEFAULT_RAB_IS_AM       False  "Otherwise it is UM, configure params are actually set in rrc_eNB.c:rrc_eNB_generate_defaultRRCConnectionReconfiguration(...)")


	##########################
	# S1AP LAYER OPTIONS
	##########################
	# none

	##########################
	# PROJECTS (IST, FRENCH COLL., etc)
	# SPECIFIC OPTIONS
	##########################
	add_boolean_option(SPECTRA False "???")
	add_boolean_option(MIH_C_MEDIEVAL_EXTENSIONS False "EXTENSIONS TO MIH 802.21 IN CONTEXT OF IST PROJECT CALLED MEDIEVAL")



	add_boolean_option(EMOS False "????")
	if(${EMOS})
	  add_definitions("-D_FILE_OFFSET_BITS=64")
	  set(EMOS_LIB gps)
	endif(${EMOS})


	 # add the binary tree to the search path for include files
	#######################################################
	# We will find ConfigOAI.h after generation in target directory
	include_directories("${OPENAIR_BIN_DIR}")
	# add directories to find all include files
	# the internal rule is to use generic names such as defs.h
	# but to make it uniq name as adding the relative path in the include directtive
	# example: #include "RRC/LITE/defs.h"
	#find_path (include_dirs_all *.h ${OPENAIR_DIR})
	#find_path (include_dirs_all *.h PATHS /usr/include NO_CMAKE_PATH)
	#include_directories("${include_dirs_all}")

	# Legacy exact order
	if(ENB_MODE)
	  include_directories("${OPENAIR2_DIR}/COMMON")
	  include_directories("${OPENAIR2_DIR}/UTIL")
	  include_directories("${OPENAIR2_DIR}/UTIL/LOG")
	  include_directories("${OPENAIR3_DIR}/COMMON")
	  include_directories("${OPENAIR3_DIR}/UTILS")
	else()
	  include_directories("${OPENAIR3_DIR}/COMMON")
	  include_directories("${OPENAIR3_DIR}/UTILS")
	  include_directories("${OPENAIR2_DIR}/COMMON")
	  include_directories("${OPENAIR2_DIR}/UTIL")
	  include_directories("${OPENAIR2_DIR}/UTIL/LOG")
	endif()
	include_directories("${OPENAIR1_DIR}")
	include_directories("${OPENAIR2_DIR}/NAS")
	include_directories("${OPENAIR2_DIR}")
	include_directories("${OPENAIR2_DIR}/LAYER2/RLC")
	include_directories("${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0")
	include_directories("${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0")
	include_directories("${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0")
	include_directories("${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0")
	include_directories("${OPENAIR2_DIR}/RRC/LITE/MESSAGES")
	include_directories("${OPENAIR2_DIR}/RRC/LITE")
	include_directories("${OPENAIR3_DIR}/RAL-LTE/INTERFACE-802.21/INCLUDE")
	include_directories("${OPENAIR3_DIR}/RAL-LTE/LTE_RAL_ENB/INCLUDE")
	include_directories("${OPENAIR3_DIR}/RAL-LTE/LTE_RAL_UE/INCLUDE")
	include_directories("${OPENAIR_DIR}/common/utils")
	include_directories("${OPENAIR_DIR}/common/utils/itti")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON/API/NETWORK")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON/EMM/MSG")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON/ESM/MSG")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON/IES")
	include_directories("${OPENAIR3_DIR}/NAS/COMMON/UTIL")
	include_directories("${OPENAIR3_DIR}/SECU")
	include_directories("${OPENAIR3_DIR}/SCTP")
	include_directories("${OPENAIR3_DIR}/S1AP")
	include_directories("${OPENAIR2_DIR}/X2AP")
	include_directories("${OPENAIR3_DIR}/UDP")
	include_directories("${OPENAIR3_DIR}/GTPV1-U")
	include_directories("${OPENAIR_DIR}/targets/COMMON")
	include_directories("${OPENAIR_DIR}/targets/ARCH/COMMON")
	include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/")
	include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS")
	include_directories("${OPENAIR2_DIR}/ENB_APP")
	include_directories("${OPENAIR2_DIR}/UTIL/OSA")
	include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
	include_directories("${OPENAIR2_DIR}/UTIL/MEM")
	include_directories("${OPENAIR2_DIR}/UTIL/LISTS")
	include_directories("${OPENAIR2_DIR}/UTIL/FIFO")
	include_directories("${OPENAIR2_DIR}/UTIL/OCG")
	include_directories("${OPENAIR2_DIR}/UTIL/MATH")
	include_directories("${OPENAIR2_DIR}/UTIL/TIMER")
	include_directories("${OPENAIR2_DIR}/UTIL/OMG")
	include_directories("${OPENAIR2_DIR}/UTIL/OTG")
	include_directories("${OPENAIR2_DIR}/UTIL/CLI")
	include_directories("${OPENAIR2_DIR}/UTIL/OPT")
	include_directories("${OPENAIR2_DIR}/UTIL/OMV")
	include_directories("${OPENAIR2_DIR}/RRC/LITE/MESSAGES")
	include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared")
	include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include")
	include_directories("${OPENAIR_DIR}")

	# Utilities Library
	################
	add_library(HASHTABLE
	  ${OPENAIR_DIR}/common/utils/collection/hashtable/hashtable.c
	  ${OPENAIR_DIR}/common/utils/collection/hashtable/obj_hashtable.c
	)
	include_directories(${OPENAIR_DIR}/common/utils/collection/hashtable)

	if (MESSAGE_CHART_GENERATOR)
	  add_library(MSC  
	    ${OPENAIR_DIR}/common/utils/msc/msc.c
	  )  
	  set(MSC_LIB MSC)
	endif()
	include_directories(${OPENAIR_DIR}/common/utils/msc)

	set(UTIL_SRC
	  ${OPENAIR2_DIR}/UTIL/CLI/cli.c
	  ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
	  ${OPENAIR2_DIR}/UTIL/CLI/cli_server.c
	  ${OPENAIR2_DIR}/UTIL/FIFO/pad_list.c
	  ${OPENAIR2_DIR}/UTIL/LISTS/list.c
	  ${OPENAIR2_DIR}/UTIL/LISTS/list2.c
	  ${OPENAIR2_DIR}/UTIL/LOG/log.c
	  ${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
	  ${OPENAIR2_DIR}/UTIL/MATH/oml.c
	  ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_generate_report.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c
	  ${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c
	  ${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c
	  ${OPENAIR2_DIR}/UTIL/OMG/common.c
	  ${OPENAIR2_DIR}/UTIL/OMG/grid.c
	  ${OPENAIR2_DIR}/UTIL/OMG/id_manager.c
	  ${OPENAIR2_DIR}/UTIL/OMG/job.c
	  ${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c
	  ${OPENAIR2_DIR}/UTIL/OMG/omg.c
	  ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
	  ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
	  ${OPENAIR2_DIR}/UTIL/OMG/rwp.c
	  ${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c
	  ${OPENAIR2_DIR}/UTIL/OMG/static.c
	  ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
	  ${OPENAIR2_DIR}/UTIL/OMG/storage_traci_OMG.c
	  ${OPENAIR2_DIR}/UTIL/OMG/trace.c
	  ${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c
	  ${OPENAIR2_DIR}/UTIL/OPT/probe.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg_tx.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg_kpi.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg_models.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg_form.c
	  ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c
	  )
	add_library(UTIL ${UTIL_SRC})

	set(SECU_OSA_SRC
	  ${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c
	  ${OPENAIR2_DIR}/UTIL/OSA/osa_rijndael.c
	  ${OPENAIR2_DIR}/UTIL/OSA/osa_snow3g.c
	  ${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eea.c
	  ${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eia.c
	  )
	add_library(SECU_OSA ${SECU_OSA_SRC})

	set(SECU_CN_SRC
	  ${OPENAIR3_DIR}/SECU/kdf.c
	  ${OPENAIR3_DIR}/SECU/rijndael.c
	  ${OPENAIR3_DIR}/SECU/snow3g.c
	  ${OPENAIR3_DIR}/SECU/key_nas_deriver.c
	  ${OPENAIR3_DIR}/SECU/nas_stream_eea1.c
	  ${OPENAIR3_DIR}/SECU/nas_stream_eia1.c
	  ${OPENAIR3_DIR}/SECU/nas_stream_eea2.c
	  ${OPENAIR3_DIR}/SECU/nas_stream_eia2.c
	  )
	add_library(SECU_CN ${SECU_CN_SRC})

	# Scheduler
	################################"
	file(GLOB SCHED_SRC ${OPENAIR1_DIR}/SCHED/*.c)
	add_library(SCHED_LIB ${SCHED_SRC})

	# Layer 1
	#############################
	set(PHY_SRC
	  # depend on code generation from asn1c
	  ${RRC_FULL_DIR}/asn1_constants.h
	  # actual source
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pss.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_demodulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/power_control.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_decoding.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_modulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_coding.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_decoding.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
	  ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
	  ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
	  ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
	  ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
	  ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c
	  ${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
	  ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/adjust_gain.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_uespec.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold_mbsfn.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_mbsfn.c
	  ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref.c
	  ${OPENAIR1_DIR}/PHY/CODING/lte_segmentation.c
	  ${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
	  ${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
	  ${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
	  ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
	  ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
	  ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
	  ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
	  ${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
	  ${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
	  ${OPENAIR1_DIR}/PHY/CODING/viterbi.c
	  ${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
	  ${OPENAIR1_DIR}/PHY/INIT/lte_init.c
	  ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
	  ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
	  ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
For faster browsing, not all history is shown. View entire blame