WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using Tiny Core on the RoBoard, openCV not working  (Read 6096 times)

Offline jwoodman

  • Newbie
  • *
  • Posts: 4
Using Tiny Core on the RoBoard, openCV not working
« on: February 11, 2011, 01:43:13 PM »
Hello,

I'm running Tiny Core on my RoBoard RB-100. Everything works exceptionally well, but I would really like to use the openCV library. I installed it from the app manager, compiled some programs with it, and they all return "illegal instruction" and exit when I run them. I believe that the issue lies in my processor not supporting SSE/SSE2 and the openCV library must have been compiled without disabling SSE.
Is there any simple way of recompiling openCV for TC without SSE/SSE2?

Thank you,
Justin Woodman

Offline roboard

  • Newbie
  • *
  • Posts: 1
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #1 on: February 14, 2011, 12:53:23 AM »
Since RoBoard's CPU doesn't support MMX, SSE, and SSE2 instructions, you need to disable the option in OpenCV's source code. To do this, find the following code segment in cxtypes.h of OpenCV 1.1pre1 or 2.0:

Code: [Select]
#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
      (_MSC_VER >= 1400 || defined CV_ICC)) \
      || (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
    #include <emmintrin.h>
    #define CV_SSE2 1
  #else
    #define CV_SSE2 0
  #endif


change to

Code: [Select]
#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
      (_MSC_VER >= 1400 || defined CV_ICC)) \
      || (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
    //#include <emmintrin.h>
    #define CV_SSE2 0
  #else
    #define CV_SSE2 0
  #endif

  #undef __MMX__
  #undef __SSE__

Offline jwoodman

  • Newbie
  • *
  • Posts: 4
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #2 on: February 14, 2011, 01:11:13 PM »
Thank you for the help,

I will try this when I get home. Does this only work on 1.1pre1 and 2.0? The cxtypes.h file doesn't even seem to exist in version 2.1 or 2.2. Additionally there do not appear to be any SSE parameters shown in ccmake.

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #3 on: February 15, 2011, 11:25:25 AM »
i will rebuild soon opencv disabling some flags like sse sse2 sse3 ssse3

btw you don't need to patch the source you can use cmake flags to disable them
Code: [Select]
cmake -DCMAKE_BUILD_TYPE=Release \
     -DENABLE_SSE=OFF \
     -DENABLE_SSE2=OFF \
     -DENABLE_SSE3=OFF \
     -DENABLE_SSSE3=OFF .
« Last Edit: February 15, 2011, 11:28:51 AM by Arslan S. »

Offline jwoodman

  • Newbie
  • *
  • Posts: 4
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #4 on: February 15, 2011, 12:34:09 PM »
Thank you,
I will attempt to build openCV 2.0 with those flags disabled when/if I have a few minutes tonight. Unfortunately, this might take hours because the only linux system I have is actually my roboard.
« Last Edit: February 15, 2011, 12:41:00 PM by jwoodman »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #5 on: February 16, 2011, 06:31:16 AM »
Thank you,
I will attempt to build openCV 2.0 with those flags disabled when/if I have a few minutes tonight. Unfortunately, this might take hours because the only linux system I have is actually my roboard.

Boot TC live on the Windows computer in the corner. Build in RAM and don't touch the HD.
The only barriers that can stop you are the ones you create yourself.

Offline jwoodman

  • Newbie
  • *
  • Posts: 4
Re: Using Tiny Core on the RoBoard, openCV not working
« Reply #6 on: June 03, 2011, 09:07:40 AM »
I want to say thanks to Arslan for disabling ffmpeg and sse, sse2, sse3, and ssse3 flags in the current openCV extension!
I just got back to playing with this and it's makings things much easier!