diff --git a/cmake/modules/FindMKL.cmake b/cmake/modules/FindMKL.cmake new file mode 100644 index 000000000..2320cf065 --- /dev/null +++ b/cmake/modules/FindMKL.cmake @@ -0,0 +1,27 @@ +# - Try to find mkl - the Intel Math Kernel Library +# Once done this will define +# MKL_FOUND - System has mkl +# MKL_INCLUDE_DIRS - The mkl include directories +# MKL_LIBRARIES - The libraries needed to use mkl +# MKL_DEFINITIONS - Compiler switches required for using mkl + +find_path(MKL_INCLUDE_DIR + NAMES mkl.h + HINTS $ENV{MKL_DIR}/include + PATHS) + +find_library(MKL_LIBRARY + NAMES mkl_rt + HINTS $ENV{MKL_DIR}/lib/intel64 + PATHS) + +set(MKL_LIBRARIES ${MKL_LIBRARY} ) +set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR} ) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set MKL_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(mkl DEFAULT_MSG + MKL_LIBRARY MKL_INCLUDE_DIR) + +mark_as_advanced(MKL_INCLUDE_DIR MKL_LIBRARY ) diff --git a/srslte/CMakeLists.txt b/srslte/CMakeLists.txt index 87779de46..0ecf9ddf6 100644 --- a/srslte/CMakeLists.txt +++ b/srslte/CMakeLists.txt @@ -42,11 +42,18 @@ add_custom_target (add_srslte_headers SOURCES ${HEADERS_ALL}) ######################################################################## # Find Dependencies ######################################################################## -find_package(FFTW3F REQUIRED) -if(FFTW3F_FOUND) - include_directories(${FFTW3F_INCLUDE_DIRS}) - link_directories(${FFTW3F_LIBRARY_DIRS}) -endif(FFTW3F_FOUND) + +find_package(MKL) +if(MKL_FOUND) + include_directories(${MKL_INCLUDE_DIRS}) + link_directories(${MKL_LIBRARY_DIRS}) +else(MKL_FOUND) + find_package(FFTW3F REQUIRED) + if(FFTW3F_FOUND) + include_directories(${FFTW3F_INCLUDE_DIRS}) + link_directories(${FFTW3F_LIBRARY_DIRS}) + endif(FFTW3F_FOUND) +endif(MKL_FOUND) find_package(UHD) if(UHD_FOUND) diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index b231dcf1e..026cdbbcd 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -67,7 +67,6 @@ uint32_t plot_sf_idx=0; bool plot_track = true; #endif -#define PLOT_CHEST_ARGUMENT #define PRINT_CHANGE_SCHEDULIGN //#define CORRECT_SAMPLE_OFFSET @@ -653,8 +652,7 @@ int main(int argc, char **argv) { #ifndef DISABLE_GRAPHICS -//plot_waterfall_t poutfft; -plot_real_t p_sync, pce, pce_arg; +plot_real_t p_sync, pce; plot_scatter_t pscatequal, pscatequal_pdcch; float tmp_plot[110*15*2048]; @@ -668,22 +666,18 @@ void *plot_thread_run(void *arg) { sdrgui_init(); - //plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000); - //plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude"); - //plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40); + plot_scatter_init(&pscatequal); + plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); + plot_scatter_setXAxisScale(&pscatequal, -4, 4); + plot_scatter_setYAxisScale(&pscatequal, -4, 4); + + plot_scatter_addToWindowGrid(&pscatequal, (char*)"pdsch_ue", 0, 0); if (!prog_args.disable_plots_except_constellation) { plot_real_init(&pce); plot_real_setTitle(&pce, "Channel Response - Magnitude"); plot_real_setLabels(&pce, "Index", "dB"); plot_real_setYAxisScale(&pce, -40, 40); - - #ifdef PLOT_CHEST_ARGUMENT - plot_real_init(&pce_arg); - plot_real_setTitle(&pce_arg, "Channel Response - Argument"); - plot_real_setLabels(&pce_arg, "Index", "rad"); - plot_real_setYAxisScale(&pce_arg, -1.1*M_PI, 1.1*M_PI); - #endif plot_real_init(&p_sync); plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value"); @@ -693,13 +687,11 @@ void *plot_thread_run(void *arg) { plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols"); plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4); plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4); + + plot_real_addToWindowGrid(&pce, (char*)"pdsch_ue", 0, 1); + plot_real_addToWindowGrid(&pscatequal_pdcch, (char*)"pdsch_ue", 1, 0); + plot_real_addToWindowGrid(&p_sync, (char*)"pdsch_ue", 1, 1); } - - plot_scatter_init(&pscatequal); - plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols"); - plot_scatter_setXAxisScale(&pscatequal, -4, 4); - plot_scatter_setYAxisScale(&pscatequal, -4, 4); - while(1) { sem_wait(&plot_sem); @@ -740,13 +732,6 @@ void *plot_thread_run(void *arg) { } } - - #ifdef PLOT_CHEST_ARGUMENT - for (i = 0; i < 12*ue_dl.cell.nof_prb; i++) { - tmp_plot2[i] = cargf(ue_dl.ce[0][i]); - } - plot_real_setNewData(&pce_arg, tmp_plot2, i); - #endif plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce); } diff --git a/srslte/lib/CMakeLists.txt b/srslte/lib/CMakeLists.txt index d875b35fc..88024f87b 100644 --- a/srslte/lib/CMakeLists.txt +++ b/srslte/lib/CMakeLists.txt @@ -79,15 +79,22 @@ if(NOT DisableMEX) ) endif(NOT DisableMEX) -target_link_libraries(srslte pthread m ${FFTW3F_LIBRARIES}) +target_link_libraries(srslte pthread m) set_target_properties(srslte PROPERTIES VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}) -if(NOT DisableMEX) - target_link_libraries(srslte_static ${FFTW3F_LIBRARIES}) -endif(NOT DisableMEX) - - +if(MKL_FOUND) + target_link_libraries(srslte ${MKL_LIBRARIES}) + if(NOT DisableMEX) + target_link_libraries(srslte_static ${MKL_LIBRARIES}) + endif(NOT DisableMEX) +else(MKL_FOUND) + target_link_libraries(srslte ${FFTW3F_LIBRARIES}) + if(NOT DisableMEX) + target_link_libraries(srslte_static ${FFTW3F_LIBRARIES}) + endif(NOT DisableMEX) +endif(MKL_FOUND) + if(RF_FOUND) if(UHD_FOUND) target_link_libraries(srslte ${UHD_LIBRARIES})