7 Replies Latest reply on Jun 2, 2014 2:23 PM by mhahn

    python import fcntl module error when doing cross compiling

    hdxia

      Hello,

       

      I am trying to use cross-compiling to compile mongoDB for Galileo. I compiled the cross-compiler on my 64-bit workstation and started to run python after installing the cross-compiler and source the environment. However, python reports fcntl module load failure. any help?

       

      by the way, this problem does not exist when you run python on Galileo. it seems only cross compiling tool problem.

       

      thanks

      Haidong

        • 1. Re: python import fcntl module error when doing cross compiling
          mhahn

          I'd suggest writing a Yocto bitbake recipe and build within Yocto. However, with the available memory you might not be able to run MongoDB on Galileo at all

          1 of 1 people found this helpful
          • 2. Re: python import fcntl module error when doing cross compiling
            mhahn

            as alternative to the Yocto build you may want to generate a "development SD card image" for Galileo with compilers and development tools installed. Then take the SD card, chroot into it from a Linux box and build within this environment

            1 of 1 people found this helpful
            • 3. Re: python import fcntl module error when doing cross compiling
              hdxia

              Hi Mhahn,

               

              I feel there is a bug with the cross-compiling tool for python environment setup, but don't know how to fix it. it seems a straightforward way if the problem can be fixed quickly since I already have the setup.

               

              for the Yocto option, I thought about doing it, but it is also a learning curve for since I am not familiar with writing a bitbake recipe for a new package.

               

              for the chroot, I don't have experience with it neither. do you have any links on how to do it with the SD image? Actually, I tried to compile MongoDB with the development a full image with SDK tools on Galileo, but the compilation stops in the middle due to memory constrain.

               

              Thanks

              Haidong

              • 4. Re: python import fcntl module error when doing cross compiling
                mhahn

                 

                I feel there is a bug with the cross-compiling tool for python environment setup, but don't know how to fix it. it seems a straightforward way if the problem can be fixed quickly since I already have the setup.

                 

                Well, possibly - but I fear it's not completely easy

                 

                for the chroot, I don't have experience with it neither. do you have any links on how to do it with the SD image? Actually, I tried to compile MongoDB with the development a full image with SDK tools on Galileo, but the compilation stops in the middle due to memory constrain.

                 

                I don't know the exact layout of your SD card. For the meta-intel-iot-devkit - Intel IoT Developer Kit metadata images I am currently working on you would have a 2 partitions on the SD card, a FAT and a ext3 one. If you have a Linux box (Intel architecture - on different architecture it wouldn't work that way) and your SD card is connected to let's say /dev/sdb, you would mount the ext3 partition

                $  sudo mount /dev/sdb2 /mnt

                If the ext3 partition is put as a file on the SD card you'd mount this file likewise.

                 

                Afterwards chroot into it the mount point (here: /mnt)

                $ sudo chroot /mnt/

                 

                which would give you a prompt in your chroot environment

                bash-4.3# ls

                bin  boot  dev etc  home  lib lib32  lost+found  media  mnt  opt  proc  run  sbin  sketch  sys  tmp  usr  var  www

                bash-4.3# gcc

                gcc: fatal error: no input files

                compilation terminated.

                 

                Depending on what you need to do you might have to bind some other folders to your chroot dir (e.g. /proc). Pls check "man mount" on that.

                You are now in the environment of your Galileo image and can still build on a powerful host machine

                • 5. Re: python import fcntl module error when doing cross compiling
                  hdxia

                  HI Mhahan, I did not use the meta-intel-iot-devkit-intel, but I will give it a try. Thanks for all the help. Btw, does image built with meta-intel-iot-devkit still support Arduino IDE?

                   

                  thanks

                  haidong

                  • 6. Re: python import fcntl module error when doing cross compiling
                    hdxia

                    HI Mhahan, I did not use the meta-intel-iot-devkit-intel, but I will give it a try. Thanks for all the help. Btw, does image built with meta-intel-iot-devkit still support Arduino IDE?

                     

                    thanks

                    haidong

                    • 7. Re: python import fcntl module error when doing cross compiling
                      mhahn

                      I did not use the meta-intel-iot-devkit-intel, but I will give it a try.

                       

                      well, the "chroot" description should work whatever image you use. You would obviously need the development tools installed on your SD card.

                       

                      Btw, does image built with meta-intel-iot-devkit still support Arduino IDE?

                       

                      the iotdevkit-multilibc branch does support it

                      1 of 1 people found this helpful