chipKIT® Development Platform

Inspired by Arduino™

Network shield libraries cannot compile under Linux32

Created Fri, 23 Sep 2011 17:22:12 +0000 by noisette


noisette

Fri, 23 Sep 2011 17:22:12 +0000

After a couple of hours of head scratching, i've narrowed down my problem:

I cannot successfully compile any of the Digilentinc Network Shield and Basic IO Shield sketches under my Linux32 (Ubuntu) platform. They all fail saying that the compiler cannot see the ChipKITEthernet.h file.

I started my Windows XP laptop at work, installed the same libraries the same way i did previously under my Linux MPIDE and i have no issues compiling.

There must be something that prevents the Linux32 platform from compiling these libraries.

Can someone add this issue to the buglist? Jean-Francois


Paul_L

Fri, 23 Sep 2011 18:20:18 +0000

Jean-Francois I am running the MPIDE on windows and the compiling works ok . But i think that you can do an experiment . Start MPIDE create a new sketch and save it. See where it is saving by default. Where the sketch are saved make a folder named "libraries" and unzip the libraries there


GeneApperson

Fri, 23 Sep 2011 20:01:05 +0000

There is also an issue with how the MPIDE keeps track of where libraries are. If the above suggestion doesn't help, try deleting the #include of the library header file and re-importing the library into the sketch.

Gene Apperson Digilent


noisette

Sat, 24 Sep 2011 11:28:44 +0000

Hi Paul and Gene,

i tried both of your suggestions. Still no success. I can only successfully compile those libraries and work on my Windows XP MPIDE.

Could someone at Digilentinc try to install Ubuntu on a PC on your end , install MPIDE for Linux32 , then your Network Shield and Basic IO libraries and see how you can compile your demo sketches for these libraries. Something doesn't work with this setup.

My Linux32 MPIDE is blazingly faster than my Windows XP MPIDE. That's why i would like to figure out how to get this to work on Linux.

Cheers and thanks for your help. Jean-Francois.


Paul_L

Sun, 25 Sep 2011 07:18:57 +0000

Hi Noisette (Jean-Francois)

I was trying to run mpide on my home server that is running FC12 x64 to try your problems but unsuccseful up to now . Maybe is a problem that mpide is a 32 bit application and the OS is for 64 , or maybe some java problems .

Anyway when starting it creates a sketchbook directory in my /home/paul/ local directory .

When trying to run mpide it stall with this message

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
        at java.lang.Runtime.loadLibrary0(Runtime.java:840)
        at java.lang.System.loadLibrary(System.java:1047)
        at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
        at processing.app.Editor.populateSerialMenu(Editor.java:967)
        at processing.app.Editor.buildToolsMenu(Editor.java:704)
        at processing.app.Editor.buildMenuBar(Editor.java:486)
        at processing.app.Editor.<init>(Editor.java:208)
        at processing.app.Base.handleOpen(Base.java:698)
        at processing.app.Base.handleOpen(Base.java:663)
        at processing.app.Base.handleNew(Base.java:560)
        at processing.app.Base.<init>(Base.java:300)
        at processing.app.Base.main(Base.java:183)

Looks like a java problem


noisette

Sun, 25 Sep 2011 12:36:51 +0000

Hi Paul, I had the same issue when i first installed MPIDE on Linux. What you see is that RXTX-java is not installed yet in your java setup. In Ubuntu, i went to the Ubuntu software center , searched for RXTX-java, downloaded it and installed it through the Ubuntu software center. The error disappeared since then.

Thanks for trying to troubleshoot this issue,

Jean-Francois


noisette

Sun, 25 Sep 2011 14:31:18 +0000

Install on 64bit Systems (found on the web)

The binary packages for MPIDE are all built for 32bit Linux distributions, if you are running 64bit you need to have some additional libraries installed. You’ll need to have 32bit versions of libelf.so and libreadline.so to be able to program the chipKIT, these need to be in /usr/lib32. You may well need to sym-link these latest versions manually, installing these libs is a fairly advanced operation and will vary significantly between distributions.

