|
Help For Compiling On Linux
This document describes how to interface with the
SpinAPI control library, which is used to control all SpinCore
products, including PulseBlaster, PulseBlasterDDS,
PulseBlasterESR, PulseBlasterESR-PRO, and RadioProcessor.
Linux Compilation
SpinAPI can be used with Linux on x86 processors. To get your
programs running on Linux:
-
Download the SpinAPI archive for Linux from
http://www.spincore.com/CD/Setup/linux/SpinAPI_linux.tar
and extract it under your home directory.
-
Install libusb v0.1. The source package is available
here.
Under Debian based systems (including Ubuntu) the library can be
installed with the following command:
apt-get install libusb-dev
-
In the spinapi_source/ directory, type "
make".
You may need superuser privilege to run make. This will create a
file called libspinapi.a which you can link your programs against
to use SpinCore hardware. Make sure if the spinapi.h is
copied under /usr/include/ to compile correctly.
-
To compile your program, you must link with both the spinapi and
math libraries. For example, when compiling the "pb24_ex1.c"
example program, you would use a command like (assuming both
libspinapi.a and pb24_ex1.c are in the current directory):
$gcc -opb24_ex1 pb24_ex1.c -L. -lspinapi -lm -lusb
This will create an executable called "pb24_ex1".
-
When running programs, you MUST have superuser privileges (ie be
running as root). This is because the SpinAPI library needs to be
able to gain access to the low-level hardware resources.
|