-
Notifications
You must be signed in to change notification settings - Fork 32
/
INSTALL.MacOSX
223 lines (145 loc) · 7.23 KB
/
INSTALL.MacOSX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
Exodriver (liblabjackusb) Library Installation Instructions
============================================================
Table of Contents
-----------------
Installation From Installer
Installation from Source Code
Mac OS X Requirements
About These Instructions
Installing libusb-1.0
liblabjackusb Library Script Installation
Compiling and Running the Example Programs
Optional: Build a combined 32-/64-bit Exodriver on Mac OS X
Uninstalling the Old U3 and UE9 Driver
Installation From Installer
============================
First, download the installer online here:
http://labjack.com/support/linux-and-mac-os-x-drivers
Next, unzip the downloaded file (if not done automatically) and run the
Exodriver_NativeUSB_Setup.pkg package installer. Follow the instructions
from the installer to install the Exodriver and required libusb-1.0 libraries.
Note that the installed libraries are both 32 and 64-bit binaries. The
installer does not have the source code installation requirements mentioned
below.
To install the latest Exodriver from source code instead, use the instructions
in the "Installation from Source Code" section below.
Installation from Source Code
==============================
Mac OS X Requirements
---------------------
1. Xcode developer tools
2. The libusb-1.0 library. See the "Installing libusb-1.0" for the libusb-1.0
download and installation instructions.
3. Mac OS X 10.5 Leopard or later.
4. Uninstall any MacOSX_C_NativeUSB based drivers. The old driver conflicts
with the current liblabjackusb library. See the "Uninstalling the Old U3 and
UE9 Driver" section for more information.
About These Instructions
------------------------
All lines that start with a dollar sign ($) are commands and need to be run
from a terminal. For example, the Terminal application is usually located in
the Applications folder.
Installing libusb-1.0
---------------------
Mac OS X requires libusb-1.0 to be built from the source. Download the source
from the libusb project page:
http://libusb.info
Version 1.0.21 is the latest as of 2017. From the directory containing
the libusb source download, build it in the standard way:
$ tar xvfj libusb-1.0.21.tar.bz2
$ cd libusb-1.0.21/
$ ./configure
$ make
$ sudo make install
For building a combined 32/64-bit libusb-1.0 library, refer to the
"Optional: Build a combined 32-/64-bit Exodriver on Mac OS X" section.
liblabjackusb Library Script Installation
-----------------------------------
First, go to the Exodriver directory.
To install by script, run the following command:
$ sudo ./install.sh
This script will attempt to build, install, and make any necessary
system configurations.
Alternatively, without using the script go to the liblabjackusb/
directory and run the following commands:
$ cd liblabjackusb/
$ make
$ sudo make install
For building a combined 32/64-bit liblabjackusb library, refer to the
"Optional: Build a combined 32-/64-bit Exodriver on Mac OS X" section.
Compiling and Running the Example Programs
------------------------------------------
The example code/programs use the liblabjackusb library and the labjackusb.h
header files in the liblabjackusb/ directory.
The examples are located in the U3, U6, and UE9 subdirectories in the examples/
directory. To compile the programs go to your device's directory and run
$ cd examples/U6/
$ make
Run one of example programs like this:
$ ./u6BasicConfigU6
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":http://forums.labjack.com/index.php?showtopic=4983
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 i368
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.21.tar.bz2
$ cd libusb-1.0.21/
$ 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. 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 below it:
ARCHFLAGS = -arch i386 -arch x86_64
Now build and install the software
$ make clean
$ make
$ sudo make install
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.
Uninstalling the Old U3 and UE9 Driver
--------------------------------------
The old U3 and UE9 driver, previous to the libusb 1.0 requirement, used custom
kernel modules, and will conflict with with the current liblabjackusb library.
To uninstall the old driver, delete the liblabjackusb.dylib:
$ sudo rm -f /usr/lib/liblabjackusb.dylib