« Close

Datasheets and User Guides

App Notes

Software & Driver

 

In-depth Build Instructions

In-depth Linux Build Instructions

Modern Ubuntu and Debian based distributions come with a binary release of libusb-1.0, so building the Exodriver is easier than ever. Install the dependencies with apt-get, checkout the Exodriver source code, and build/install it. Here are the complete steps, along with a handful of steps at the end that build LabJackPython, which is our Python module that works well with the Exodriver:

  
$ sudo apt-get install build-essential
$ sudo apt-get install libusb-1.0-0-dev
$ sudo apt-get install git-core
$ git clone git://github.com/labjack/exodriver.git
$ cd exodriver/
$ sudo ./install.sh
$ cd ..
$ git clone git://github.com/labjack/LabJackPython.git
$ cd LabJackPython/
$ sudo python setup.py install
$ python
>>> import u3
>>> d = u3.U3()
>>> d.configU3()
   

If you don’t have Ubuntu or a Debian based distribution, and your distribution doesn’t have binary libusb-1.0 packages, this step will fail:

  
$ sudo apt-get install libusb-1.0-0-dev
   

Instead build libusb-1.0 from the source. Download the source from SourceForge. Version 1.0.19 is the latest as of March 2015. Build it in the standard way:

  
$ tar xvfj libusb-1.0.19.tar.bz2 
$ cd libusb-1.0.19/
$ ./configure
$ make
$ sudo make install
   

Be sure to consult INSTALL.Linux for instructions on how to set the device permissions correctly using udev.

In-depth Mac OS X Build Instructions

Download Xcode and install it if you don’t have it already.

Mac OS X requires libusb-1.0 to be built from the source (like many Linux distributions). Download the source from SourceForge. Version 1.0.19 is the latest as of March 2015. Build it in the standard way:

  
$ tar xvfj libusb-1.0.19.tar.bz2 
$ cd libusb-1.0.19/
$ ./configure
$ make
$ sudo make install
   

After installing libusb-1.0, install the Exodriver as described in the Quickstart.

Optional: Build a combined 32-/64-bit Exodriver on Mac OS X

These steps are generally not needed, but there are circumstances that require a combined 32-bit and 64-bit Exodriver. You need both architectures when you get error messages like the one in this LabJack forum topic

  
dlopen(liblabjackusb.dylib, 6): no suitable image found.  Did find:
    /usr/local/lib/liblabjackusb.dylib: mach-o, but wrong architecture
   

In this case, a 32-bit process tried to load a 64-bit Exodriver. Here’s how it happened: When following the instructions in the Quickstart, the compiler built a copy of the Exodriver for its native architecture. On modern Mac OS X systems, that’s x86_64 (64-bit). Verify this by running:

  
$ file /usr/local/lib/liblabjackusb.dylib 
/usr/local/lib/liblabjackusb.dylib: Mach-O 64-bit dynamically linked shared library x86_64
   

Normally, this is what you want. The programs you will use to call the Exodriver will also be 64-bit. The built-in Python on Mac OS X, for example, is compiled for three architectures, including x86_64:

  
$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64):  Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386):    Mach-O executable i386
/usr/bin/python (for architecture ppc7400): Mach-O executable ppc
   

There are some programs on Mac OS X, though, that are not 64-bit (they’re i386 only), and they can’t load a 64-bit Exodriver. The Python download from python.org, for example, is 32-bit at the time of this writing. We recommend using the built-in Python on Mac OS X.

When you must load the Exodriver from a 32-bit process, you must compile libusb-1.0 and the Exodriver to be combined 32-/64-bit libraries. Start with libusb-1.0

  
$ tar xvfj libusb-1.0.19.tar.bz2 
$ cd libusb-1.0.19/
$ export CFLAGS="-arch i386 -arch x86_64"
$ ./configure --disable-dependency-tracking
$ make
$ sudo make install
   

Confirm it worked by running:

  
$ file /usr/local/lib/libusb-1.0.dylib
/usr/local/lib/libusb-1.0.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/libusb-1.0.dylib (for architecture i386):    Mach-O dynamically linked shared library i386
/usr/local/lib/libusb-1.0.dylib (for architecture x86_64):  Mach-O 64-bit dynamically linked shared library x86_64
   

After libusb-1.0 is installed correctly, move on to the Exodriver. Download the source link on GitHub. Find the Exodriver download directory

  
$ cd path/to/exodriver
$ cd liblabjackusb/
   

Now edit the Makefile in a text editor to comment out (put a # sign in front of) this ARCHFLAGS line:

  
#ARCHFLAGS =
   

and uncomment (remove the # sign from) this ARCHFLAGS line two lines above it:

  
ARCHFLAGS = -arch i386 -arch x86_64
   

Now build and install the software

  
$ cd ..
$ sudo ./install.sh
   

Verify that it worked by running:

  
$ file /usr/local/lib/liblabjackusb.dylib 
/usr/local/lib/liblabjackusb.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/liblabjackusb.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/liblabjackusb.dylib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64
   

Because libusb-1.0 and the Exodriver are built for the i386 architecture, 32-bit applications can load them.