discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Cross-Compile issue with GNU Radio 3.8: cmake is


From: Toby Flynn
Subject: Re: [Discuss-gnuradio] Cross-Compile issue with GNU Radio 3.8: cmake is building an incorrect file
Date: Tue, 21 May 2019 13:15:00 -0400

Marcus,
   I think have tracked down the root of the issue, I still do not have a fix.  CMake cmExportFileGenerator.cxx,starting at line 318 prefixItems, appears to be seeing the installed path for the files as an absolute path. it is not seeing the sysroot information from the system to know the files are not really installed in /usr/lib like the install_mainfest.txt says it is.  This causes the the string  "${_IMPORT_PREFIX}/" to not get added to the runtime_swigTargets-release.cmake file.
from cmExportFileGenerator.cxx:

static void prefixItems(std::string& exportDirs)
{
  std::vector<std::string> entries;
  cmGeneratorExpression::Split(exportDirs, entries);
  exportDirs.clear();
  const char* sep = "";
  for (std::string const& e : entries) {
    exportDirs += sep;
    sep = ";";
    if (!cmSystemTools::FileIsFullPath(e) &&
        e.find("${_IMPORT_PREFIX}") == std::string::npos) {
      exportDirs += "${_IMPORT_PREFIX}/";
    }
    exportDirs += e;
  }
}

Thanks
Toby   

On Mon, May 20, 2019 at 11:55 AM Müller, Marcus (CEL) <address@hidden> wrote:
Hi Toby,

I don't really doubt it's a CMake issue; to be precise, I think it's an
issue in the triangle between CMake, CMake instructing SWIG and
detecting the right Python libs along the way.

Anyway, I'll take a minute to literally parse your email :)

Thanks!
Marcus

On Mon, 2019-05-20 at 09:09 -0400, Toby Flynn wrote:
> Marcus,
>    I think what you want to see if the configuration for CMake, the actual build line is fairly normal.  This is the contents of the file which configures CMake.  I believe this is a CMake issue, not a Python issue.   It is only the creation of one .cmake file which leads to OOT building errors.
> Thanks
> Toby
>
> # CMake system name must be something like "Linux".
> # This is important for cross-compiling.
>
> set( CMAKE_SYSTEM_NAME Linux )
> set( CMAKE_SYSTEM_PROCESSOR aarch64 )
> set( CMAKE_C_COMPILER aarch64-poky-linux-gcc )
> set( CMAKE_CXX_COMPILER aarch64-poky-linux-g++ )
> set( CMAKE_ASM_COMPILER aarch64-poky-linux-gcc )
> set( CMAKE_AR aarch64-poky-linux-ar CACHE FILEPATH "Archiver" )
> set( CMAKE_C_FLAGS "  --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0=/usr/src/debug/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0 -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot= -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot-native=    --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot" CACHE STRING "CFLAGS" )
> set( CMAKE_CXX_FLAGS "  --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0=/usr/src/debug/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0 -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot= -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden   --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot" CACHE STRING "CXXFLAGS" )
> set( CMAKE_ASM_FLAGS "  --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0=/usr/src/debug/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0 -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot= -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot-native=    --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot" CACHE STRING "ASM FLAGS" )
> set( CMAKE_C_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CFLAGS for release" )
> set( CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CXXFLAGS for release" )
> set( CMAKE_ASM_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional ASM FLAGS for release" )
> set( CMAKE_C_LINK_FLAGS "  --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )
> set( CMAKE_CXX_LINK_FLAGS "  --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0=/usr/src/debug/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0 -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot= -fdebug-prefix-map=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden   --sysroot=/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )
>
> # only search in the paths provided so cmake doesnt pick
> # up libraries and tools from the native build machine
> set( CMAKE_FIND_ROOT_PATH /home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot /home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot-native    )
> set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
> set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
> set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
> set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
>
> # Use qt.conf settings
> set( ENV{QT_CONF_PATH} /home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/qt.conf )
>
> # We need to set the rpath to the correct directory as cmake does not provide any
> # directory as rpath by default
> set( CMAKE_INSTALL_RPATH  )
>
> # Use native cmake modules
> list(APPEND CMAKE_MODULE_PATH "/home/builduser/Development/38test/ultra/oe/build/tmp/work/aarch64-poky-linux/gnuradio/3.8.0+gitAUTOINC+72aa97daab-r0/recipe-sysroot/usr/share/cmake/Modules/")
>
> # add for non /usr/lib libdir, e.g. /usr/lib64
> set( CMAKE_LIBRARY_PATH /usr/lib /lib)
>
>
> On Fri, May 17, 2019 at 4:46 PM Müller, Marcus (CEL) <address@hidden> wrote:
> > Hi Toby,
> >
> > what's the verbatim cmake command line Yocto is executing?
> >
> > Since it's impossible for the build system to know by itself what the
> > target python will be, unless you tell it which, we'll have to figure
> > out a way to consistently set Python used during CMake, Python used
> > during build, and Python used on target.
> > It's a complicated thing, actually – the python that the build system
> > internally (a lot!) doesn't have to be the one the used to link SWIG
> > files against.
> > So, I see no way but to set the PYTHON_LIBRARIES and
> > PYTHON_INCLUDE_DIRS explitly in the cmake command line. (If anyone
> > could point me towards an easier solution that doesn't trade project
> > sanity for having one argument fewer in a OE layer, I'd be very happy.)
> >
> > Now, I don't know if all this is related to your problem. But then
> > again, I don't know anything about the OOT module you're trying to
> > build. So far, we don't have overly many 3.8-compatible OOTs, so if you
> > can point us to the one you're working with, that would be highly
> > appreciated. One of the main reasons of breakage is that the old CMake
> > constructs we used to employ in GNU Radio have been replaced by more
> > modern CMake patterns, which especially means that the notion of
> > component dependencies and hence install targets has changed.
> >
> > Best regards,
> > Marcus
> >
> > On Fri, 2019-05-17 at 13:21 -0400, Toby Flynn wrote:
> > > I am attempting to install OOT modules using a Yocto/Openembedded
> > > enviroment and the latest GNURadio 3.8.  This process was working
> > > before the latest cmake changes to 3.8 were incorporated.  I am now
> > > having issues with the cross-complitaion.  I have tracked the issue
> > > down to a file I believe is created by cmake:
> > > build/gnuradio-
> > > runtime/swig/CMakeFiles/Export/lib/cmake/gnuradio/runtime_swigTargets
> > > -release.cmake
> > >
> > > When building directly on a computer this file has difference, line
> > > 10 than the one build using Yocto.
> > > Direct build on a computer the line is:
> > > IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/python3.6/dist-
> > > packages/gnuradio/gr/_runtime_swig.so"
> > >
> > > On the Yocto build the line is:
> > >
> > > IMPORTED_LOCATION_RELEASE "/usr/lib/python3.5/site-
> > > packages/gnuradio/gr/_runtime_swig.so"
> > >
> > > The missing ${_IMPORT_PREFIX} leads to cmake issues since
> > > _runtime_swig.so cannot be found.
> > >
> > > Does anyone have a suggestion for something I can try to fix the
> > > issue.
> > >
> > > Thanks
> > > Toby
> > >
> > >
> > > _______________________________________________
> > > Discuss-gnuradio mailing list
> > > address@hidden
> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

reply via email to

[Prev in Thread] Current Thread [Next in Thread]