9 Replies Latest reply on May 18, 2014 11:56 AM by AlexT_Intel

    opencv versus toolchain versus yocto

    danaug

      First of all, let me tell you guys something.. this yocto build that takes hours, dependence of internet connection, a bunch of package that must be pre-installed in the desktop, and a lot of frustration on this process.. forget it... it is very painful... you guys at least could provide some pre-fetched images to reduce the pain... it is the first time I see people providing releases that in fact you do not have the ingredients you need.. reading this community most part of people dislike it... it is painful and slow.

       

      please think on this suggestion.

       

      anyway.. my questions now

       

      1) opencv - should I rebuild everything eliminating the uclib and replacing by eglic ? yes or not ? that's really confusing because looks like the opencv is part of packages dependences.

       

      for example, this blog:

       

      Intel Galileo - Building Linux Image - Malinov Family Web Presence

       

      is badly copied and it is not even mentioned on this document:

       

      http://www.intel-software-academic-program.com/courses/diy/Intel_Academic_-_DIY_-_InternetOfThings/IntelAcademic_IoT_07_…

       

      the article suggests to compile everything removing the uclib and making a image root fs of almost 3Gb ???? IMAGE_ROOTFS_SIZE = "3072000"

       

      ok..ok.. then I need to generate a new compilation with BSP image but I believe I need to have a new toolchain adding "-c populate_sdk" in the end right ?

       

      2) if I really need to do the item (1), and if I installed my new tool chain in my machine... why I cannot compile a simple opencv example ? for example, if I add the "include <cv.h>" the compiler says this header is not specified...so it means, the toolchain that took almost the whole afternoon does not have what I need ?

       

      3) I tried also to compile the opencv from source, but after to run cmake (you can test) the cmake claims saying your g++ compiler even compile a simple c++ test code

       

      Could someone give me help ? thanks a million!!!

        • 1. Re: opencv versus toolchain versus yocto
          LarsR

          Now, don't take this the wrong way, but I'm not quite sure this DIY concept is your thing.

          I could be wrong, but you do sound really really frustrated already.

           

          With that out of the way ... here's a link to AlexT's binary build which has everything

          to get you reasonably well under way. http://alextgalileo.altervista.org.

           

          You're welcome!

          • 2. Re: opencv versus toolchain versus yocto
            Liam

            Actually ....

             

            I am about 99.53% sure that these prebuilt images from Alex are:

             

            - a) vanilla, and so uclibc based, and so opencv will not work in these images

            - b) both require you to update the stock firmware in order to work correctly. I know you can do that via serial link because that's how I did it.

             

            Let me go back to the original posters question.

             

            As far as I know (and I have personally done this, and I know it works)

             

            1. In order to make opencv work, yes indeed you do need to rebuild, from scratch, using the yocto build environment, an eglibc based Linux image. This will take several hours but works pretty much as described by Sergey.

            2. Strictly speaking, you do not need to follow the complete instructions in Sergey's blog (although it is useful to do that). Following Sergey's instructions to the letter also gives you a galileo image which contains a full development toolchain. This is why you increase the size of the SD image to 3GB

            3. I don't understand OP's question (2). Perhaps you can elaborate?

            4. If you mean "compile opencv from source on the galileo", I tried that too. Don't bother. While building it will work, if you do it correctly, it will

            - a) take ages, and

            - b) not work anyway. OpenCV just doesn't work on the uclibc based images.

            5. Finally, if you *do* rebuild a Linux image based on eglibc, you will need to rebuild the cross compiler toolchain in order to make Arduino work and hook it into your Arduino IDE. This works too, and someone just posted yesterday how to do this for Windows which I haven't tried yet, but I will soon.

             

            I have a prebuilt image, eglibc based, 3GB in size (although it compresses down a lot more), including toolchain, with working opencv.

            If you don't mind taking an image from a complete stranger, I'll upload it for you to someplace later this evening. It is more or less the full "sergey" build, with one addition. I have enabled swap functionality because I am trying to build something which won't build without swap. (dunno yet if it will build ~with~ swap, but that's something to try for later this evening)

             

            Unpack to SD card

            Boot

            Enjoy opencv goodness

             

            Regards

            Liam

            • 3. Re: opencv versus toolchain versus yocto
              Liam

              actually actually ..

               

              now that I think of it, my SD image is based on the 1.0.0 release

               

              So the complete set of instructions is really:

               

              Update SDI firmware to 1.0.0
              *Now* unpack my image to SD card
              Reboot

              Enjoy opencv goodness

               

              So first do a bit of online research and find out if "update firmware to 1.0.0" is something you are interested in doing. If so, you're welcome to my SD image if you need it.

               

              Otherwise you could just rebuild, using yocto, and based on the 0.7.5 release, an eglibc based SD card image.
              opencv will work on that.

              • 4. Re: opencv versus toolchain versus yocto
                danaug

                LarsR

                 

                   Sometimes less is more... bad comment, wrong response, useless. I only gave a suggestion to intel improve this yocto builds.

                 

                Liam

                 

                   I sent a private message to you.  I will not post anything on this forum anymore.

                 

                Thanks!

                Dan

                • 5. Re: opencv versus toolchain versus yocto
                  AlexT_Intel

                  Not addressing the original question (as it looks to be answered already), I just wanted to touch upon the image thing mentioned by LarsR and ultralman for anyone reading this thread later on. The images on alextgalileo.altervista.org are indeed vanilla, the idea is to provide a prebuilt Linux image based on the latest BSP + respective SPI flash binary. As such these images don't have development tools and may require SPI firmware update (e.g. with current 0.7.5 being official and 1.0.0 being the latest, firmware update is needed, e.g. with 0.9.0 it wasn't).

                   

                  What LarsR probably was referring to in this context was rather a "devtools" image one can find in this thread: Collaborating to develop a "devtools" version of Linux which is Arduino IDE compatable. It is still uclibc-based, but does have dev tools installed, so you shouldbe able to compile stuff right on Galileo. It is based on the officially released BSP version (0.7.5) and as such doesn't require firmware update beyond recommended by Intel.

                   

                  As far as OpenCV is concerned, it's actually interesting to see where the problem is. Quick googling doesn't reveal any fundamental roadblocks for OpenCV to work with uclibc, so maybe ther is  a solution for that. Given the frequency of the questions on that topic, it may be worth digging into this to find a specific reason and potentially a fix...

                  • 6. Re: opencv versus toolchain versus yocto
                    LarsR

                    What I was trying to convey was the analogy of Yocto building and climbing Mount Everest.

                    If the mountain is too steep, maybe try and find a less steep mountain to climb, instead of getting as frustrated as the original poster.

                     

                    No offence to anyone, but for me, your image Alex was "the lesser hill to climb", thats why I like to point it out to the countless people

                    who seems to struggle with Yocto. Heck, it took me the better part of a week researching the build manuals before I made it work for me.

                    • 7. Re: opencv versus toolchain versus yocto
                      AlexT_Intel

                      Yeah, I too spent quite a lot of time at the beginning picking various pieces of information from various sources to be able to do something meaningful :-)

                       

                      What do you think would help people to start with Yocto, given that we have a prebuilt VM image they can use (with supported OS version and with all prerequisites installed, which are two of the main problems I've seen so far) and compilation guides in BSP Build Guide, by Sergey and elsewhere? Do you think these guides still lack something? I'm willing to write one if that's the case. And the same could be then expanded to SPI/firmware capsule building.

                      • 8. Re: opencv versus toolchain versus yocto
                        LarsR

                        I really don't think there's much that can be improved to what you already made available Alex. It's top dollar as is.

                         

                        I do think that the Intel'ers here need to either push work like yours to be more visible or come clean and tell everyone that the IoT kit and page is the way to go from here.

                        The problem in my mind is that people are being told to go straight to Mount Everest, i.e. Yocto.

                        It's like saying "Who needs Redhat or Debian, heck no, lets go make our own". Very obvious to me with the volume of people here with build problems.

                        • 9. Re: opencv versus toolchain versus yocto
                          AlexT_Intel

                          Yeah, fair enough, thanks for your comment.