CyberRadio / gr-cyberradio

MIT License
5 stars 4 forks source link

Custom install locations not supported #6

Closed jwmelto closed 3 years ago

jwmelto commented 3 years ago

Using the maint-3.8 branch, if I try to install in a non-standard location (/opt/foss) then gr-CyberRadio can't find libcyberradio.

The following commands are in my Dockerfile:

ARG NPROC=2

ENV CMAKE_FLAGS="--log-level=ERROR --parallel ${NPROC}"
ENV CMAKE_FLAGS+=" -DCMAKE_COLOR_MAKEFILE=NO"
ENV CMAKE_FLAGS+=" -DCMAKE_PREFIX_PATH=/opt/foss"
ENV cmake_INSTALL_FLAGS="-DCMAKE_INSTALL_PREFIX=/opt/foss"
ENV MAKEFLAGS="--silent --no-print-directory --jobs=${NPROC}"

RUN echo "Installing CyberRadio"                                \
 && date                                                        \
 && pip install ${PIP_OPTS}                                     \
        requests                                                \
 && (cd /tmp                                                    \
     ; git clone                                                \
           --quiet                                              \
           --config advice.detachedHead=false                   \
           --branch maint-3.8                                   \
           https://github.com/CyberRadio/gr-cyberradio.git      \
     ; cd /tmp/gr-cyberradio                                    \
     ; git rev-parse HEAD                                       \
     ; sed -i -e 's|jsoncpp/json|json|g'                        \
           libcyberradio/libcyberradio/Driver/RadioTransport.cpp\
     ; sed -i -e 's|^#\(find_package(Boost "1.53"\)|\1|g'       \
              -e 's|^\(find_package(Boost "1.55"\)|#\1|g'       \
           gr-CyberRadio/CMakeLists.txt                         \
    ) && date                                                   \
 && echo "building..."                                          \
 && /usr/bin/scl enable devtoolset-8 -- sh -c '                 \
     cd /tmp/gr-cyberradio                                      \
                                                                \
     && (cd libcyberradio                                       \
         ; echo -e \"\\n\\n\\n\\nBuilding libcyberradio\\n\\n\\n\"      \
         ; mkdir build ; cd build                               \
         ; ${CMAKE}                                             \
           ${CMAKE_FLAGS}                                       \
           ${cmake_INSTALL_FLAGS}                               \
           -DCMAKE_BUILD_TYPE=Release                           \
           -S ..                                                \
         ; make ${MAKEFLAGS} install                            \
        )                                                       \

     && (cd gr-CyberRadio                                       \
         ; echo -e \"\\n\\n\\n\\nBuilding gr-CyberRadio\\n\\n\\n\"      \
         ; mkdir build ; cd build                               \
         ; ${CMAKE} -Wno-dev                                            \
           ${CMAKE_FLAGS}                                       \
           ${cmake_INSTALL_FLAGS}                               \
           -DCMAKE_BUILD_TYPE=Release                           \
           -DENABLE_DOXYGEN=OFF                                 \
           -S ..                                                \
         ; make ${MAKEFLAGS}                                    \
         ; make ${MAKEFLAGS} test                               \
         ; make ${MAKEFLAGS} install                            \
        )                                                       \
                                                                \
     && (cd /tmp                                                \
         ; rm -rf gr-cyberradio                                  \
        )                                                       \
     ' && date

If I try to build with this configuration, libcyberradio builds and installs just fine, but gr-CyberRadio fails with

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBCYBERRADIO_LIB (ADVANCED)
    linked by target "gnuradio-CyberRadio" in directory /tmp/gr-cyberradio/gr-CyberRadio/lib

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

The issue is in LibCyberRadioConfig.cmake as installed in /opt/foss/lib64/cmake/libcyberradio. I don't think there is any reason for the NO_DEFAULT_PATH statement in the FIND_PATH and FIND_LIBRARY statements. If I remove those lines, the build works properly.

crs-bs commented 3 years ago

Lmk if this doesn't fix everything. Closing.