Thanks for quick reply! It does not work even if I use float precision as fftwf_complex *in2, *out2; out2 = (fftwf_complex*) fftwf_malloc(NFFT*2*sizeof(fftwf_complex)); in2 = (fftwf_complex*) fftwf_malloc(NFFT*2*sizeof(fftwf_complex));
I attach cmake files. It would be nice of you if you take a look. - NE Fri, 21 Mar 2014 11:18:45 +0100 от Marcus Müller <mar...@hostalia.de>: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >The (F) was meant to say: >Use FFTW3_LIBRARIES if you want to use the double precision version, >use FFTW3F_LIBRARIES if you want the single (float, 'F') precision >version of the library. > >Since you're using >fftw_malloc (without f suffix), you're trying to use the double prec. >version of the library, but you link against the single prec. version. > >Greetings, >Marcus > >PS: The GNU Radio complex data type is identical to the float complex >datatype used by FFTW3F. If you want to use that, use the float >version of the library and replace fftw_malloc by fftwf_malloc and so on. > > > >On 21.03.2014 10:35, Nasi wrote: >> Hi all, >> >> I am using ubuntu 13.04 and GNURADIO 3.7. >> >> In project https://github.com/BogdanDIA/gr-dvbt , in >> reference_signals_impl.cc in /lib, I add inside one of the >> functions: >> >> fftw_complex *in2, *out2; out2 = (fftw_complex*) >> fftw_malloc(NFFT*2*sizeof(fftw_complex)); in2 = (fftw_complex*) >> fftw_malloc(NFFT*2*sizeof(fftw_complex)); I get this error: >> ~/gr-dvbt/apps$ sudo ./top_block_rx.py Traceback (most recent call >> last): File "./top_block_rx.py", line 23, in <module> import dvbt >> File "/usr/local/lib/python2.7/dist-packages/dvbt/__init__.py", >> line 45, in <module> from dvbt_swig import * File >> "/usr/local/lib/python2.7/dist-packages/dvbt/dvbt_swig.py", line >> 26, in <module> _dvbt_swig = swig_import_helper() File >> "/usr/local/lib/python2.7/dist-packages/dvbt/dvbt_swig.py", line >> 22, in swig_import_helper _mod = imp.load_module('_dvbt_swig', fp, >> pathname, description) ImportError: >> /usr/local/lib/libgnuradio-dvbt.so: undefined symbol: fftw_malloc >> >> I read and did the articles: >> http://lists.gnu.org/archive/html/discuss-gnuradio/2014-02/msg00479.html >> and >> http://gnuradio.4.n7.nabble.com/FFTW3-runtime-error-td46690.html . >> However, in lib I cannot add ${FFTW3(F)_LIBRARIES} to your >> lib/CMakeLists.txt. It gives me an error. Therefore I replaced that >> with ${FFTW3F_LIBRARIES}. >> >> Where am I making mistake? >> >> - NE >> >> >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1 >Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > >iQEcBAEBAgAGBQJTLBIEAAoJEBQ6EdjyzlHtSK8H/Az7oTYgKHEkG61/iKNzEb4r >hPQyX4Mwr0BfjVXoI976aRQK6L/tJxm56ofahEj788crhlVqtqnZSvg/EhIQGzln >G8OQFHIbcwRIe/5mVtTmWcjWimJAcJXs3aOglbkavp+vw8ZW55rSypT9cLrw+X04 >fLctOOAg5NHJtUQnOeTLboAkcn3lvwBr6su4R1RYhdGbtSMjNaDTD5g1pNhKq0JH >AhbjDlLluFdnAuesOR9RBto74ncQGQzGHtnWHmI6CJp2qjM9f4wsE9DLycGGCM4W >nYZRSz0Dxqybw6SJ2rQQRqq7VnisaQvs4MZALnnJODZ/P+z8L6Yed3WsFUBjZWQ= >=IjoK >-----END PGP SIGNATURE----- -- NE
# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # # GNU Radio 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 GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. ######################################################################## # Project setup ######################################################################## cmake_minimum_required(VERSION 2.6) project(gr-dvbt CXX C) enable_testing() #select the release build type by default to get optimization flags if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to release.") endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) ######################################################################## # Compiler specific setup ######################################################################## if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) #http://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) endif() ######################################################################## # Find boost ######################################################################## if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix endif(UNIX AND EXISTS "/usr/lib64") set(Boost_ADDITIONAL_VERSIONS "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" "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" "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" "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" "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" "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" "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" ) find_package(Boost "1.35" COMPONENTS filesystem system) if(NOT Boost_FOUND) message(FATAL_ERROR "Boost required to compile dvbt") endif() ######################################################################## # Install directories ######################################################################## include(GrPlatform) #define LIB_SUFFIX set(GR_RUNTIME_DIR bin) set(GR_LIBRARY_DIR lib${LIB_SUFFIX}) set(GR_INCLUDE_DIR include/dvbt) set(GR_DATA_DIR share) set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) set(GR_DOC_DIR ${GR_DATA_DIR}/doc) set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}) set(GR_CONF_DIR etc) set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) set(GR_LIBEXEC_DIR libexec) set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## set(GR_REQUIRED_COMPONENTS RUNTIME VOLK) find_package(Gnuradio "3.7.2.1" REQUIRED) find_package(CppUnit) find_package(Volk REQUIRED) find_package(FFTW3) if(NOT GNURADIO_RUNTIME_FOUND) message(FATAL_ERROR "GnuRadio Core required to compile dvbt") endif() if(NOT CPPUNIT_FOUND) message(FATAL_ERROR "CppUnit required to compile dvbt") endif() if(NOT VOLK_FOUND) message(FATAL_ERROR "Volk required to compile dvbt") endif() ######################################################################## # Setup the include and linker paths ######################################################################## include_directories( ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/lib ${CMAKE_BINARY_DIR}/include ${Boost_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_ALL_INCLUDE_DIRS} ${FFTW3_INCLUDE_DIRS} ) link_directories( ${Boost_LIBRARY_DIRS} ${CPPUNIT_LIBRARY_DIRS} ${GNURADIO_RUNTIME_LIBRARY_DIRS} ${FFTW3_LIBRARY_DIRS} ) # Set component parameters set(GR_DVBT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE) set(GR_DVBT_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE) ######################################################################## # Create uninstall target ######################################################################## configure_file( ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake ) ######################################################################## # Add subdirectories ######################################################################## add_subdirectory(include/dvbt) add_subdirectory(lib) add_subdirectory(swig) add_subdirectory(python) add_subdirectory(grc) add_subdirectory(apps) add_subdirectory(docs)
# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # # GNU Radio 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 GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. ######################################################################## # Setup library ######################################################################## include(GrPlatform) #define LIB_SUFFIX include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS} ${FFTW3F_LIBRARY_DIRS}) add_library(gnuradio-dvbt SHARED test_impl.cc vector_pad_impl.cc reference_signals_impl.cc dvbt_config.cc dvbt_config.cc dvbt_map_impl.cc bit_inner_interleaver_impl.cc symbol_inner_interleaver_impl.cc inner_coder_impl.cc reed_solomon_enc_impl.cc energy_dispersal_impl.cc convolutional_interleaver_impl.cc test2_impl.cc demod_reference_signals_impl.cc dvbt_demap_impl.cc bit_inner_deinterleaver_impl.cc convolutional_deinterleaver_impl.cc energy_descramble_impl.cc reed_solomon.cc reed_solomon_dec_impl.cc ofdm_sym_acquisition_impl.cc viterbi_decoder_impl.cc d_viterbi.c d_metrics.c d_tab.c dvbt_dictionary.cc dvbt_dictionary2.cc dvbt_dictionary3.cc) target_link_libraries(gnuradio-dvbt ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES}) set_target_properties(gnuradio-dvbt PROPERTIES DEFINE_SYMBOL "gnuradio_dvbt_EXPORTS") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -mavx") #set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -mavx") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O3 -funroll-loops -msse2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -funroll-loops -msse2") ######################################################################## # Install built library files ######################################################################## install(TARGETS gnuradio-dvbt LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file RUNTIME DESTINATION bin # .dll file ) ######################################################################## # Build and register unit test ######################################################################## include(GrTest) include_directories(${CPPUNIT_INCLUDE_DIRS}) list(APPEND test_dvbt_sources ${CMAKE_CURRENT_SOURCE_DIR}/test_dvbt.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_dvbt.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_viterbi_decoder.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_ofdm_sym_acquisition.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_reed_solomon_dec.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_reed_solomon_enc.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_energy_descramble.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_convolutional_deinterleaver.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_bit_inner_deinterleaver.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_demod_reference_signals.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_test2.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_convolutional_interleaver.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_energy_dispersal.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_reed_solomon.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_inner_coder.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_symbol_inner_interleaver.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_bit_inner_interleaver.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_dvbt_map.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_dvbt_config.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_reference_signals.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_vector_pad.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_test.cc ) add_executable(test-dvbt ${test_dvbt_sources}) target_link_libraries( test-dvbt ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} ${CPPUNIT_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${FFTW3F_LIBRARIES} gnuradio-dvbt ) GR_ADD_TEST(test_dvbt test-dvbt)
FindFFTW3.cmake
Description: Binary data
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio