Commit 59cfa1fc authored by thomasl's avatar thomasl

fixing compilation issues with new cmake procedure



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6814 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c8a659a1
......@@ -94,19 +94,35 @@ macro(add_list2_option name val helpstr)
endif()
endmacro(add_list2_option)
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)
####################################################
# compilation flags
#############################################
add_list1_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)
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)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
#
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat")
"${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC")
# add autotools definitions that were maybe used!
set(CMAKE_C_FLAGS
"${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"
)
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
add_definitions("-DCMAKER")
add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O3")
......@@ -126,6 +142,8 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC
# Below is a hard-coded info
set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"")
......@@ -236,21 +254,7 @@ set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES})
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
set(S1AP_OAI_SRC
${S1AP_DIR}/s1ap_common.c
${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
)
set(S1AP_OAI_generated
${S1AP_C_DIR}/s1ap_decoder.c
${S1AP_C_DIR}/s1ap_encoder.c
......@@ -258,19 +262,50 @@ set(S1AP_OAI_generated
${S1AP_C_DIR}/s1ap_ies_defs.h
)
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
set(s1ap_h ${s1ap_h} ${S1AP_C_DIR}/s1ap_ies_defs.h)
set(s1ap_h ${s1ap_h} )
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}
DEPENDS ${S1AP_ASN_FILES}
)
add_library(s1ap_asn1 ${S1AP_OAI_SRC} ${S1AP_OAI_generated} ${S1AP_source})
set(S1AP_LIB s1ap_asn1)
add_library(S1AP_LIB
${S1AP_OAI_generated}
${S1AP_source}
${S1AP_DIR}/s1ap_common.c
)
include_directories ("${S1AP_C_DIR}")
include_directories ("${S1AP_DIR}")
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
)
add_library(S1AP_EPC
${S1AP_C_DIR}/s1ap_ies_defs.h
${S1AP_DIR}/s1ap_mme_encoder.c
${S1AP_DIR}/s1ap_mme_decoder.c
${S1AP_DIR}/s1ap_mme_handlers.c
${S1AP_DIR}/s1ap_mme_nas_procedures.c
${S1AP_DIR}/s1ap_mme.c
${S1AP_DIR}/s1ap_mme_itti_messaging.c
${S1AP_DIR}/s1ap_mme_retransmission.c
${S1AP_DIR}/s1ap_mme_ta.c
)
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
......@@ -304,6 +339,7 @@ include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
###################
add_boolean_option(ADDR_CONF False "specific to oaisim")
add_boolean_option(ASSERT True "???")
add_boolean_option(DISABLE_USE_NAS False "???")
add_boolean_option(DRIVER2013 True "????")
add_boolean_option(ENABLE_FXP True "????")
add_boolean_option(ENABLE_NAS_UE_LOGGING True "????")
......@@ -312,8 +348,13 @@ add_boolean_option(ENABLE_PDCP_NETLINK_FIFO False "????")
add_boolean_option(ENABLE_PGM_TRANSPORT False "specific to oaisim")
add_boolean_option(ENABLE_RAL False "????")
add_boolean_option(ENABLE_SECURITY True "???")
add_boolean_option(ENABLE_STANDALONE_EPC True "Compile MME, SGW and PGW in a single executable")
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
add_boolean_option(ENABLE_USE_GTPU_IN_KERNEL True "as per name")
add_boolean_option(ENABLE_USE_MME True "???")
add_boolean_option(ENABLE_USE_NETFILTER_FOR_SGI False "SGI option")
add_boolean_option(ENABLE_USE_PCAP_FOR_SGI False "SGI option")
add_boolean_option(ENABLE_USE_RAW_SOCKET_FOR_SGI False "As per name")
add_boolean_option(ENABLE_VCD_FIFO True "Seems legacy: always true now")
add_boolean_option(ENB_MODE True "???")
add_boolean_option(HARD_RT False "???")
......@@ -361,7 +402,7 @@ add_boolean_option(UE_BUILD True "????")
add_boolean_option(USE_3GPP_ADDR_AS_LINK_ADDR False "As per attribute name")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_boolean_option(USER_MODE True "????")
add_integer_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(EMOS False "????")
if(${EMOS})
......@@ -383,10 +424,24 @@ include_directories("${OPENAIR_BIN_DIR}")
#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("${OPENAIRCN_DIR}/COMMON")
include_directories("${OPENAIRCN_DIR}/UTILS")
message("openair2 first")
else()
message(openair-cn first)
include_directories("${OPENAIRCN_DIR}/COMMON")
include_directories("${OPENAIRCN_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}/COMMON")
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")
......@@ -417,14 +472,12 @@ 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")
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/LOG")
include_directories("${OPENAIR2_DIR}/UTIL/MATH")
include_directories("${OPENAIR2_DIR}/UTIL/TIMER")
include_directories("${OPENAIR2_DIR}/UTIL/OMG")
......@@ -433,11 +486,14 @@ 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("${OPENAIRCN_DIR}/COMMON")
include_directories("${OPENAIRCN_DIR}/UTILS")
include_directories("${OPENAIRCN_DIR}/NAS")
include_directories("${OPENAIRCN_DIR}/GTPV1-U/nw-gtpv1u/shared")
include_directories("${OPENAIRCN_DIR}/GTPV1-U/nw-gtpv1u/include")
include_directories("${OPENAIRCN_DIR}/SGW-LITE")
include_directories("${OPENAIRCN_DIR}/MME_APP")
include_directories("${OPENAIRCN_DIR}/SGI")
include_directories("${OPENAIRCN_DIR}/S6A")
include_directories("${OPENAIR_DIR}")
# define where are the source files
##################################
......@@ -457,9 +513,12 @@ endfunction(add_whole_tree)
# Utilities Library
################
set(UTIL_SRC
add_library(HASHTABLE
${OPENAIR_DIR}/common/utils/collection/hashtable/hashtable.c
${OPENAIR_DIR}/common/utils/collection/hashtable/obj_hashtable.c
)
set(UTIL_SRC
${OPENAIR2_DIR}/UTIL/CLI/cli.c
${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
${OPENAIR2_DIR}/UTIL/CLI/cli_server.c
......@@ -751,29 +810,162 @@ endif()
# CN libs
##########################
set(GTPV1U_SRC ${OPENAIRCN_DIR}/GTPV1-U)
set (libgtpv1u_SRC
add_library(CN_UTILS
${OPENAIRCN_DIR}/UTILS/conversions.c
${OPENAIRCN_DIR}/UTILS/enum_string.c
${OPENAIRCN_DIR}/UTILS/log.c
${OPENAIRCN_DIR}/UTILS/mme_config.c
${OPENAIRCN_DIR}/UTILS/mcc_mnc_itu.c
)
set(GTPV1U_DIR ${OPENAIRCN_DIR}/GTPV1-U)
set (GTPV1U_SRC
${RRC_DIR}/rrc_eNB_GTPV1U.c
${GTPV1U_SRC}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c
${GTPV1U_SRC}/nw-gtpv1u/src/NwGtpv1uTrxn.c
${GTPV1U_SRC}/nw-gtpv1u/src/NwGtpv1uMsg.c
${GTPV1U_SRC}/nw-gtpv1u/src/NwGtpv1u.c
${GTPV1U_SRC}/gtpv1u_eNB.c
${GTPV1U_SRC}/gtpv1u_teid_pool.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c
${GTPV1U_DIR}/gtpv1u_teid_pool.c
)
add_library(GTPV1U ${GTPV1U_SRC})
set(GTPV2C_DIR ${OPENAIRCN_DIR}/GTPV2-C/nwgtpv2c-0.11/src)
add_library(GTPV2C
${GTPV2C_DIR}/NwGtpv2cTrxn.c
${GTPV2C_DIR}/NwGtpv2cTunnel.c
${GTPV2C_DIR}/NwGtpv2cMsg.c
${GTPV2C_DIR}/NwGtpv2cMsgIeParseInfo.c
${GTPV2C_DIR}/NwGtpv2cMsgParser.c
${GTPV2C_DIR}/NwGtpv2c.c
)
include_directories(${OPENAIRCN_DIR}/GTPV2-C/nwgtpv2c-0.11/include/)
include_directories(${OPENAIRCN_DIR}/GTPV2-C/nwgtpv2c-0.11/shared/)
execute_process(
COMMAND /sbin/iptables -V
OUTPUT_VARIABLE iptables_version
)
string(REGEX REPLACE "[a-zA-Z .\r\n]" "" IPTVERSION ${iptables_version})
string(REGEX REPLACE "[a-zA-Z \r\n]" "" IPTABLES_VERSION_STRING ${iptables_version})
# From original Polaris code, added _lib because cmake doesn't accept two targets with the same name
# and the driver is also named xt_GTPUAH
# the _lib suffix is removed during installation in /lib/xtables
add_library(xt_GTPUAH_lib SHARED ${OPENAIRCN_DIR}/GTPV1-U/GTPUAH/libxt_GTPUAH.c)
target_compile_definitions(xt_GTPUAH_lib PRIVATE
-D_LARGEFILE_SOURCE=1
-D_LARGE_FILES
-D_FILE_OFFSET_BITS=64
-D_REENTRANT
-D_INIT=libxt_GTPUAH_init
-DKVERSION=3
-DPIC
IPTVERSION=${IPTVERSION} -DIPTABLES_VERSION_STRING=\"${IPTABLES_VERSION_STRING}\"
)
add_library(xt_GTPURH_lib SHARED ${OPENAIRCN_DIR}/GTPV1-U/GTPURH/libxt_GTPURH.c)
target_compile_definitions(xt_GTPURH_lib PRIVATE
-D_LARGEFILE_SOURCE=1
-D_LARGE_FILES
-D_FILE_OFFSET_BITS=64
-D_REENTRANT
-D_INIT=libxt_GTPURH_init
-DKVERSION=3
-DPIC
-DIPTVERSION=${IPTVERSION} -DIPTABLES_VERSION_STRING=${IPTABLES_VERSION_STRING}
)
set(SGI_DIR ${OPENAIRCN_DIR}/SGI)
set(SGI_SRC
${SGI_DIR}/sgi_task.c
${SGI_DIR}/sgi_socket.c
${SGI_DIR}/sgi_egress.c
${SGI_DIR}/sgi_util.c
)
add_library(GTPV1U ${libgtpv1u_SRC})
if(ENABLE_USE_PCAP_FOR_SGI)
set(SGI_SRC ${SGI_SRC}
${SGI_DIR}/sgi_pcap.c
)
set(SGI_option_lib ${SGI_option_lib} pcap)
endif()
if (ENABLE_USE_NETFILTER_FOR_SGI)
set(SGI_SRC ${SGI_SRC}
${SGI_DIR}/sgi_nf.c
)
set(SGI_option_lib ${SGI_option_lib} netfilter_queue nfnetlink)
endif()
add_library(SGI ${SGI_SRC})
set(SCTP_SRC
${OPENAIRCN_DIR}/SCTP/sctp_common.c
${OPENAIRCN_DIR}/SCTP/sctp_eNB_task.c
${OPENAIRCN_DIR}/SCTP/sctp_eNB_itti_messaging.c
)
add_library(SCTP ${SCTP_SRC})
add_library(SCTP_CLIENT ${SCTP_SRC})
add_library(SCTP_SERVER
${OPENAIRCN_DIR}/SCTP/sctp_common.c
${OPENAIRCN_DIR}/SCTP/sctp_itti_messaging.c
${OPENAIRCN_DIR}/SCTP/sctp_primitives_server.c
)
add_library(UDP ${OPENAIRCN_DIR}/UDP/udp_eNB_task.c)
set(NAS_SRC ${OPENAIRCN_DIR}/NAS/EURECOM-NAS/src/)
add_library(UDP_SERVER ${OPENAIRCN_DIR}/UDP/udp_primitives_server.c)
set(S11_DIR ${OPENAIRCN_DIR}/S11)
add_library(S11
${S11_DIR}/s11_common.c
${S11_DIR}/s11_ie_formatter.c
${S11_DIR}/s11_mme_task.c
${S11_DIR}/s11_sgw.c
${S11_DIR}/s11_mme_session_manager.c
${S11_DIR}/s11_sgw_session_manager.c
${S11_DIR}/s11_sgw_bearer_manager.c
)
set(S6A_DIR ${OPENAIRCN_DIR}/S6A)
add_library(S6A
${S6A_DIR}/s6a_auth_info.c
${S6A_DIR}/s6a_dict.c
${S6A_DIR}/s6a_error.c
${S6A_DIR}/s6a_peer.c
${S6A_DIR}/s6a_subscription_data.c
${S6A_DIR}/s6a_task.c
${S6A_DIR}/s6a_up_loc.c
)
set(SGW_DIR ${OPENAIRCN_DIR}/SGW-LITE)
add_library (SGW
${SGW_DIR}/spgw_config.c
${SGW_DIR}/s11_causes.c
${SGW_DIR}/sgw_lite_task.c
${SGW_DIR}/sgw_lite_handlers.c
${SGW_DIR}/sgw_lite_context_manager.c
${SGW_DIR}/pgw_lite_paa.c
)
set(MME_DIR ${OPENAIRCN_DIR}/MME_APP)
add_library(MME_APP
${MME_DIR}/mme_app_capabilities.c
${MME_DIR}/mme_app_context.c
${MME_DIR}/mme_app_main.c
${MME_DIR}/mme_app_bearer.c
${MME_DIR}/mme_app_authentication.c
${MME_DIR}/mme_app_location.c
${MME_DIR}/mme_app_statistics.c
${MME_DIR}/s6a_2_nas_cause.c
)
set(NAS_SRC ${OPENAIRCN_DIR}/NAS/EURECOM-NAS/src/)
set(libnas_api_OBJS
${NAS_SRC}api/mme/mme_api.c
${NAS_SRC}api/network/nas_message.c
......@@ -781,6 +973,7 @@ set(libnas_api_OBJS
${NAS_SRC}api/network/network_api.c
)
set(libnas_emm_OBJS
${NAS_SRC}emm/Attach.c
${NAS_SRC}emm/Authentication.c
......@@ -1017,6 +1210,7 @@ set(libnas_usim_OBJS
set(libnas_OBJS
${OPENAIRCN_DIR}/NAS/nas_ue_task.c
${OPENAIRCN_DIR}/NAS/nas_itti_messaging.c
# ${OPENAIRCN_DIR}/NAS/nas_main.c
${NAS_SRC}nas_parser.c
${NAS_SRC}nas_proc.c
${NAS_SRC}nas_user.c
......@@ -1033,6 +1227,7 @@ set(libnas_OBJS
${libnas_api_OBJS}
)
add_library(NAS ${libnas_OBJS})
if(NAS_UE)
set(NAS_LIB NAS)
endif()
......@@ -1155,33 +1350,88 @@ if (${XFORMS})
set(XFORMS_LIBRARIES "forms")
endif (${XFORMS})
# add executables
#################################
# add executables for operation
#################################""
# lte-softmodem is both eNB and UE implementation
###################################################
add_executable(lte-softmodem
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${HW_SOURCE}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
)
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${GTPV1U_DIR}/gtpv1u_eNB.c
${HW_SOURCE}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
)
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB ${S1AP_LIB} GTPV1U SECU_CN SECU_OSA UTIL SCTP UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} ${ITTI_LIB} ${MIH_LIB}
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_USRP} ${XFORMS_LIBRARIES} )
# EPC is ??? nodes implementation in one process
################################
add_executable(oai_epc
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIRCN_DIR}/OAI_EPC/oai_epc_log.c
${OPENAIRCN_DIR}/OAI_EPC/oai_epc.c
${GTPV1U_DIR}/gtpv1u_task.c
${OPENAIRCN_DIR}/SCTP/sctp_primitives_server.c
)
target_link_libraries (oai_epc
-Wl,--start-group
S1AP_LIB S1AP_EPC GTPV1U GTPV2C SCTP_SERVER UDP_SERVER SECU_CN SECU_OSA SGI S6A SGW MME_APP LFDS ${NAS_LIB} ${ITTI_LIB} CN_UTILS HASHTABLE
-Wl,--end-group
pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
)
# oai_sgw is SGW node implementation
################################
add_executable(oai_sgw
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIRCN_DIR}/OAI_SGW/oai_sgw_log.c
${OPENAIRCN_DIR}/OAI_SGW/oai_sgw.c
)
target_link_libraries (oai_sgw
-Wl,--start-group
GTPV1U SECU_CN SECU_OSA SGI S6A SGW UTIL LFDS ${ITTI_LIB}
-Wl,--end-group
pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
)
# USIM process
#################
add_executable(usim_data
${OPENAIRCN_DIR}/NAS/EURECOM-NAS/tools/usim_data.c
)
target_link_libraries (usim_data nettle crypto m)
# ???
#####################
add_executable(ue_data
${OPENAIRCN_DIR}/NAS/EURECOM-NAS/tools/ue_data.c
)
target_link_libraries (ue_data nettle crypto m)
###################################"
# Addexecutables for tests
####################################
# A all in one network simulator
################
add_executable(oaisim
${rrc_h}
${s1ap_h}
......@@ -1204,7 +1454,7 @@ ${XFORMS_SOURCE}
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim
-Wl,--start-group
RRC_LIB ${S1AP_LIB} GTPV1U SECU_CN UTIL SCTP UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB}
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN UTIL SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group )
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_USRP}
......@@ -1212,6 +1462,9 @@ target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LI
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim forms)
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
#####################################
foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
add_executable(${myExe}
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
......@@ -1223,6 +1476,46 @@ foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syn
)
endforeach(myExe)
#unitary tests for Core NEtwork pieces
#################################
foreach(myExe s1ap
secu_knas_encrypt_eia1
secu_kenb
aes128_ctr_encrypt
aes128_ctr_decrypt
secu
secu_knas_stream_int
secu_knas_encrypt_eea2
secu_knas secu_knas_encrypt_eea1
kdf
aes128_cmac_encrypt
secu_knas_encrypt_eia2)
add_executable(test_${myExe}
${OPENAIRCN_DIR}/TEST/test_util.c
${OPENAIRCN_DIR}/TEST/test_${myExe}.c
)
target_link_libraries (test_${myExe}
-Wl,--start-group UTIL LFDS -Wl,--end-group fdproto fdcore
)
endforeach(myExe)
# to be added
#../targets/TEST/PDCP/test_pdcp.c
#../targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
# ???
###########################
add_executable(oaisim_mme
${OPENAIRCN_DIR}/OAISIM_MME/oai_mme_log.c
${OPENAIRCN_DIR}/OAISIM_MME/oaisim_mme.c
)
target_link_libraries (oaisim_mme
${ITTI_LIB} ${NAS_LIB} S1AP_LIB S1AP_ENB
S11 S6A UTILS UDP MME_APP SECU_CN LFDS fdproto fdcore
)
##################################################
# Generated specific cases is not regular code
###############################################
......@@ -1341,6 +1634,13 @@ if(OAI_NW_DRIVER_USE_NETLINK)
endif()
make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
# GTP
########################
# KVERSION is not used in the code, but required
set(module_cc_opt "${module_cc_opt} -DKVERSION=3")
make_driver(xt_GTPUAH ${OPENAIRCN_DIR}/GTPV1-U/GTPUAH "")
make_driver(xt_GTPURH ${OPENAIRCN_DIR}/GTPV1-U/GTPURH "")
# add the install targets
#install (TARGETS Tutorial DESTINATION bin)
#install (FILES "${PROJECT_BIN_DIR}/TutorialConfig.h" DESTINATION include)
......@@ -33,6 +33,114 @@
#######################################
SUDO=sudo
###############################
## echo and family
###############################
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
reset_color='\E[00m'
COLORIZE=1
cecho() {
# Color-echo
# arg1 = message
# arg2 = color
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$green}
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color"
echo -e "$message"
return
}
echo_error() { cecho "$*" $red ;}
echo_fatal() { cecho "$*" $red; exit -1 ;}
echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
print_help() {
echo_info '
This program installs OpenAirInterface Software
You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
Options
-h
This help
-c | --clean
Erase all files made by previous compilation, installation"
--clean-kernel
Erase previously installed features in kernel: iptables, drivers, ...
-C | --config-file
The configuration file to install
-I | --install-external-packages
Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...
-g | --run-with-gdb
Add debugging symbols to compilation directives
-eNB
Makes the eNB LTE softmodem
-UE
Makes the UE softmodem
-oaisim
Makes the oaisim simulator
-unit_simulators
Makes the unitary tests Layer 1 simulators
-EPC
Makes the EPC
-r | --3gpp-release
default is Rel10,
Rel8 limits the implementation to 3GPP Release 8 version
-w | --hardware
EXMIMO (Default), USRP, None
Adds this RF board support (in external packages installation and in compilation)
-s | --check
runs a set of auto-tests based on simulators and several compilation tests
-V | --vcd
Adds a debgging facility to the binary files: GUI with major internal synchronization events
-x | --xforms
Adds a software oscilloscope feature to the produced binaries
Typical Options for a quick startup with a COTS UE and Eurecom RF board: build_oai.bash -I -g -eNB -EPC -x'
}
###########################
# Cleaners
###########################
clean_kernel() {
$SUDO modprobe ip_tables
$SUDO modprobe x_tables
$SUDO iptables -P INPUT ACCEPT
$SUDO iptables -F INPUT
$SUDO iptables -P OUTPUT ACCEPT
$SUDO iptables -F OUTPUT
$SUDO iptables -P FORWARD ACCEPT
$SUDO iptables -F FORWARD
$SUDO iptables -t nat -F
$SUDO iptables -t mangle -F
$SUDO iptables -t filter -F
$SUDO iptables -t raw -F
echo_info "Flushed iptables"
$SUDO rmmod nasmesh > /dev/null 2>&1
$SUDO rmmod oai_nw_drv > /dev/null 2>&1
$SUDO rmmod openair_rf > /dev/null 2>&1
$SUDO rmmod ue_ip > /dev/null 2>&1
echo_info "removed drivers from kernel"
}
clean_all_files() {
dir=$OPENAIR_DIR/cmake
rm -rf $dir/log $dir/bin $dir/autotests/bin $dir/autotests/log $dir/autotests/*/buid $dir/build_*/build
}
###################################
# Compilers
###################################
compilations() {
cd $OPENAIR_DIR/cmake_targets/$1
{
......@@ -132,6 +240,10 @@ run_compilation_autotests() {
"test 0120: nasmesk.ko failed"
}
##########################################
# X.509 certificates
##########################################
make_one_cert() {
openssl genrsa -out $1.key.pem 1024
openssl req -new -batch -out $1.csr.pem -key $1.key.pem -subj /CN=$1.eur/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
......@@ -163,6 +275,10 @@ make_certs(){
}
############################################
# External packages installers
############################################
install_nettle_from_source() {
cd /tmp
echo "Downloading nettle archive"
......@@ -311,7 +427,7 @@ check_install_asn1c(){
compile_hss() {
cd $OPENAIRCN_DIR/OPENAIRHSS
if [ "$1" -eq 1 ]; then
if [ "$CLEAN" = "1" ]; then
echo_info "build a clean HSS"
rm -rfv obj* m4 .autom4* configure
fi
......@@ -336,79 +452,6 @@ compile_hss() {
return 1
}
compile_epc() {
cd $OPENAIRCN_DIR
if [ "$1" = 1 ]; then
echo_info "build a clean EPC"
bash_exec "rm -rf objs"
fi
OBJ_DIR=`find . -maxdepth 1 -type d -iname obj*`
if [ ! -n "$OBJ_DIR" ]; then
OBJ_DIR="objs"
bash_exec "mkdir -m 777 ./$OBJ_DIR"
echo_success "Created $OBJ_DIR directory"
else
OBJ_DIR=`basename $OBJ_DIR`
fi
if [ ! -f $OBJ_DIR/Makefile ]; then
if [ ! -n "m4" ]; then
mkdir -m 777 m4
fi
bash_exec "autoreconf -i -f"
echo_success "Invoking autogen"
bash_exec "libtoolize"
bash_exec "./autogen.sh"
cd ./$OBJ_DIR
echo_success "Invoking configure"
if [ $DEBUG -ne 0 ]; then
../configure --enable-debug --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib
else
../configure --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib
fi
else
cd ./$OBJ_DIR
fi
# pkill oai_epc
# pkill tshark
if [ -f Makefile ]; then
echo_success "Compiling..."
make -j $NUM_CPU
if [ $? -ne 0 ]; then
echo_error "Build failed, exiting"
return 1
else
cp -pf ./OAI_EPC/oai_epc $OPENAIR_TARGETS/bin
fi
else
echo_error "Configure failed, exiting"
return 1
fi
cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH;
make
if [ $? -ne 0 ]; then
echo_error "Build GTPUAH module failed, exiting"
return 1
else
$SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
$SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
fi
cd $OPENAIRCN_DIR/GTPV1-U/GTPURH;
make
if [ $? -ne 0 ]; then
echo_error "Build GTPURH module failed, exiting"
return 1
else
$SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
$SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
fi
return 0
}
compile_nas_tools() {
export NVRAM_DIR=$OPENAIR_TARGETS/bin
......@@ -426,46 +469,10 @@ compile_nas_tools() {
touch /tmp/nas_cleaned
}
# arg1 is RT
# arg2 is HW
# arg3 is ENB_S1
install_ltesoftmodem() {
# RT
if [ $1 = "RTAI" ]; then
if [ ! -f /tmp/init_rt_done.tmp ]; then
echo_info " 8.1 Insert RTAI modules"
$SUDO insmod /usr/realtime/modules/rtai_hal.ko > /dev/null 2>&1
$SUDO insmod /usr/realtime/modules/rtai_sched.ko > /dev/null 2>&1
$SUDO insmod /usr/realtime/modules/rtai_sem.ko > /dev/null 2>&1
$SUDO insmod /usr/realtime/modules/rtai_fifos.ko > /dev/null 2>&1
$SUDO insmod /usr/realtime/modules/rtai_mbx.ko > /dev/null 2>&1
$SUDO touch /tmp/init_rt_done.tmp
$SUDO chmod 666 /tmp/init_rt_done.tmp
else
echo_warning " 8.1 RTAI modules already inserted"
fi
fi
#HW
if [ $2 = "EXMIMO" ]; then
echo_info " 8.2 [EXMIMO] creating RTAI fifos"
for i in `seq 0 64`; do
have_rtfX=`ls /dev/ |grep -c rtf$i`;
if [ "$have_rtfX" -eq 0 ] ; then
$SUDO mknod -m 666 /dev/rtf$i c 150 $i;
fi;
done
echo_info " 8.3 [EXMIMO] Build lte-softmodemdrivers"
cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make clean && make # || exit 1
cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean && make # || exit 1
echo_info " 8.4 [EXMIMO] Setup RF card"
cd $OPENAIR_TARGETS/RT/USER
. ./init_exmimo2.sh
else
if [ $2 = "USRP" ]; then
echo_info " 8.2 [USRP] "
fi
TDB() {
if [ $2 = "USRP" ]; then
echo_info " 8.2 [USRP] "
fi
# ENB_S1
......@@ -596,49 +603,3 @@ set_openair_env(){
}
###############################
## echo and family
###############################
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
reset_color='\E[00m'
cecho() # Color-echo
# arg1 = message
# arg2 = color
{
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$green}
if [ "$BUILD_FROM_MAKEFILE" = "" ]; then
echo -e -n "$color$message$reset_color"
echo
else
echo "$message"
fi
return
}
echo_error() { cecho "$*" $red ;}
echo_fatal() { cecho "$*" $red; exit -1 ;}
echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
bash_exec() {
output=$($1 2>&1)
result=$?
if [ $result -eq 0 ]; then
echo_success "$1"
else
echo_error "$1: $output"
fi
}
......@@ -42,126 +42,99 @@ source $THIS_SCRIPT_PATH/build_helper.bash
#EMULATION_MULTICAST_GROUP=1
#EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
TARGET="ALL"
XFORMS="False"
VCD_TIMING="False"
REL="Rel10"
HW="EXMIMO"
until [ -z "$1" ]
do
case "$1" in
-c | --clean)
export CLEAN=1
echo "Will re-compile ALL"
do
case "$1" in
-c | --clean)
CLEAN=1
clean_all_files
echo_info "Erased all previously producted files"
shift;
;;
--clean-iptables)
CLEAN_IPTABLES=1;
--clean-kernel)
clean_kernel
echo_info "Erased iptables config and removed modules from kernel"
shift;
;;
-C | --config-file)
-C | --config-file)
CONFIG_FILE=$2
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else
# may be absolute path
if [ -f $CONFIG_FILE ]; then
echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else
echo "config file not found"
exit 1
fi
fi
echo_info "Will install the config file $CONFIG_FILE"
shift 2;
;;
-D | --disable-check-installed-software)
DISABLE_CHECK_INSTALLED_SOFTWARE=1
echo "disable check installed software"
-I | --install-external-packages)
INSTALL_EXTERNAL
echo_info "Will install external packages"
shift;
;;
-g | --run-with-gdb)
-g | --run-with-gdb)
GDB=1
echo "Running with gdb"
echo_info "Will Compile with gdb symbols"
shift;
;;
-K | --itti-dump-file)
ITTI_ANALYZER=1
ITTI_DUMP_FILE=$2
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
EXE_ARGUMENTS="$EXE_ARGUMENTS -K $ITTI_DUMP_FILE"
shift 2;
;;
-l | --build-target)
TARGET=$2
echo "setting top-level build target to: $2"
shift 2;
;;
-eNB)
eNB=1
echo_info "Will compile eNB"
shift;;
-UE)
UE=1
echo_info "Will compile UE"
shift;;
-unit_simulators)
SIMUS=1
echo_info "Will compile dlsim, ulsim, ..."
shift;;
-oaisim)
oaisim=1
echo_info "Will compile oaisim and drivers nasmesh, ..."
shift;;
-EPC)
EPC=1
echo_info "Will compile EPC"
shift;;
-h | --help)
print_help
exit 1
;;
-r | --3gpp-release)
REL=$2
echo "setting release to: $REL"
echo_info "setting release to: $REL"
shift 2 ;
;;
-s | --check)
OAI_TEST=1
echo "setting sanity check to: $OAI_TEST"
echo_info "Will run auto-tests"
shift;
;;
-V | --vcd)
echo "setting gtk-wave output"
echo_info "setting gtk-wave output"
VCD_TIMING=1
EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
shift ;
;;
-w | --hardware)
HW="$2" #"${i#*=}"
echo "setting hardware to: $HW"
echo_info "setting hardware to: $HW"
shift 2 ;
;;
-x | --xforms)
XFORMS=1
EXE_ARGUMENTS="$EXE_ARGUMENTS -d"
echo "setting xforms to: $XFORMS"
echo_info "Will generate the software oscilloscope features"
shift;
;;
*)
echo "Unknown option $1"
print_help
echo_fatal "Unknown option $1"
break ;
;;
esac
done
################################
# cleanup first
################################
echo_info "1. Cleaning ..."
if [ "$CLEAN_IPTABLES" == "1" ] ; then
echo_info "Flushing iptables..."
$SUDO modprobe ip_tables
$SUDO modprobe x_tables
$SUDO iptables -P INPUT ACCEPT
$SUDO iptables -F INPUT
$SUDO iptables -P OUTPUT ACCEPT
$SUDO iptables -F OUTPUT
$SUDO iptables -P FORWARD ACCEPT
$SUDO iptables -F FORWARD
$SUDO iptables -t nat -F
$SUDO iptables -t mangle -F
$SUDO iptables -t filter -F
$SUDO iptables -t raw -F
echo_info "Flushed iptables"
fi
############################################
# setting and printing OAI envs, we should check here
############################################
......@@ -170,59 +143,62 @@ echo_info "2. Setting the OAI PATHS ..."
set_openair_env
cecho "OPENAIR_HOME = $OPENAIR_HOME" $green
cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green
cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green
cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green
cecho "OPENAIRCN_DIR = $OPENAIRCN_DIR" $green
cecho "OPENAIR_TARGETS = $OPENAIR_TARGETS" $green
dbin=$OPENAIR_HOME/cmake_targets/bin
dlog=$OPENAIR_HOME/cmake_targets/log
mkdir -p $dbin $dlog
if [ "$DISABLE_CHECK_INSTALLED_SOFTWARE" != "1" ] ; then
if [ "$INSTALL_EXTERNAL" = "1" ] ; then
echo_info "Installing packages"
check_install_oai_software
echo_info "Making X.509 certificates"
make_certs
check_epc_s6a_certificate
check_hss_s6a_certificate
if [ "$HW" == "USRP" ] ; then
echo_info "installing packages for USRP support"
check_install_usrp_uhd_driver
fi
fi
echo_info "3. building the compilation directives ..."
if [ "$TARGET" = "ALL" -o "$TARGET" = "SOFTMODEM" ] ; then
DIR=$OPENAIR_HOME/cmake_targets
# LTE softmodem compilation
mkdir -p $DIR/lte_build_oai
cmake_file=$DIR/lte_build_oai/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "lte-softmodem")' >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
compilations \
lte_build_oai lte-softmodem \
lte-softmodem $dbin/lte-softmodem.$REL \
$dlog/lte-softmodem.$REL.txt \
"lte-softmodem compiled" \
"lte-softmodem compilation failed"
# ue_ip driver compilation
compilations \
lte_build_oai ue_ip \
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko \
$dlog/ue_ip.txt \
"ue_ip driver compiled" \
"ue_ip driver compilation failed"
DIR=$OPENAIR_HOME/cmake_targets
# Create the cmake directives for selected options
mkdir -p $DIR/lte_build_oai
cmake_file=$DIR/lte_build_oai/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "\"lte-softmodem\"")' >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
if [ "$eNB" = "1" -o "UE" = "1" ] ; then
# LTE softmodem compilation
echo_info "Compiling LTE softmodem"
compilations \
lte_build_oai lte-softmodem \
lte-softmodem $dbin/lte-softmodem.$REL \
$dlog/lte-softmodem.$REL.txt \
"lte-softmodem compiled" \
"lte-softmodem compilation failed"
fi
if [ "$UE" = 1 ] ; then
# ue_ip driver compilation
echo_info "Compiling UE specific part"
compilations \
lte_build_oai ue_ip \
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko \
$dlog/ue_ip.txt \
"ue_ip driver compiled" \
"ue_ip driver compilation failed"
fi
if [ "SIMUS" = "1" ] ; then
# lte unitary simulators compilation
echo_info "Compiling unitary tests simulators"
simlist="dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
log=$dlog/lte-simulators.log
cd $OPENAIR_DIR/cmake_targets/lte-simulators
......@@ -240,61 +216,117 @@ if [ "$TARGET" = "ALL" -o "$TARGET" = "SOFTMODEM" ] ; then
echo_error "$f compilation failed"
fi
done
fi
# EXMIMO drivers & firmware loader
if [ "$HW" = "EXMIMO" ] ; then
compilations \
# EXMIMO drivers & firmware loader
if [ "$HW" = "EXMIMO" ] ; then
echo_info "Compiling Express MIMO 2 board drivers"
compilations \
lte_build_oai openair_rf \
CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko \
$dlog/openair_rf.txt 2>&1 \
"EXMIMO driver compiled" \
"EXMIMO driver compilation failed"
compilations \
lte_build_oai updatefw \
updatefw $dbin/updatefw \
$dlog/updatefw.txt 2>&1 \
"EXMIMO firmware loader compiled" \
"EXMIMO firmware loader compilation failed"
fi
compilations \
lte_build_oai updatefw \
updatefw $dbin/updatefw \
$dlog/updatefw.txt 2>&1 \
"EXMIMO firmware loader compiled" \
"EXMIMO firmware loader compilation failed"
fi
# oasim compilation
cmake_file=$DIR/oaisim_build_oai/CMakeLists.txt
cp $DIR/oaisim_build_oai/CMakeLists.template $cmake_file
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
compilations \
oaisim_build_oai oaisim \
oaisim $dbin/oaisim.$REL \
$dlog/oaisim.$REL.txt 2>&1 \
"oaisim compiled" \
"oaisim compilation failed"
#oai_nw_drv
compilations \
oaisim_build_oai oai_nw_drv \
CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko \
$dlog/oai_nw_drv.txt \
"oai_nw_drv driver compiled" \
"oai_nw_drv driver compilation failed"
# nasmesh driver compilation
compilations \
oaisim_build_oai nasmesh \
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko \
$dlog/nasmesh.txt \
"nasmesh driver compiled" \
"nasmesh driver compilation failed"
if [ "$oaisim" = "1" ] ; then
# oasim compilation
echo_info "Compiling oaisim simulator"
cmake_file=$DIR/oaisim_build_oai/CMakeLists.txt
cp $DIR/oaisim_build_oai/CMakeLists.template $cmake_file
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
compilations \
oaisim_build_oai oaisim \
oaisim $dbin/oaisim.$REL \
$dlog/oaisim.$REL.txt 2>&1 \
"oaisim compiled" \
"oaisim compilation failed"
#oai_nw_drv
compilations \
oaisim_build_oai oai_nw_drv \
CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko \
$dlog/oai_nw_drv.txt \
"oai_nw_drv driver compiled" \
"oai_nw_drv driver compilation failed"
# nasmesh driver compilation
compilations \
oaisim_build_oai nasmesh \
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko \
$dlog/nasmesh.txt \
"nasmesh driver compiled" \
"nasmesh driver compilation failed"
fi
# EPC compilation
##################
if [ "$TARGET" = "ALL" -o "$TARGET" = "SOFTMODEM" ] ; then
compile_epc
if [ "$EPC" = "1" ] ; then
echo_info "Compiling EPC"
cmake_file=$DIR/epc_build_oai/CMakeLists.txt
cp $DIR/epc_build_oai/CMakeLists.template $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
compilations \
epc_build_oai oai_epc \
oai_epc $dbin/oai_epc.$REL \
$dlog/oai_epc.$REL.txt \
"oai_epc compiled" \
"oai_epc compilation failed"
compilations \
epc_build_oai xt_GTPUAH_lib \
libxt_GTPUAH_lib.so $dbin \
$dlog/xt_GTPUAH.txt \
"library xt_GTPUAH compiled" \
"library xt_GTPUAH compilation failed"
compilations \
epc_build_oai xt_GTPURH_lib \
libxt_GTPURH_lib.so $dbin \
$dlog/xt_GTPURH.txt \
"library xt_GTPURH compiled" \
"library xt_GTPURH compilation failed"
compilations \
epc_build_oai xt_GTPURH \
CMakeFiles/xt_GTPURH/xt_GTPURH.ko $dbin \
$dlog/xt_GTPURH.txt \
"module xt_GTPURH driver compiled" \
"module xt_GTPURH driver compilation failed"
compilations \
epc_build_oai xt_GTPUAH \
CMakeFiles/xt_GTPUAH/xt_GTPUAH.ko $dbin \
$dlog/xt_GTPUAH.txt \
"module xt_GTPUAH driver compiled" \
"module xt_GTPUAH compilation failed"
echo_info "Copying iptables libraries into system directory: /lib/xtables"
$SUDO ln -s $dbin/libxt_GTPURH_lib.so /lib/xtables/libxt_GTPURH.so
$SUDO ln -s $dbin/libxt_GTPUAH_lib.so /lib/xtables/libxt_GTPUAH.so
compile_hss
fi
# Install config file
###################
if [ "$CONFIG_FILE" != "" ] ; then
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
fi
if [ -s $CONFIG_FILE ]; then
echo_info "Copy config file in $dbin"
cp $CONFIG_FILE $dbin
else
echo_error "config file not found" fi
fi
fi
# Auto-tests
#####################
if [ "$OAI_TEST" = "1" ]; then
......@@ -303,8 +335,8 @@ if [ "$OAI_TEST" = "1" ]; then
else
echo_info "10. Bypassing the Tests ..."
fi
exit 0
exit 0
......@@ -314,89 +346,14 @@ exit 0
echo_info "5. configure and compile epc"
output=$(compile_epc $OAI_CLEAN >> $OPENAIR_TARGETS/bin/install_log.txt 2>&1 )
epc_compiled=$?
if [ $epc_compiled -ne 0 ]; then
echo_error "EPC compilation failed : check the installation log file bin/install_log.txt"
exit 1
fi
check_for_epc_executable
echo_info "finished epc target: check the installation log file bin/install_log.txt"
if [ $CONFIG_FILE_ACCESS_OK -eq 0 ]; then
echo_error "You have to provide a EPC config file"
exit 1
fi
TEMP_FILE=`tempfile`
VARIABLES=" S6A_CONF\|\
HSS_HOSTNAME\|\
REALM"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ')
cat $CONFIG_FILE | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > $TEMP_FILE
source $TEMP_FILE
rm -f $TEMP_FILE
if [ x"$REALM" == "x" ]; then
echo_error "Your config file do not contain a REALM for S6A configuration"
exit 1
fi
if [ x"$S6A_CONF" != "x./epc_s6a.conf" ]; then
echo_error "Your config file do not contain the good path for the S6A config file,"
echo_error "accordingly to what is done in this script, it should be set to epc_s6a.conf"
exit 1
fi
check_epc_s6a_certificate $REALM
###########################################
# install the binary in bin
##########################################
echo_info "6. install the binary file"
if [ $epc_compiled -eq 0 ]; then
echo_success "target epc built and installed in the bin directory"
echo "target epc built and installed in the bin directory" >> bin/${oai_build_date}
cp -f $CONFIG_FILE $OPENAIR_TARGETS/bin
cp -f $OPENAIRCN_DIR/objs/UTILS/CONF/s6a.conf $OPENAIR_TARGETS/bin/epc_s6a.conf
fi
}
build_hss(){
echo_info "Note: this script tested only for Ubuntu 12.04 x64 -> 14.04 x64"
######################################
# CHECK MISC SOFTWARES AND LIBS #
######################################
if [ $DISABLE_CHECK_INSTALLED_SOFTWARE -eq 0 ]; then
echo_info "4. check the required packages for HSS"
check_install_hss_software
if [ $OAI_CLEAN -eq 1 ]; then
check_install_freediamter
else
if [ ! -d /usr/local/etc/freeDiameter ]; then
check_install_freediamter
fi
fi
else
echo_info "4. Not checking the required packages for HSS"
# Perform some coherency checks
# check HSS_HOSTNAME REALM
fi
######################################
# compile HSS #
######################################
echo_info "5. compile HSS"
# Bad behaviour of $OAI_CLEAN with ./.lock_oaibuild ...
compile_hss $CLEAN_HSS
hss_compiled=$?
check_for_hss_executable
echo_info "finished hss target"
######################################
# Check certificates #
######################################
......@@ -434,54 +391,7 @@ build_hss(){
}
echo_info "3. set the top-level build target"
case "$BUILD_LTE" in
'ENB')
echo_success "build LTE eNB"
build_enb
;;
'EPC')
echo_success "build EPC(MME and xGW)"
build_epc
;;
'HSS')
echo_success "build HSS"
build_hss
;;
'NONE')
;;
*)
;;
esac
# Additional operation
############################################
# Generate doxygen documentation
############################################
if [ $DOXYGEN = 1 ]; then
echo_info "9. Generate doxygen documentation ..."
doxygen $OPENAIR_TARGETS/DOCS/Doxyfile
echo_info "9.1 use your navigator to open $OPENAIR_TARGETS/DOCS/html/index.html "
else
echo_info "9. Bypassing doxygen documentation ..."
fi
############################################
# testing
############################################
if [ $OAI_TEST -eq 1 ]; then
echo_info "10. Running OAI pre commit tests (pre-ci) ..."
python $OPENAIR_TARGETS/TEST/OAI/test01.py -l
else
echo_info "10. Bypassing the Tests ..."
fi
############################################
# run
############################################
......
......@@ -29,6 +29,9 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef CMAKER
#include <platform_types.h>
#endif
#if defined(ENB_MODE)
# define display_backtrace()
......
......@@ -438,7 +438,9 @@ __init gtpuah_tg_init(void) {
pr_info("GTPUAH: Initializing module (KVersion: %d)\n", KVERSION);
pr_info("GTPUAH: Copyright Polaris Networks 2010-2011\n");
pr_info("GTPUAH: Modified by EURECOM Lionel GAUTHIER 2014\n");
#ifndef CMAKER
pr_info("GTPUAH: Compiled %s at time %s\n",__DATE__,__TIME__);
#endif
#if defined(WITH_IPV6)
pr_info("GTPURH: IPv4/IPv6 enabled\n");
#else
......
......@@ -530,7 +530,9 @@ __init gtpurh_tg_init(void) {
pr_info("GTPURH: Initializing module (KVersion: %d)\n", KVERSION);
pr_info("GTPURH: Copyright Polaris Networks 2010-2011\n");
pr_info("GTPURH: Modified by EURECOM Lionel GAUTHIER 2014\n");
#ifndef CMAKER
pr_info("GTPURH: Compiled %s at time %s\n",__DATE__,__TIME__);
#endif
#if defined(WITH_IPV6)
pr_info("GTPURH: IPv4/IPv6 enabled\n");
#else
......
......@@ -66,7 +66,7 @@ mme_app_send_s11_create_session_req(
DevAssert(ue_context_pP != NULL);
#if defined(DISABLE_STANDALONE_EPC)
#if !defined(ENABLE_STANDALONE_EPC)
to_task = TASK_S11;
#else
to_task = TASK_SPGW_APP;
......@@ -664,7 +664,7 @@ mme_app_handle_initial_context_setup_rsp(
return;
}
#if defined(DISABLE_STANDALONE_EPC)
#if !defined(ENABLE_STANDALONE_EPC)
to_task = TASK_S11;
#else
to_task = TASK_SPGW_APP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment