Commit c1e3a9624be5b74c837a32876b65078482ee3450

Authored by Nicola Bui
1 parent f05f7398
Exists in master

OWL release 2.0

Showing 913 changed files with 198138 additions and 62318 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 913 files displayed.

CHANGELOG
1 1 Change Log for Releases
2 2 ==============================
3 3  
  4 +## 002.000.000
  5 + * Added fully functional srsENB to srsLTE code
  6 + * Merged srsUE code into srsLTE and reestructured PHY code
  7 + * Added support for SoapySDR devices (eg LimeSDR)
  8 + * Fixed issues in RLC AM
  9 + * Added support for NEON and AVX in many kernels and Viterbi decoder
  10 + * Added support for CPU affinity
  11 + * Other minor bug-fixes and new features
  12 +
  13 +## 001.004.000
  14 + * Fixed issue in rv for format1C causing incorrect SIB1 decoding in some networks
  15 + * Improved PDCCH decoding BER (fixed incorrect trellis initialization)
  16 + * Improved PUCCH RX performance
  17 +
  18 +## 001.003.000
  19 +
  20 +* Bugfixes:
  21 + * x300 master clock rate
  22 + * PHICH: fixed bug causing more NACKs
  23 + * PBCH: fixed bug in encoding function
  24 + * channel estimation: fixed issue in time interpolation
  25 + * DCI: Fixed bug in Format1A packing
  26 + * DCI: Fixed bug in Format1C for RA-RNTI
  27 + * DCI: Fixed overflow in MIMO formats
  28 +
  29 +* Improvements:
  30 + * Changed and cleaned DCI blind search API
  31 + * Added eNodeB PHY processing functions
4 32  
5 33 ## 001.002.000
6 34  
... ...
CMakeLists.txt
1 1 #
2   -# Copyright 2013-2015 Software Radio Systems Limited
  2 +# Copyright 2013-2017 Software Radio Systems Limited
3 3 #
4   -# This file is part of the srsLTE library.
  4 +# This file is part of srsLTE