So this is what I had to do to get it running on 64 bit Ubuntu (Maverick/10.10):

  1. Download the Linux Version and unpack it somwehere.

  2. Getting librxtx-java and other jni items loadable via the LD_LIBRARY_PATH or CLASSPATH, which I wrote a post about.

  3. The next issue that I ran into was a permissions issue

    Cannot run program “/home/username/mpide-0022-chipkit-linux32-20110619/hardware/pic32/compiler/pic32-tools/bin/pic32-g++”: java.io.IOException: error=13, Permission denied

I initially solved it by chmodding everything in that directory, but that resulted in:

pic32-g++: error trying to exec ‘cc1plus’: execvp: No such file or directory

So I followed the advice in this forum post and executed chmod +x -R ./hardware/pic32/compiler/ and that seemed to do it for me. I think I was able to compile/verify the blink example at this point.

  1. Add 32bit versions of libelf and libreadline6 to /usr/lib32:

The first error I ran into was:

/home/username/mpide-0022-chipkit-linux32-20110619/hardware/pic32/compiler/pic32-tools/bin/../pic32mx/bin/gcc/pic32mx/4.5.1/cc1plus: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory

I solved this by downloading the i386 deb from here, opening it with archive manager and copying /usr/lib/libelf-0.147.so to /usr/lib32/libelf-0.147.so. after this I creating the versioned symbolic link via ln -s libelf-0.147.so libelf.so.1

Tried it again and was onto my next error:

/home/username/mpide-0022-chipkit-linux32-20110619/hardware/tools/avrdude: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

Repeat the same process for libreadline6 (which contains another required lib too) And I was able to upload the and run the blink example.

Now on to making the TLC Library work..


noisette

Tue, 27 Sep 2011 20:23:29 +0000

I am still trying to successfully get the Digilent Network Shield and Basic IO library demo sketches to compile without errors under my Linux 32 Ubuntu installation.

So far, compiling those libraries only works for me under Windows XP.

I've tried all the suggestions sent from KeithV , Paul and Gene, but still no success. I keep running around in cercles.

I am willing to pay someone to remotely connect to my Linux Ubuntu PC install and troubleshoot the issue once and for all.

Is someone here familiar with Ubuntu and MPIDE and could resolve this problem?

Hope to hear from you soon, Jean-Francois.


KeithV

Wed, 28 Sep 2011 03:51:44 +0000

Jean-Francois,

I am sorry that I am not a Linux guy, I am pretty much Windows only so I won't be much help (I am not a Window's snob; just Linux illterate). However, it would be my assumption that building should be the same either on Linux or Windows and if there is a difference it would be with the operation of MPIDE or the compiler. My suggestion would be to get on the MPIDE form (github) and hit one of those guys up for some help. I think there are some known issues; but I have no idea of how they pretain to this. My experience has been that the MPIDE guys are pretty responsive to issues that are brought to them.


peplin

Mon, 10 Oct 2011 19:41:29 +0000

Hi Jean-Francois,

I recently ran into similar issues, and for the most part it seems to be case sensitivity issues. The files are not very consistent with capitalization.

I saw your issue on GitHub and added the fixes I had to do to get the USB library to compile (https://github.com/chipKIT32/chipKIT32-MAX/issues/134).

For the Ethernet library, I get the same error:

fatal error: ChipKITEthernet.h: No such file or directory

take a look in the library directory, however:

$ ls
documents  examples  utility  chipKITClient.cpp  chipKITEthernet.cpp  chipKITEthernet.h  chipKITServer.cpp  chipKITUDP.cpp  keywords.txt

they are all lower case "chipKIT" not "ChipKit"! On Windows of course this makes no difference, but it's critical in any case sensitive filesystem (Mac OS X's included).

I added the files I had to change to that GitHub issue, hopefully this helps you. I can compile the ChipKITWebServer example after this.


KeithV

Tue, 18 Oct 2011 15:01:16 +0000

We just uploaded a newer version of the Network libraries and I attempted to fix all of the case differences. I do not have Linux, so I could not test it. If you want to download the latest copy of the library and give it a try, let me know if I missed a header.