1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

doc: update README

This commit is contained in:
Tom Collins
2020-06-26 16:30:50 -07:00
committed by Gerry Stellenberg
parent ed6540858b
commit 7c202fc2f4

View File

@@ -8,21 +8,13 @@ Library for [Multimorphic, Inc.'s](https://www.multimorphic.com/) P-ROC and P3-R
libpinproc requires: libpinproc requires:
- [libusb-0.1.12](http://libusb.wiki.sourceforge.net/): Install with the default /usr/local prefix. Version 0.1.12 has been tested on Mac and Linux. Mac users: If you want to use libpinproc under Cocoa or pygame, you may wish to try libusb 1.0. See below. - [libusb](https://github.com/libusb/libusb): Install with the default /usr/local prefix. Current builds of libftdi and libpinproc use libusb-1.0.
- [libftdi-0.16](http://www.intra2net.com/en/developer/libftdi/): Install with the default /usr/local prefix. - [libftdi](https://www.intra2net.com/en/developer/libftdi/): Install with the default /usr/local prefix.
##### libusb-1.0 and libusb-compat #### Building with CMake (Linux and macOS)
Version 1.0.2 does not work out of the box since libftdi is written against libusb-0.1. You can use the libusb-compat-0.1.2 project, however, which creates a library that provides the older libusb interface. Because Macs do not come with pkg-config, you may need to run configure for libusb-compat as follows: Download and install [CMake](https://cmake.org/download/). Then:
./configure LIBUSB_1_0_CFLAGS=-I/usr/local/include/libusb-1.0 LIBUSB_1_0_LIBS="-L/usr/local/lib -lusb-1.0"
Note that libusb-1.0 must have been built and installed prior to this step. This also assumes that you installed libusb-1.0 with the default /usr/local prefix.
#### Building with CMake
Download and install [CMake](http://www.cmake.org/cmake/resources/software.html). Then:
cd libpinproc cd libpinproc
mkdir bin; cd bin mkdir bin; cd bin
@@ -33,45 +25,59 @@ The CMakeLists.txt file is presently designed to be run from a directory inside
Note: On some systems, it may be necessary to build libpinproc with the '-fPIC' option. To do this with cmake, instead of running 'cmake ..', run 'cmake .. -DCMAKE_CXX_FLAGS="-fPIC"'. Compiling without '-fPIC' may cause problems when building the Python extensions on some 64-bit Linux machines. Note: On some systems, it may be necessary to build libpinproc with the '-fPIC' option. To do this with cmake, instead of running 'cmake ..', run 'cmake .. -DCMAKE_CXX_FLAGS="-fPIC"'. Compiling without '-fPIC' may cause problems when building the Python extensions on some 64-bit Linux machines.
Mac users may need to install [D2xxHelper](http://www.ftdichip.com/Drivers/D2XX.htm) to keep the Mac from claiming the P-ROC/P3-ROC and creating a `/dev/tty.usbserial` device for it. It may be necessary to install a second time, if you're asked to allowing the installation via the Security & Privacy System Preference. You will also need to reboot after installing D2xxHelper. Run a `ls /dev/tty.usbserial*` before and after connecting the P-ROC/P3-ROC. If you see a new entry, libpinproc will not be able to connect.
#### Building in Windows with MinGW/CMake #### Building in Windows with MinGW/CMake
(Note that these instructions are outdated with the advent of of MSYS2/MinGW64. Recent attempts at building with these instructions result in builds with dependencies on DLLs from MinGW64. For users with MSYS/MinGW32 installations they should still be valid.)
Download and unzip [ftd2xx for Windows zip file](http://www.ftdichip.com/Drivers/D2XX.htm). Plug in a powered-up P-ROC and point the driver install wizard to the unzipped driver. Note, this is a two-step process. It will ask you to install a driver twice (once for USB and again for the FTDI specific stuff). Download and unzip [ftd2xx for Windows zip file](http://www.ftdichip.com/Drivers/D2XX.htm). Plug in a powered-up P-ROC and point the driver install wizard to the unzipped driver. Note, this is a two-step process. It will ask you to install a driver twice (once for USB and again for the FTDI specific stuff).
Download and install [CMake](http://www.cmake.org/cmake/resources/software.html). Download and install [CMake](https://cmake.org/download/).
Download and install [MinGW](http://sourceforge.net/projects/mingw/files/). (Tested with MinGW 5.1.4) Download and install [MinGW](http://sourceforge.net/projects/mingw/files/). (Tested with MinGW 5.1.4)
Follow directions above for building yaml-cpp with the following exception: Follow directions above for Building with CMake with the following exception:
add '-G "MinGW Makefiles"' to the cmake command line. - Add `-G "MinGW Makefiles"` to the cmake command line.
- Use `-DEXTRA_INC="<path>"` and `-DEXTRA_LINK="<path>"` to add include/library paths for `ftd2xx.h` and `ftd2xx.sys`.
- Use mingw32-make instead of make.
To build libpinproc: #### Building in Windows with CMake and Visual Studio 2019
- Use -DEXTRA_INC="<path>;<path>" and -DEXTRA_LINK="<path>;<path>" to add include/library paths for `ftd2xx.h` and `ftd2xx.sys`. Follow directions above for Building with CMake with the following exception:
- Add `-A Win32` to the cmake command line.
- Use `-DEXTRA_INC="<path>"` and `-DEXTRA_LINK="<path>"` to add include/library paths for `ftd2xx.h` and `ftd2xx.sys`.
- Open PINPROC.sln in Visual Studio, switch to the Debug or Release configuration and perform ALL_BUILD. It will place the libary and sample programs in `build/Debug` and `build/Release`.
Follow instructions above for building libpinproc with cmake with the following exceptions: Example:
add '-G "MinGW Makefiles' to the cmake command line,
use mingw32-make instead of make
#### Building in Windows with Visual Studio 2019
Assumes you are already running an MSYS2/MinGW64 system.
Make sure you have cmake installed for i686 (MinGW32) or x86_64 (MinGW64): `pacman -S cmake mingw-w64-i686-cmake mingw-w64-x86_64-cmake`
cd libpinproc cd libpinproc
mkdir build; cd build mkdir bin; cd bin
cmake .. -A Win32 cmake .. -A Win32
# configure paths for ftd2xxx; use `cmake .. -L` to list configured options # configure paths for ftd2xxx; use `cmake .. -L` to list configured options
cmake .. -D EXTRA_INC="../ftd2xx" cmake .. -D EXTRA_INC="../ftd2xx"
cmake .. -D EXTRA_LINK="../ftd2xx/i386" cmake .. -D EXTRA_LINK="../ftd2xx/i386"
# Can now open PINPROC.sln in Visual Studio and build Debug and Release targets.
Then open PINPROC.sln in Visual Studio, switch to the Debug or Release configuration and perform ALL_BUILD. It will place the libary and sample programs in `build/Debug` and `build/Release`. ### Testing
Once built, run the `pinproctest` program with the appropriate "machine type" passed in (e.g., "wpc"). Run `pinproctest` without any parameters for a list of valid types.
### License ### License
Copyright (c) 2009 Gerry Stellenberg, Adam Preble Copyright (c) 2009 Gerry Stellenberg, Adam Preble
Copyright (c) 2020 Multimorphic, Inc. Copyright (c) 2020 Multimorphic, Inc.
Contributors:
- Adam Preble
- Gerry Stellenberg
- Jan Kantert
- Jimmy Lipham
- Koen Heltzel
- Roy Eltham
- Tom Collins
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without files (the "Software"), to deal in the Software without