5 5 #
6 6 # srsLTE is free software: you can redistribute it and/or modify
7 7 # it under the terms of the GNU Affero General Public License as
... ... @@ -30,25 +30,138 @@ endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
30 30 ########################################################################
31 31 # Project setup
32 32 ########################################################################
33   -CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
34   -PROJECT (SRSLTE)
  33 +cmake_minimum_required(VERSION 2.6)
  34 +project( SRSLTE )
  35 +message( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
  36 +message( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
  37 +message( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
35 38  
36 39 list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
37 40 include(SRSLTEVersion) #sets version information
38 41 include(SRSLTEPackage) #setup cpack
39   -include(BuildMex)
40 42  
41 43 include(CTest)
42   -set( CTEST_MEMORYCHECK_COMMAND valgrind )
  44 +set(CTEST_MEMORYCHECK_COMMAND valgrind)
43 45 configure_file(
44 46 "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in"
45 47 "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
46 48 IMMEDIATE @ONLY)
47 49  
  50 +if(NOT CMAKE_BUILD_TYPE)
  51 + set(CMAKE_BUILD_TYPE Release)
  52 + message(STATUS "Build type not specified: defaulting to Release.")
  53 +endif(NOT CMAKE_BUILD_TYPE)
  54 +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
  55 +
48 56 ########################################################################
49 57 # Options
50 58 ########################################################################
51   -option(DisableMEX "DisableMEX" ON)
  59 +option(ENABLE_SRSUE "Build srsUE application" ON)
  60 +option(ENABLE_SRSENB "Build srsENB application" ON)
  61 +
  62 +option(ENABLE_VOLK "Enable use of VOLK SIMD library" ON)
  63 +option(ENABLE_GUI "Enable GUI (using srsGUI)" ON)
  64 +option(ENABLE_BLADERF "Enable BladeRF" ON)
  65 +
  66 +option(BUILD_STATIC "Attempt to statically link external deps" OFF)
  67 +option(RPATH "Enable RPATH" OFF)
  68 +
  69 +option(USE_LTE_RATES "Use standard LTE sampling rates" OFF)
  70 +
  71 +set(GCC_ARCH native CACHE STRING "GCC compile for specific architecture.")
  72 +
  73 +
  74 +########################################################################
  75 +# Find dependencies
  76 +########################################################################
  77 +find_package(Threads REQUIRED)
  78 +
  79 +find_package(Polarssl)
  80 +if (POLARSSL_FOUND)
  81 + set(SEC_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}")
  82 + set(SEC_LIBRARIES "${POLARSSL_LIBRARIES}")
  83 + add_definitions(-DHAVE_POLARSSL)
  84 +else(POLARSSL_FOUND)
  85 + find_package(MbedTLS REQUIRED)
  86 + if (MBEDTLS_FOUND)
  87 + set(SEC_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}")
  88 + set(SEC_LIBRARIES "${MBEDTLS_LIBRARIES}")
  89 + add_definitions(-DHAVE_MBEDTLS)
  90 + endif (MBEDTLS_FOUND)
  91 +endif(POLARSSL_FOUND)
  92 +
  93 +find_package(UHD)
  94 +if(UHD_FOUND)
  95 + include_directories(${UHD_INCLUDE_DIRS})
  96 + link_directories(${UHD_LIBRARY_DIRS})
  97 +endif(UHD_FOUND)
  98 +
  99 +if(ENABLE_BLADERF)
  100 + find_package(bladeRF)
  101 + if(BLADERF_FOUND)
  102 + include_directories(${BLADERF_INCLUDE_DIRS})
  103 + link_directories(${BLADERF_LIBRARY_DIRS})
  104 + endif(BLADERF_FOUND)
  105 +endif(ENABLE_BLADERF)
  106 +
  107 +find_package(SoapySDR)
  108 +if(SOAPYSDR_FOUND)
  109 + include_directories(${SOAPYSDR_INCLUDE_DIRS})
  110 + link_directories(${SOAPYSDR_LIBRARY_DIRS})
  111 +endif(SOAPYSDR_FOUND)
  112 +
  113 +if(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND)
  114 + set(RF_FOUND TRUE CACHE INTERNAL "RF frontend found")
  115 +else(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND)
  116 + set(RF_FOUND FALSE CACHE INTERNAL "RF frontend found")
  117 + add_definitions(-DDISABLE_RF)
  118 +endif(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND)
  119 +
  120 +if(ENABLE_SRSUE OR ENABLE_SRSENB)
  121 + # Find Boost
  122 + set(BOOST_REQUIRED_COMPONENTS
  123 + program_options
  124 + system
  125 + )
  126 + if(UNIX AND EXISTS "/usr/lib64")
  127 + list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
  128 + endif(UNIX AND EXISTS "/usr/lib64")
  129 + set(Boost_ADDITIONAL_VERSIONS
  130 + "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
  131 + "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
  132 + "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
  133 + "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
  134 + "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
  135 + "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
  136 + "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
  137 + )
  138 + find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
  139 +endif(ENABLE_SRSUE OR ENABLE_SRSENB)
  140 +
  141 +
  142 +if(ENABLE_GUI)
  143 + find_package(SRSGUI)
  144 + if(SRSGUI_FOUND)
  145 + add_definitions(-DENABLE_GUI)
  146 + include_directories(${SRSGUI_INCLUDE_DIRS})
  147 + link_directories(${SRSGUI_LIBRARY_DIRS})
  148 + endif(SRSGUI_FOUND)
  149 +endif(ENABLE_GUI)
  150 +
  151 +include(CheckFunctionExistsMath)
  152 +if(ENABLE_VOLK)
  153 + find_package(Volk)
  154 + if(VOLK_FOUND)
  155 + include_directories(${VOLK_INCLUDE_DIRS})
  156 + link_directories(${VOLK_LIBRARY_DIRS})
  157 + message(STATUS "Compiling with VOLK SIMD library.")
  158 + else(VOLK_FOUND)
  159 + message(STATUS "VOLK SIMD library NOT found. Using generic implementation.")
  160 + endif(VOLK_FOUND)
  161 +else(ENABLE_VOLK)
  162 + message(STATUS "VOLK library disabled")
  163 +endif(ENABLE_VOLK)
  164 +
52 165  
53 166 ########################################################################
54 167 # Install Dirs
... ... @@ -66,17 +179,9 @@ endif()
66 179 set(RUNTIME_DIR bin)
67 180 set(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
68 181 set(INCLUDE_DIR include)
69   -set(MEX_DIR mex)
70 182 set(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}")
71 183 set(DATA_DIR share/${CPACK_PACKAGE_NAME})
72 184  
73   -
74   -if(NOT CMAKE_BUILD_TYPE)
75   - set(CMAKE_BUILD_TYPE Release)
76   - message(STATUS "Build type not specified: defaulting to Release.")
77   -endif(NOT CMAKE_BUILD_TYPE)
78   -set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
79   -
80 185 ########################################################################
81 186 # Compiler specific setup
82 187 ########################################################################
... ... @@ -88,50 +193,79 @@ macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
88 193 endif(${have})
89 194 endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
90 195  
91   -if(CMAKE_COMPILER_IS_GNUCXX)
92   - #Any additional flags for CXX
93   -endif(CMAKE_COMPILER_IS_GNUCXX)
  196 +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  197 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -std=c++03")
94 198  
95   -
96   -if(CMAKE_COMPILER_IS_GNUCC)
97   - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-write-strings -Wno-format-extra-args -Winline -Wno-unused-result -Wno-format -std=c99 -D_GNU_SOURCE -g")
98   -
99 199 if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
100   - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
  200 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -DDEBUG_MODE")
101 201 else(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
102   - find_package(SSE)
  202 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
  203 + endif(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  204 +
  205 + find_package(SSE)
  206 + if (HAVE_AVX2)
  207 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
  208 + else (HAVE_AVX2)
103 209 if(HAVE_AVX)
104   - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
  210 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
105 211 elseif(HAVE_SSE)
106   - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
  212 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
107 213 endif(HAVE_AVX)
  214 + endif (HAVE_AVX2)
  215 +endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  216 +
  217 +ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE)
  218 +
  219 +if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
  220 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-write-strings -Wno-format-extra-args -Winline -Wno-unused-result -Wno-format -std=c99 -D_GNU_SOURCE")
  221 +
  222 + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  223 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -DDEBUG_MODE")
  224 + else(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  225 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
108 226 endif(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  227 +
  228 + if (USE_LTE_RATES)
  229 + message(STATUS "Using standard LTE sampling rates")
  230 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFORCE_STANDARD_RATE")
  231 + endif (USE_LTE_RATES)
  232 +
  233 + find_package(SSE)
  234 + if (HAVE_AVX2)
  235 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
  236 + else (HAVE_AVX2)
  237 + if(HAVE_AVX)
  238 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
  239 + elseif(HAVE_SSE)
  240 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
  241 + endif(HAVE_AVX)
  242 + endif (HAVE_AVX2)
  243 +
  244 + if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  245 + if(HAVE_SSE)
  246 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -funroll-loops")
  247 + endif(HAVE_SSE)
  248 + endif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  249 +
109 250  
110   -
  251 + if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
  252 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -march=native -DIS_ARM -DHAVE_NEON")
  253 + message(STATUS "have ARM")
  254 + endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
  255 + set(CMAKE_REQUIRED_FLAGS ${CMAKE_C_FLAGS})
  256 +
111 257 if(NOT WIN32)
112 258 ADD_CXX_COMPILER_FLAG_IF_AVAILABLE(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
113 259 endif(NOT WIN32)
114   -endif(CMAKE_COMPILER_IS_GNUCC)
115   -
116   -if(MSVC)
117   - include_directories(${PROJECT_SOURCE_DIR}/msvc) #missing headers
118   - add_definitions(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
119   - add_definitions(-DNOMINMAX) #disables stupidity and enables std::min and std::max
120   - add_definitions( #stop all kinds of compatibility warnings
121   - -D_SCL_SECURE_NO_WARNINGS
122   - -D_CRT_SECURE_NO_WARNINGS
123   - -D_CRT_SECURE_NO_DEPRECATE
124   - -D_CRT_NONSTDC_NO_DEPRECATE
125   - )
126   - add_definitions(/MP) #build with multiple processors
127   -endif(MSVC)
  260 +endif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
128 261  
129 262 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
130 263 # The following is needed for weak linking to work under OS X
131 264 set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
132 265 endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
133 266  
134   -
  267 +message(STATUS "CMAKE_C_FLAGS is ${CMAKE_C_FLAGS}")
  268 +message(STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}")
135 269  
136 270 ########################################################################
137 271 # Create uninstall targets
... ... @@ -143,16 +277,11 @@ configure_file(
143 277  
144 278 add_custom_target(uninstall
145 279 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
146   -
147 280  
148 281 ########################################################################
149   -# Macro to add -fPIC property to static libs
  282 +# Add -fPIC property to all targets
150 283 ########################################################################
151   -macro(SRSLTE_SET_PIC)
152   - if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
153   - set_target_properties(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC)
154   - endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
155   -endmacro(SRSLTE_SET_PIC)
  284 +set(CMAKE_POSITION_INDEPENDENT_CODE ON)
156 285  
157 286 ########################################################################
158 287 # Print summary
... ... @@ -163,12 +292,41 @@ message(STATUS "Building for version: ${VERSION}")
163 292 ########################################################################
164 293 # Add general includes and dependencies
165 294 ########################################################################
166   -include_directories(${PROJECT_BINARY_DIR}/srslte/include/)
167   -include_directories(${PROJECT_SOURCE_DIR}/srslte/include/)
168   -include_directories(${PROJECT_SOURCE_DIR}/mex/include)
  295 +include_directories(${PROJECT_BINARY_DIR}/lib/include)
  296 +include_directories(${PROJECT_SOURCE_DIR}/lib/include)
  297 +
  298 +########################################################################
  299 +# Add headers to cmake project (useful for IDEs)
  300 +########################################################################
  301 +set(HEADERS_ALL "")
  302 +file(GLOB headers *)
  303 +foreach(_header ${headers})
  304 + if(IS_DIRECTORY ${_header})
  305 + file(GLOB_RECURSE tmp "${_header}/*.h")
  306 + list(APPEND HEADERS_ALL ${tmp})
  307 + endif(IS_DIRECTORY ${_header})
  308 +endforeach()
  309 +add_custom_target(add_srslte_headers SOURCES ${HEADERS_ALL})
169 310  
170 311 ########################################################################
171 312 # Add the subdirectories
172 313 ########################################################################
173   -add_subdirectory(srslte)
174   -add_subdirectory(mex)
  314 +add_subdirectory(lib)
  315 +
  316 +if(RF_FOUND)
  317 + if(ENABLE_SRSUE)
  318 + message(STATUS "Building with srsUE")
  319 + add_subdirectory(srsue)
  320 + else(ENABLE_SRSUE)
  321 + message(STATUS "srsUE build disabled")
  322 + endif(ENABLE_SRSUE)
  323 +
  324 + if(ENABLE_SRSENB)
  325 + message(STATUS "Building with srsENB")
  326 + add_subdirectory(srsenb)
  327 + else(ENABLE_SRSENB)
  328 + message(STATUS "srsUE build disabled")
  329 + endif(ENABLE_SRSENB)
  330 +else(RF_FOUND)
  331 + message(STATUS "srsUE and srsENB builds disabled due to missing RF driver")
  332 +endif(RF_FOUND)
... ...
COPYRIGHT
1   -Copyright (C) 2013-2015 Software Radio Systems Limited. All rights reserved.
  1 +Copyright (C) 2013-2016 Software Radio Systems Limited. All rights reserved.
2 2  
3 3 The following copyright notices are for libraries used within srsLTE:
4 4  
... ...
README.md.orig 0 โ†’ 100644
... ... @@ -0,0 +1,267 @@
  1 +IMDEA-OWL
  2 +=========
  3 +
  4 +OWL stands for Online Watcher of LTE. imdeaOWL is a free and open-source LTE control channel decoder developed by IMDEA Networks Institute and based on srsLTE, an LTE library for SDR UE and eNodeB developed by SRS (www.softwareradiosystems.com). OWL provides blind (oblivious of the terminal identity) decoding of DCI messages on LTE PDCCH.
  5 +OWL is built on srsLTE v1.3 (https://github.com/srsLTE/srsLTE) and inherits its modularity and main features. It is entirely written in C and, if available in the system, uses the acceleration library VOLK distributed in GNURadio.
  6 +
  7 +![alt text](owl_logo_small.png "OWL Logo")
  8 +
  9 +The OWL software license is AGPLv3.
  10 +
  11 +New feature:
  12 + * OWL now offers a graphical decoder showing: online spectrograph and average (per frame) downlink used resources and data rate. See guidelines below for more details.
  13 +
  14 +OWL specific features:
  15 + * Compliant with DCI formats 0, 1, 1A, 1B, 1C, 1D, 2, 2A
  16 + * Obtains C-RNTIs values from PRACH and using blind decoding verification
  17 + * Maintains a list of active C-RNTIs for robustness and decoding speed
  18 + * Provide means for control channel power analysis (without actual decoding)
  19 +
  20 +OWL Missing Features:
  21 + * Carrier Aggregation
  22 + * Semi-Persistent Scheduling
  23 + * Uplink control channel decoding
  24 +
  25 +srsLTE inherited Features:
  26 + * LTE Release 8 compliant
  27 + * FDD configuration
  28 + * Tested bandwidths: 1.4, 3, 5, 10, 15 and 20 MHz
  29 + * Transmission mode 1 (single antenna) and 2 (transmit diversity)
  30 + * Cell search and synchronization procedure for the UE
  31 + * All DL channels/signals are supported for UE and eNodeB side: PSS, SSS, PBCH, PCFICH, PHICH, PDCCH, PDSCH
  32 + * All UL channels/signals are supported for UE side: PRACH, PUSCH, PUCCH, SRS
  33 + * Frequency-based ZF and MMSE equalizer
  34 + * Highly optimized Turbo Decoder available in Intel SSE4.1/AVX (+100 Mbps) and standard C (+25 Mbps)
  35 + * MATLAB and OCTAVE MEX library generation for many components
  36 + * UE receiver tested and verified with Amarisoft LTE 100 eNodeB and commercial LTE networks (Telefonica Spain, Three.ie and Eircom in Ireland)
  37 +
  38 +srsLTE Missing Features:
  39 + * Closed-loop power control
  40 + * Semi-Persistent Scheduling
  41 + * Aperiodic CQI reports
  42 +
  43 +Hardware
  44 +--------
  45 +
  46 +The library currently supports the Ettus Universal Hardware Driver (UHD) and the bladeRF driver. Thus, any hardware supported by UHD or bladeRF can be used. There is no sampling rate conversion, therefore the hardware should support 30.72 MHz clock in order to work correctly with LTE sampling frequencies and decode signals from live LTE base stations.
  47 +
  48 +We have tested the following hardware:
  49 + * USRP B210
  50 + * USRP X300
  51 + * bladeRF
  52 + * limeSDR
  53 +
  54 +OWL installation and minimal use guide:
  55 +=======================================
  56 +
  57 +OWL is built on the srsLTE library by Software Radio Systems. Thus, if you are already able to use srsLTE (at least pdsch_ue) OWL should run without many issues. However, this guide will give you the minimum set of information to install all the required software on a clean ubuntu 14.04+ installation.
  58 +
  59 +Part 1 - Installation:
  60 +----------------------
  61 +- Install dependencies:
  62 +
  63 +```sh
  64 +$ sudo apt-get install build-essential git cmake libboost-system-dev libboost-test-dev libboost-thread-dev libqwt-dev libqt4-dev libfftw3-dev libsctp-dev libconfig-dev libconfig++-dev
  65 +```
  66 +
  67 +- BladeRF installation (optional)
  68 +
  69 +please refer to https://github.com/Nuand/bladeRF/wiki/Getting-Started%3A-Linux for a complete installation guide
  70 +To activate the release PPA, simply:
  71 +```sh
  72 +$ sudo add-apt-repository ppa:bladerf/bladerf
  73 +$ sudo apt-get update
  74 +$ sudo apt-get install bladerf libbladerf-dev bladerf-firmware-fx3 bladerf-fpga-hostedx40
  75 +```
  76 +
  77 +<<<<<<< HEAD
  78 +- USRP installation (optional)
  79 +=======
  80 +- USRP installation (skip this if you use BladeRF)
  81 +>>>>>>> 8b7eff727c56e7f9b40314a4fbf017326c878436
  82 +
  83 +please refer to https://files.ettus.com/manual/page_install.html for a complete installation guide
  84 +To activate the release PPA, simply:
  85 +```sh
  86 +$ sudo add-apt-repository ppa:ettusresearch/uhd
  87 +$ sudo apt-get update
  88 +$ sudo apt-get install libuhd-dev libuhd003 uhd-host
  89 +```
  90 +
  91 +<<<<<<< HEAD
  92 +- LimeSDR installation (optional)
  93 +
  94 +please refer to https://wiki.myriadrf.org/Lime_Suite for a complete installation guide
  95 +To activate the release PPA, simply:
  96 +```sh
  97 +sudo add-apt-repository -y ppa:myriadrf/drivers
  98 +sudo apt-get update
  99 +sudo apt-get install limesuite limesuite-udev limesuite-images
  100 +sudo apt-get install soapysdr soapysdr-module-lms7 libsoapysdr-dev
  101 +```
  102 +
  103 +- Install srsgui (optional)
  104 +=======
  105 +- Install srsgui
  106 +>>>>>>> 8b7eff727c56e7f9b40314a4fbf017326c878436
  107 +
  108 +This is not mandatory for OWL to work, but is a nice tool and it helps testing srsLTE and OWL:
  109 +```sh
  110 +$ git clone https://github.com/suttonpd/srsgui.git
  111 +$ cd srsgui
  112 +$ mkdir build
  113 +$ cd build
  114 +$ cmake ../
  115 +$ make
  116 +$ sudo make install
  117 +```
  118 +
  119 +- Install gnuradio
  120 +
  121 +only VOLK is needed, but the VOLK standalone installation usually fails and installing gnuradio in this way is usually fast and error-free. If you have problem with this, just try to have VOLK installed https://github.com/gnuradio/volk):
  122 +```sh
  123 +$ sudo apt-get install gnuradio
  124 +```
  125 +
  126 +- Clone and install OWL
  127 +
  128 +```sh
  129 +$ git clone https://git.networks.imdea.org/nicola_bui/imdeaowl.git
  130 +$ cd imdeaowl
  131 +$ mkdir build
  132 +$ cd build
  133 +$ cmake ../
  134 +$ make
  135 +```
  136 +
  137 +If everything succeeded you will find OWL's executables together with srsLTE's examples in the srsLTE/build/srslte/examples folder.
  138 +
  139 +Part 2 - Executable description:
  140 +--------------------------------
  141 +
  142 +**Inherited from srsLTE**
  143 +- cell_search
  144 +
  145 +Scan a given LTE band trying to acquire synchronization with the base station. Please, refer to this website for the used frequencies in your country
  146 +http://www.spectrummonitoring.com/frequencies
  147 +cell_search requires the band number and can also use the EARFCN numbers to narrow the search, please refer to this website for details:
  148 +http://niviuk.free.fr/lte_band.php
  149 +
  150 +- pdsch_ue
  151 +
  152 +emulate a UE trying to connecting to a given frequency, first looking for synchronization and, then, decoding control messages related to broadcast transmissions.
  153 +In addition, this program provide some useful statistics about synchronization and decoding success rate.
  154 +TIP: once you have the frequency of a base station you can run
  155 +```sh
  156 +$ ./pdsch_ue -f <freq>
  157 +```
  158 +where &lt;freq> is the base station central frequency in hertz, i.e. 1.8 GHz can be given as 1800e6 or 1.8e9. If the synchronization is successfull, pdsch_ue will plot the constellations of the control channel and the shared downlink channel (only broadcast messages). If the signal is clean, you should be able to see a QPSK constellation in both diagrams. In addition, the amplitude and phase channel responses are plotted together with the PSS synchronization. The last one is ok if it looks like a gaussian.
  159 +
  160 +**OWL files**
  161 +
  162 +- imdea_capture_sync
  163 +
  164 +This program capture a raw trace of the LTE channel synchronized on the beginning of the first subframe 0 detected. A very useful reference is http://www.sharetechnote.com/html/FrameStructure_DL.html
  165 +Usage:
  166 +```sh
  167 +$ ./imdea_capture_sync -f <freq> -l <cell_num> -n <subframe_num> -o <output_filename>
  168 +```
  169 +&lt;freq> is the base station central frequency in hertz, i.e. 1.8 GHz can be given as 1800e6 or 1.8e9.
  170 +&lt;cell_num> is in {0,1,2} and can be obtained from cell_search or pdsch_ue (see for reference http://www.sharetechnote.com/html/Handbook_LTE_PCI.html)
  171 +&lt;subframe_num> is the number of subframes to be recorded in the trace. 1 subframe = 1 millisecond
  172 +&lt;output_filename> where to record the trace. The trace can be then used with the other programs for offline processing.
  173 +TIP: putting -o /dev/null creates no output, but allows to test the signal synchronization without risking any buffer overrun (pc not ready when the sdr sends the streams). The output of the program is one line per frame (10 ms) and can be:
  174 +Decoded MIB ... (good)
  175 +MIB not decoded ... (noise on the channel)
  176 +sync loss (bad)
  177 +
  178 +- imdea_cc_decoder
  179 +
  180 +This program is the main part of OWL, where the control channel is decoded. It works both online and offline and pre-recorded traces. The imdea_cc_decoder is automatically set for the graphic output (see the screenshot below). To disable it, just add -d to the command line.
  181 +
  182 +Online usage:
  183 +```sh
  184 +$ ./imdea_cc_decoder -f <freq> -n <subframe_num> 1> <cc_out_filename>
  185 +```
  186 +&lt;cc_out_filename> specifies where to save the decoded control channel messages. If omitted, the messages are printed to the stdout. To have OWL output the undecod control messages on stderr you have to enable the LOG_ERRORS symbols in ue_dl.h
  187 +The output of the decoder is a tab separated list where each line represents a decoded message. The columns are as follows:
  188 + 1. SFN: internal timing of LTE (1 every frame = 10 ms)
  189 + 2. subframe index from 0 to 9 (1 subframe = 1 ms)
  190 + 3. RNTI in decimal
  191 + 4. Direction: 1 = downlink; 0 = uplink
  192 + 5. MCS in 0 - 31
  193 + 6. number of allocated resource blocks in 0 - 110
  194 + 7. transport block size in bits
  195 + 8. transport block size in bits (code word 0), -1 if n/a
  196 + 9. transport block size in bits (code word 1), -1 if n/a
  197 + 10. DCI message type. This version only scans for 0 (format 0), 2 (format 1a), 6 (format 2a)
  198 + 11. new data indicator toggle for codeword 0
  199 + 12. new data indicator toggle for codeword 1
  200 + 13. HARQ process id
  201 + 14. ncce location of the DCI message
  202 + 15. aggregation level of the DCI message
  203 + 16. CFI
  204 + 17. DCI correctness check
  205 +
  206 +Offline usage:
  207 +```sh
  208 +$ ./imdea_cc_decoder -i <input_trace_filename> -l <cell_num> -c <pci> -P <ports> -p <prb> -z <rnti_out_filename> -Z <rnti_in_filename> 1> <cc_out_filename> 2> <cc_fix_filename>
  209 +```
  210 +&lt;input_trace_filename> a trace that you saved with imdea_capture_sync
  211 +&lt;pci> &lt;ports> &lt;prb> physical cell id, antenna ports and number of physical resourrce blocks of the LTE channel. All of these can be obtained using cell_search, pdsch_ue, imdea_capture_sync
  212 +&lt;rnti_in_filename> &lt;rnti_out_filename> are the rnti lists. They are optional; if not provided the tool generates a new list. If available it starts with the information given. The format is a vector of 65355 elements, which can be 0 (not used), 1 (used, but not used in the last 10 seconds), 2 (used in the last 10 seconds).
  213 +&lt;cc_fix_filename> output file for the fine_tuner program. It specify one location to be checked per line. The columns are as follows:
  214 + 1. SFN
  215 + 2. subframe
  216 + 3. ncce
  217 + 4. L
  218 + 5. CFI
  219 +
  220 +![alt text](capture.png "Graphical Decoder")
  221 +
  222 +Part 3 - OWL setup and first use
  223 +--------------------------------
  224 +
  225 +- Install everything correctly!
  226 +- Use a software defined radio capable of sampling at a LTE compliant sampling rate (30.72, 23.04, 15.36, 11.52).
  227 +- srsLTE and OWL are heavy on the I/O. Try not to have read/write operations at the same time (different buffers may interfer). If overruns are detected, consider working on ramdisk (see https://wiki.archlinux.org/index.php/Tmpfs)
  228 +- Use a good antenna, capable of LTE frequencies. Check the bands used in your country on http://www.spectrummonitoring.com/frequencies
  229 +- Use cell_search to get the central frequencies of the available cell in the surrounding
  230 +- Try to get a map of the base station location and put your sniffer in a location where a line of sight with the antenna is available
  231 +- Use pdsch_ue and imdea_capture_sync to assess the signal quality
  232 +- Once you have a good signal, you should have pdsch_ue showing very clean QPSK constellations and imdea_capture_sync showing almost only "Decoded MIB ..." output.
  233 +- At this point you should have &lt;freq> &lt;cell_num> &lt;pci> &lt;ports> &lt;prb>
  234 +- Try first the online decoder with the output on screen:
  235 +
  236 +```sh
  237 +$ ./imdea_cc_decoder -f <freq> -n <subframe_num> -d
  238 +```
  239 +
  240 +To have the graphical demo with no texttual output
  241 +```sh
  242 +$ ./imdea_cc_decoder -f <freq> -n <subframe_num> > /dev/null
  243 +```
  244 +
  245 +- Try a capture, with subsequent decoding
  246 +
  247 +```sh
  248 +$ ./imdea_capture_sync -f <freq> -l <cell_num> -n <subframe_num> -o <output_filename>
  249 +$ ./imdea_cc_decoder -i <input_trace_filename> -l <cell_num> -c <pci> -P <ports> -p <prb> -z <rnti_out_filename> -Z <rnti_in_filename> -d 1> <cc_out_filename>
  250 +```
  251 +
  252 +- Have fun!
  253 +
  254 +Acknowledgements
  255 +================
  256 +
  257 +If you enjoyed using OWL, please acknowledge us in your publication(s) by referring to:
  258 +
  259 +```tex
  260 +@inproceedings{bui2016owl,
  261 + title={{OWL: a Reliable Online Watcher for LTE Control Channel Measurements}},
  262 + author={Bui, Nicola and Widmer, Joerg},
  263 + booktitle = {ACM All Things Cellular (MobiCom Workshop)},
  264 + year = {2016},
  265 + month = {Nov.},
  266 + location = {New York, USA},
  267 +}
... ...
cmake/modules/BuildMex.cmake
... ... @@ -1,63 +0,0 @@
1   -# BuildMex.cmake
2   -# Author: Kent Williams norman-k-williams at uiowa.edu
3   -# Modified by Ismael Gomez, 2014
4   -
5   -include(CMakeParseArguments)
6   -
7   -if(NOT DisableMEX)
8   - if(NOT MATLAB_FOUND)
9   - find_package(MATLAB)
10   - endif()
11   -
12   - if(NOT OCTAVE_FOUND)
13   - find_package(OCTAVE)
14   - endif()
15   -
16   - # CMake 2.8.12 & earlier apparently don't define the
17   - # Mex script path, so find it.
18   - if(NOT MATLAB_MEX_PATH)
19   - find_program( MATLAB_MEX_PATH mex
20   - HINTS ${MATLAB_ROOT}/bin
21   - PATHS ${MATLAB_ROOT}/bin
22   - DOC "The mex program path"
23   - )
24   - endif()
25   -endif()
26   -
27   -#
28   -# BuildMex -- arguments
29   -# MEXNAME = root of mex library name
30   -# SOURCE = list of source files
31   -# LIBRARIES = libraries needed to link mex library
32   -FUNCTION(BuildMex)
33   - if(NOT DisableMEX)
34   - set(oneValueArgs MEXNAME)
35   - set(multiValueArgs SOURCES LIBRARIES)
36   - cmake_parse_arguments(BuildMex "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
37   - if (MATLAB_FOUND)
38   - add_library(${BuildMex_MEXNAME}-mat SHARED ${BuildMex_SOURCES})
39   - #target_include_directories(${BuildMex_MEXNAME}-mat PUBLIC ${MATLAB_INCLUDE_DIR})
40   - set_target_properties(${BuildMex_MEXNAME}-mat PROPERTIES
41   - SUFFIX "${MATLAB_MEX_EXTENSION}"
42   - PREFIX "srslte_"
43   - OUTPUT_NAME "${BuildMex_MEXNAME}"
44   - COMPILE_FLAGS "-fvisibility=default ${MATLAB_MEX_CFLAGS} -DFORCE_STANDARD_RATE -I${MATLAB_INCLUDE_DIR}"
45   - )
46   - target_link_libraries(${BuildMex_MEXNAME}-mat ${BuildMex_LIBRARIES} ${MATLAB_MEX_LIBRARY})
47   - install(TARGETS ${BuildMex_MEXNAME}-mat DESTINATION "${MEX_DIR}/srslte/")
48   - endif(MATLAB_FOUND)
49   - if (OCTAVE_FOUND)
50   - add_library(${BuildMex_MEXNAME}-oct SHARED ${BuildMex_SOURCES})
51   - #target_include_directories(${BuildMex_MEXNAME}-oct PUBLIC ${OCTAVE_INCLUDE_DIR})
52   - set_target_properties(${BuildMex_MEXNAME}-oct PROPERTIES
53   - SUFFIX ".${OCTAVE_MEXFILE_EXT}"
54   - PREFIX "srslte_"
55   - OUTPUT_NAME "${BuildMex_MEXNAME}"
56   - COMPILE_FLAGS "-fvisibility=default ${OCTAVE_MEX_CFLAGS} -DFORCE_STANDARD_RATE -DUNDEF_BOOL -I${OCTAVE_INCLUDE_DIR}"
57   - )
58   - target_link_libraries(${BuildMex_MEXNAME}-oct ${BuildMex_LIBRARIES} ${OCTAVE_LIBRARIES})
59   - install(TARGETS ${BuildMex_MEXNAME}-oct DESTINATION "${MEX_DIR}/srslte/")
60   - endif (OCTAVE_FOUND)
61   - endif (NOT DisableMEX)
62   -ENDFUNCTION(BuildMex)
63   -
cmake/modules/FindLibConfig.cmake 0 โ†’ 100644
... ... @@ -0,0 +1,75 @@
  1 +# Find the CUnit includes and library
  2 +#
  3 +# This module defines
  4 +# LIBCONFIG_INCLUDE_DIR, where to find cppunit include files, etc.
  5 +# LIBCONFIG_LIBRARIES, the libraries to link against to use CppUnit.
  6 +# LIBCONFIG_STATIC_LIBRARIY_PATH
  7 +# LIBCONFIG_FOUND, If false, do not try to use CppUnit.
  8 +
  9 +# also defined, but not for general use are
  10 +# LIBCONFIG_LIBRARY, where to find the CUnit library.
  11 +
  12 +#MESSAGE("Searching for libconfig library")
  13 +
  14 +FIND_PATH(LIBCONFIG_INCLUDE_DIR libconfig.h
  15 + /usr/local/include
  16 + /usr/include
  17 +)
  18 +
  19 +FIND_PATH(LIBCONFIGPP_INCLUDE_DIR libconfig.h++
  20 + /usr/local/include
  21 + /usr/include
  22 +)
  23 +
  24 +FIND_LIBRARY(LIBCONFIG_LIBRARY config
  25 + /usr/local/lib
  26 + /usr/lib
  27 +)
  28 +
  29 +FIND_LIBRARY(LIBCONFIGPP_LIBRARY config++
  30 + /usr/local/lib
  31 + /usr/lib
  32 +)
  33 +
  34 +FIND_LIBRARY(LIBCONFIG_STATIC_LIBRARY "libconfig${CMAKE_STATIC_LIBRARY_SUFFIX}"
  35 + /usr/local/lib
  36 + /usr/lib
  37 +)
  38 +
  39 +FIND_LIBRARY(LIBCONFIGPP_STATIC_LIBRARY "libconfig++${CMAKE_STATIC_LIBRARY_SUFFIX}"
  40 + /usr/local/lib
  41 + /usr/lib
  42 +)
  43 +
  44 +
  45 +IF(LIBCONFIG_INCLUDE_DIR)
  46 + IF(LIBCONFIG_LIBRARY)
  47 + SET(LIBCONFIG_FOUND TRUE)
  48 + SET(LIBCONFIG_LIBRARIES ${LIBCONFIG_LIBRARY})
  49 + SET(LIBCONFIG_STATIC_LIBRARY_PATH ${LIBCONFIG_STATIC_LIBRARY})
  50 + ENDIF(LIBCONFIG_LIBRARY)
  51 +ENDIF(LIBCONFIG_INCLUDE_DIR)
  52 +
  53 +IF(LIBCONFIGPP_INCLUDE_DIR)
  54 + IF(LIBCONFIGPP_LIBRARY)
  55 + SET(LIBCONFIGPP_FOUND TRUE)
  56 + SET(LIBCONFIGPP_LIBRARIES ${LIBCONFIGPP_LIBRARY})
  57 + SET(LIBCONFIGPP_STATIC_LIBRARY_PATH ${LIBCONFIGPP_STATIC_LIBRARY})
  58 + ENDIF(LIBCONFIGPP_LIBRARY)
  59 +ENDIF(LIBCONFIGPP_INCLUDE_DIR)
  60 +
  61 +IF (LIBCONFIGPP_FOUND)
  62 + IF (NOT LibConfig_FIND_QUIETLY)
  63 + MESSAGE(STATUS "Found LibConfig++: ${LIBCONFIGPP_LIBRARIES}" )
  64 + MESSAGE(STATUS "static LibConfig++ path: ${LIBCONFIGPP_STATIC_LIBRARY_PATH}")
  65 + MESSAGE(STATUS "Found LibConfig: ${LIBCONFIG_LIBRARIES}")
  66 + MESSAGE(STATUS "static LibConfig path: ${LIBCONFIG_STATIC_LIBRARY_PATH}")
  67 + ENDIF (NOT LibConfig_FIND_QUIETLY)
  68 +ELSE (LIBCONFIGPP_FOUND)
  69 + IF (LibConfig_FIND_REQUIRED)
  70 + MESSAGE(SEND_ERROR "Could NOT find LibConfig")
  71 + ENDIF (LibConfig_FIND_REQUIRED)
  72 +ENDIF (LIBCONFIGPP_FOUND)
  73 +
  74 +MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARY LIBCONFIG_STATIC_LIBRARY)
  75 +MARK_AS_ADVANCED(LIBCONFIGPP_INCLUDE_DIR LIBCONFIGPP_LIBRARY LIBCONFIGPP_STATIC_LIBRARY)
... ...
cmake/modules/FindLimeSDR.cmake 0 โ†’ 100644
... ... @@ -0,0 +1,28 @@
  1 +if(NOT LIMESDR_FOUND)
  2 + pkg_check_modules (LIMESDR_PKG LimeSuite)
  3 +
  4 + find_path(LIMESDR_INCLUDE_DIRS
  5 + NAMES LimeSuite.h
  6 + PATHS ${LIMESDR_PKG_INCLUDE_DIRS}
  7 + /usr/include/lime
  8 + /usr/local/include/lime
  9 + )
  10 +
  11 + find_library(LIMESDR_LIBRARIES
  12 + NAMES LimeSuite
  13 + PATHS ${LIMESDR_PKG_LIBRARY_DIRS}
  14 + /usr/lib
  15 + /usr/local/lib
  16 + )
  17 +
  18 +if(LIMESDR_INCLUDE_DIRS AND LIMESDR_LIBRARIES)
  19 + set(LIMESDR_FOUND TRUE CACHE INTERNAL "libLimeSuite found")
  20 + message(STATUS "Found libLimeSuite: ${LIMESDR_INCLUDE_DIRS}, ${LIMESDR_LIBRARIES}")
  21 +else(LIMESDR_INCLUDE_DIRS AND LIMESDR_LIBRARIES)
  22 + set(LIMESDR_FOUND FALSE CACHE INTERNAL "libLimeSuite found")
  23 + message(STATUS "libLimeSuite not found.")
  24 +endif(LIMESDR_INCLUDE_DIRS AND LIMESDR_LIBRARIES)
  25 +
  26 +mark_as_advanced(LIMESDR_LIBRARIES LIMESDR_INCLUDE_DIRS)
  27 +
  28 +endif(NOT LIMESDR_FOUND)
... ...
cmake/modules/FindMATLAB.cmake
... ... @@ -1,220 +0,0 @@
1   -# - this module looks for Matlab
2   -# Defines:
3   -# MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
4   -# MATLAB_LIBRARIES: required libraries: libmex, etc
5   -# MATLAB_MEX_LIBRARY: path to libmex.lib
6   -# MATLAB_MX_LIBRARY: path to libmx.lib
7   -# MATLAB_MAT_LIBRARY: path to libmat.lib # added
8   -# MATLAB_ENG_LIBRARY: path to libeng.lib
9   -# MATLAB_ROOT: path to Matlab's root directory
10   -
11   -# This file is part of Gerardus
12   -#
13   -# This is a derivative work of file FindMatlab.cmake released with
14   -# CMake v2.8, because the original seems to be a bit outdated and
15   -# doesn't work with my Windows XP and Visual Studio 10 install
16   -#
17   -# (Note that the original file does work for Ubuntu Natty)
18   -#
19   -# Author: Ramon Casero <rcasero at gmail.com>, Tom Doel
20   -# Version: 0.2.3
21   -# $Rev$
22   -# $Date$
23   -#
24   -# The original file was copied from an Ubuntu Linux install
25   -# /usr/share/cmake-2.8/Modules/FindMatlab.cmake
26   -
27   -set(MATLAB_FOUND FALSE)
28   -if(WIN32)
29   - # Search for a version of Matlab available, starting from the most modern one to older versions
30   - foreach(MATVER "7.14" "7.11" "7.10" "7.9" "7.8" "7.7" "7.6" "7.5" "7.4")
31   - if((NOT DEFINED MATLAB_ROOT)
32   - OR ("${MATLAB_ROOT}" STREQUAL "")
33   - OR ("${MATLAB_ROOT}" STREQUAL "/registry"))
34   - get_filename_component(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\${MATVER};MATLABROOT]"
35   - ABSOLUTE)
36   - set(MATLAB_VERSION ${MATVER})
37   - endif()
38   - endforeach()
39   -
40   - # Directory name depending on whether the Windows architecture is 32
41   - # bit or 64 bit
42   - set(CMAKE_SIZEOF_VOID_P 8) # Note: For some wierd reason this variable is undefined in my system...
43   - if(CMAKE_SIZEOF_VOID_P MATCHES "4")
44   - set(WINDIR "win32")
45   - elseif(CMAKE_SIZEOF_VOID_P MATCHES "8")
46   - set(WINDIR "win64")
47   - else()
48   - message(FATAL_ERROR "CMAKE_SIZEOF_VOID_P (${CMAKE_SIZEOF_VOID_P}) doesn't indicate a valid platform")
49   - endif()
50   -
51   - # Folder where the MEX libraries are, depending of the Windows compiler
52   - if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
53   - set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/msvc60")
54   - elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
55   - # Assume people are generally using Visual Studio 7.1,
56   - # if using 7.0 need to link to: ../extern/lib/${WINDIR}/microsoft/msvc70
57   - set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/msvc71")
58   - # set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/msvc70")
59   - elseif(${CMAKE_GENERATOR} MATCHES "Borland")
60   - # Assume people are generally using Borland 5.4,
61   - # if using 7.0 need to link to ../extern/lib/${WINDIR}/microsoft/msvc70
62   - set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/bcc54")
63   - # set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/bcc50")
64   - # set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/bcc51")
65   - elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio*")
66   - # If the compiler is Visual Studio, but not any of the specific
67   - # versions above, we try our luck with the microsoft directory
68   - set(MATLAB_LIBRARIES_DIR "${MATLAB_ROOT}/extern/lib/${WINDIR}/microsoft/")
69   - else()
70   - message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
71   - endif()
72   -
73   - # Get paths to the Matlab MEX libraries
74