Skip to content
Permalink
Browse files

gr-gfdm: new port.

  • Loading branch information
michaelld committed Apr 11, 2018
1 parent 5bdf46b commit b405582141d1bec138c1be75c70722e8549c254a
Showing with 200 additions and 0 deletions.
  1. +75 −0 science/gr-gfdm/Portfile
  2. +125 −0 science/gr-gfdm/files/patch-fix_build.diff
@@ -0,0 +1,75 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup cmake 1.0
PortGroup github 1.0

github.setup kit-cel gr-gfdm f9b70a2b3f6761db16a6a1c19feb2a121e11a40a
version 20180318
checksums rmd160 22f3da4c994253a74ff3fdcbb182ff48992435b1 \
sha256 9f8560fa8ebbe4fbf6a9bdb96ecde41fa1c0a236d1a6e5c744d7c5dd5490070b \
size 248905

# allow gr-gsm to work with both gnuradio and gnuradio-devel ...

depends_lib-append path:lib/libgnuradio-runtime.dylib:gnuradio

# ... but not with gnuradio-next

pre-fetch {
if {![catch {set installed [lindex [registry_active gnuradio-next] 0]}]} {
# gnuradio-next is installed; this version of gr-gsm does not work with gnuradio-next
ui_msg "\nError: ${name} requires the gnuradio or gnuradio-devel port, and will not work with the gnuradio-next port. deactivate gnuradio-next, and then install or activate gnuradio or gnuradio-devel.\n"
return -code error "Invalid port dependency: gnuradio-next"
}
}

categories science comms
maintainers {michaelld @michaelld} openmaintainer
description Provides augmented functionality for GNU Radio: Generalized Frequency Division Multiplexing.
long_description ${description}
license GPL-3
platforms darwin

depends_build-append \
port:pkgconfig \
port:swig-python

depends_lib-append \
port:boost \
path:lib/libvolk.dylib:volk \
port:fftw-3-single \
port:cppunit

# for docs

depends_lib-append \
port:doxygen

# fix cmake building scripts

patchfiles-append patch-fix_build.diff
patch.pre_args -p1

# do VPATH (out of source tree) build

cmake.out_of_source yes

# remove top-level library path, such that internal libraries are used
# instead of any already-installed ones.

configure.ldflags-delete -L${prefix}/lib

# specify the Python dependencies

depends_lib-append \
port:python27

# specify the Python version to use

configure.args-append \
-DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 \
-DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers \
-DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python \
-DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages \
-DCMAKE_MODULES_DIR=${prefix}/share/cmake
@@ -0,0 +1,125 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7fcd2c..72deaff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,7 +50,7 @@ endif()
########################################################################
# Compiler specific setup
########################################################################
-if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
+if(NOT WIN32)
#http://gcc.gnu.org/wiki/Visibility
add_definitions(-fvisibility=hidden)
endif()
@@ -116,20 +116,42 @@ endif(APPLE)
########################################################################
# Find gnuradio build dependencies
########################################################################
-find_package(CppUnit)
-find_package(Doxygen)

# Search for GNU Radio and its components and versions. Add any
# components required to the list of GR_REQUIRED_COMPONENTS (in all
# caps such as FILTER or FFT) and change the version to the minimum
# API compatible version required.
set(GR_REQUIRED_COMPONENTS RUNTIME FFT FILTER DIGITAL)
-find_package(Gnuradio "3.7.2" REQUIRED)
-find_package(Volk "1.3")
+find_package(Gnuradio)
+if(NOT GNURADIO_RUNTIME_FOUND)
+ message(FATAL_ERROR "GNU Radio required to compile gfdm")
+endif()

+find_package(CppUnit)
if(NOT CPPUNIT_FOUND)
- message(FATAL_ERROR "CppUnit required to compile gfdm")
+ message(FATAL_ERROR "CppUnit required to compile gr-ieee802-15-4")
+endif()
+
+find_package(PythonLibs 2)
+if(NOT PYTHONLIBS_FOUND)
+ message(FATAL_ERROR "Python required to compile gr-ieee802-15-4")
+endif()
+
+find_package(Volk)
+if(NOT VOLK_FOUND)
+ message(FATAL_ERROR "Volk required to compile gr-ieee802-15-4")
+endif()
+
+find_package(SWIG)
+if(NOT SWIG_FOUND)
+ message(FATAL_ERROR "SWIG required to compile gr-ieee802-15-4")
endif()
+
+find_package(FFTW3f)
+if(NOT FFTW3F_FOUND)
+ message(FATAL_ERROR "FFTW3 required to compile iqbalance")
+endif()
+
if(CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
include(CodeCoverage)
@@ -140,7 +162,8 @@ endif()
########################################################################
# Setup doxygen option
########################################################################
-if(DOXYGEN_FOUND)
+find_package(Doxygen)
+ if(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
else(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
@@ -157,6 +180,8 @@ include_directories(
${Boost_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
${GNURADIO_ALL_INCLUDE_DIRS}
+ ${VOLK_INCLUDE_DIRS}
+ ${FFTW3F_INCLUDE_DIRS}
)

link_directories(
@@ -165,6 +190,8 @@ link_directories(
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${GNURADIO_FFT_LIBRARY_DIRS}
${GNURADIO_FILTER_LIBRARY_DIRS}
+ ${VOLK_LIBRARY_DIRS}
+ ${FFTW3F_LIBRARY_DIRS}
)

# Set component parameters
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 8b0811f..f2fe0da 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -22,9 +22,6 @@
########################################################################
include(GrPlatform) #define LIB_SUFFIX

-include_directories(${Boost_INCLUDE_DIR})
-link_directories(${Boost_LIBRARY_DIRS})
-
list(APPEND gfdm_sources
gfdm_utils.cc
receiver_kernel_cc.cc
@@ -54,13 +51,16 @@ list(APPEND gfdm_sources
channel_estimator_cc_impl.cc)

set(gfdm_sources "${gfdm_sources}" PARENT_SCOPE)
-if(NOT gfdm_sources)
- MESSAGE(STATUS "No C++ sources... skipping lib/")
- return()
-endif(NOT gfdm_sources)
+
+list(APPEND gfdm_libs
+ ${Boost_LIBRARIES}
+ ${GNURADIO_ALL_LIBRARIES}
+ ${VOLK_LIBRARIES}
+ ${FFTW3F_LIBRARIES}
+)

add_library(gnuradio-gfdm SHARED ${gfdm_sources})
-target_link_libraries(gnuradio-gfdm ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})
+target_link_libraries(gnuradio-gfdm ${gfdm_libs})
set_target_properties(gnuradio-gfdm PROPERTIES DEFINE_SYMBOL "gnuradio_gfdm_EXPORTS")

if(APPLE)

0 comments on commit b405582

Please sign in to comment.
You can’t perform that action at this time.