problem with Cross-compiling beaglebone black opencv

Sysprogs forums Forums VisualGDB problem with Cross-compiling beaglebone black opencv

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #962
    peer23peer
    Participant

    Hi all,

    I’m new to the forum so a small introduction of me/my project. I’m a student at the university of applied science in Arhnem (Netherlands) majoring in mechanical engineering and I’m currently following an minor in embedded vision design. The project I’m currently working on is a soil analyzer. It works with the beaglebone and and a USB microscope webcam. It analyzes and classifies grains of soil/sand using various vision algorithms and Neural Nets etc. The project is hosted on github http://peer23peer.github.io/Soil/

    I normally build the project on the beaglebone using visual studio 2013 and visualgdb, and it works great for me. But because my code keeps growing and expanding so does my compilation time. I’m currently trying to get the project setup for cross compilation. Because I use a lot of c++11 syntax I switch to using linearo. This works fine for the libraries that don’t use openCV but I ran in to trouble with those who do:

    
    1>
    
    Build started: Project: SoilMath, Configuration: Debug_CC Win32
    
    1>  VisualGDB: Run "cmd.exe /c "C:Program Files (x86)SysprogsVisualGDBmake.exe" CONFIG=Debug_CC" in directory "D:OneDriveOpleidingHTS_HANMinor2CPPSoilSoilMath" on local computer
    1> D:/SysGCC/linaro/bin/arm-linux-gnueabihf-g++.exe -std=c++11 -ggdb -ffunction-sections -O0 -DDEBUG -fPIC -c Sort.cpp -o Debug_CC/Sort.o -MD -MF Debug_CC/Sort.dep
    1> D:/SysGCC/linaro/bin/arm-linux-gnueabihf-g++.exe -shared -o Debug_CC/SoilMath -Wl,-gc-sections -Wl,--start-group Debug_CC/Sort.o -Wl,--rpath='$ORIGIN' -Wl,-soname,SoilMath -Wl,--end-group
    2> Build started: Project: Vision, Configuration: Debug_CC Win32 2> VisualGDB: Run "cmd.exe /c "C:Program Files (x86)SysprogsVisualGDBmake.exe" CONFIG=Debug_CC" in directory "D:OneDriveOpleidingHTS_HANMinor2CPPSoilVision" on local computer
    2> D:/SysGCC/linaro/bin/arm-linux-gnueabihf-g++.exe --sysroot=D:/sysgcc/linaro/arm-linux-gnueabihf/libc -std=c++11 -ggdb -ffunction-sections -O0 -I/usr/local/include -I/usr/local/include/opencv -DDEBUG -fPIC -c Conversion.cpp -o Debug_CC/Conversion.o -MD -MF Debug_CC/Conversion.dep
    2> In file included from Conversion.h:2:0,
    2> from Conversion.cpp:4:
    2>D:OneDriveOpleidingHTS_HANMinor2CPPSoilVisionImageProcessing.h(11,28): fatal error : opencv2/core.hpp: No such file or directory
    2> #include
    2> ^
    2> compilation terminated.
    2> make: *** [Debug_CC/Conversion.o] Error 1
    2> 2> Command exited with code 2
    2> Executable: cmd.exe
    2> Arguments: /c "C:Program Files (x86)SysprogsVisualGDBmake.exe" CONFIG=Debug_CC
    2> Directory: D:OneDriveOpleidingHTS_HANMinor2CPPSoilVision
    2>VisualGDB : error : Command-line action failed
    2>EXEC : error : Build has failed. See the Output window for more details.
    2>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""C:Program Files (x86)SysprogsVisualGDB\VisualGDB.exe" /build "D:OneDriveOpleidingHTS_HANMinor2CPPSoilVisionVision.vcxproj" "/solution:D:OneDriveOpleidingHTS_HANMinor2CPPSoilSoilShellSoilShell.sln" "/config:Debug_CC" "/platform:Win32"" exited with code 1.
    ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    The sysroot is synced and opencv headers are present in the linearo/libc folder

    the current make file used in the shared library Vision is:

    
    #Generated by VisualGDB (http://visualgdb.com)
    #DO NOT EDIT THIS FILE MANUALLY UNLESS YOU ABSOLUTELY NEED TO
    #USE VISUALGDB PROJECT PROPERTIES DIALOG INSTEAD
    
    BINARYDIR := Debug_CC
    
    #Toolchain
    CC := D:/SysGCC/linaro/bin/arm-linux-gnueabihf-gcc.exe
    CXX := D:/SysGCC/linaro/bin/arm-linux-gnueabihf-g++.exe
    LD := $(CXX)
    AR := D:/SysGCC/linaro/bin/arm-linux-gnueabihf-ar.exe
    OBJCOPY := D:/SysGCC/linaro/bin/arm-linux-gnueabihf-objcopy.exe
    
    #Additional flags
    PREPROCESSOR_MACROS := DEBUG
    INCLUDE_DIRS := /usr/local/include /usr/local/include/opencv
    LIBRARY_DIRS := /usr/lib
    LIBRARY_NAMES := opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_highgui opencv_imgcodecs opencv_imgproc opencv_ml opencv_objdetect opencv_photo opencv_shape opencv_stitching opencv_superres opencv_ts opencv_video opencv_videoio opencv_videostab
    ADDITIONAL_LINKER_INPUTS :=
    MACOS_FRAMEWORKS :=
    LINUX_PACKAGES :=
    
    CFLAGS := --sysroot=D:/sysgcc/linaro/arm-linux-gnueabihf/libc -std=c++11 -ggdb -ffunction-sections -O0
    CXXFLAGS := --sysroot=D:/sysgcc/linaro/arm-linux-gnueabihf/libc -std=c++11 -ggdb -ffunction-sections -O0
    ASFLAGS :=
    COMMONFLAGS :=
    
    LDFLAGS :=  -Wl,-gc-sections
    
    START_GROUP := -Wl,--start-group
    END_GROUP := -Wl,--end-group
    
    #Additional options detected from testing the toolchain
    IS_LINUX_PROJECT := 1
    

    And my own vision library can be found here:
    https://github.com/peer23peer/Soil/tree/master/Vision

    I allready tried raspberry related questions:
    http://forum.sysprogs.com/viewtopic.php?f=5&t=2977&p=6903&hilit=opencv+cross#p6903
    http://forum.sysprogs.com/viewtopic.php?f=5&t=2725&p=6145&hilit=opencv+cross#p6145

    Any help and suggestions are appreciated.

    #3513
    support
    Keymaster

    Hi,

    The “/usr/local/include/opencv” syntax won’t work with a cross-compiler. Please use either the full Windows path (D:/SysGCC/linaro/…/include/opencv) or the ‘=’ syntax (=/usr/local/include/opencv).

    #3514
    peer23peer
    Participant

    Hi Bazis,

    Thank you for the reply. I didn’t test it because it took the admins short of a week to allow my message and I was/am under a lot of time pressure. I therefor didn’t have time to waste and switch to Cmake and an external Linux computer. In this new setup I compile and test general c++ code on an external Linux X64 computer using VisualGDB and switch to my BBB when needed. Although it isn’t cross compiling, this setup suits me well.

    The new project structure and source code can be found here https://github.com/peer23peer/VisionSoilAnalyzer

    #5838
    support
    Keymaster

    Hi,

    Sorry for the delayed reply. We have been switching to the new forum engine. If you need an urgent answer, please contact our support email, we answer that within 24-48 hours.

    Let us know if you experience further problems with your setup.

    • This reply was modified 9 years, 9 months ago by support.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.