Difference between revisions of "Mac OS X"

From sigrok
Jump to navigation Jump to search
(34 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[File:sigrok macosx.png|right|thumb|320px|sigrok-gui on Mac OS X]]
This page describes how to build the sigrok subprojects on Mac OS X.


This page describes how to build sigrok on Mac OS X.
== Building using a script under Homebrew ==


== How to build and run the Qt GUI ==
This is the recommended way of building sigrok from sources on MacOS at the moment. (and yes it is homebrew only)


These instructions have been tested on a clean Mac OS X 10.6.8 install.
Install build dependencies:


Step 1. Install MacPorts, follow the guide on [http://www.macports.org/install.php macports.org] (this step will require Xcode on your machine, which is also a dependency to build sigrok).
<small>
$ '''brew install libzip libftdi libusb libtool glibmm doxygen autoconf-archive sdcc python3 boost qt pkg-config cmake glib autoconf automake'''
</small>


Step 2. Install Qt, download qt-mac-opensource-4.7.4.dmg from [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x qt.nokia.com].
Clone sigrok-util:


Step 3. Install git.
<small>
$ '''git clone git://sigrok.org/sigrok-util'''
$ '''cd sigrok-util/cross-compile/macosx'''
$ '''./sigrok-native-macosx'''
</small>
 
This tool will download all the code, compile and install it in your home directory in '''sr_macosx''' directory. To use the tools you need to export the additional path.
 
<small>
$ '''export PATH=$HOME/sr_macosx/bin:$PATH'''
</small>
 
You should be now able to access all the bleeding cutting edge sigrok tools from the command line. :)
 
== Building using Homebrew ==
 
These instructions have been tested on Mac OS X 10.9.1.
 
=== Requirements ===
 
Install [http://brew.sh Homebrew].
 
Tap sigrok:
 
<small>
$ '''brew tap rene-dev/sigrok'''
</small>
 
If you want [[PulseView]], you must install unstable.
 
=== Unstable ===
 
<small>
$ '''brew install python3'''
$ '''brew install --HEAD libserialport'''
$ '''brew install --HEAD --with-libserialport libsigrok'''
$ '''brew install --HEAD libsigrokdecode'''
$ '''brew install --HEAD --with-libserialport sigrok-cli'''
$ '''brew install --HEAD pulseview'''
</small>
 
=== Stable ===
 
If you just want [[sigrok-cli]], you can install stable.
 
<small>
$ '''brew install sigrok-cli'''
</small>
 
== Building manually ==
 
These instructions have been tested on a clean install of Mac OS X 10.6.8, 10.8.4, 10.9.1 and 10.11.1.
 
=== Requirements ===
 
Install MacPorts, follow the guide on [http://www.macports.org/install.php macports.org] (this step will require Xcode and Command Line Tools for Xcode be installed on your machine, which are also a dependencies to build sigrok).
 
Install Qt, download qt-mac-opensource-4.7.4.dmg from [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x qt.nokia.com] (Only needed for [[PulseView]]).
 
Install git (not needed at least with 10.8.4):
 
<small>
  $ '''sudo port install git-core'''
  $ '''sudo port install git-core'''
</small>
This will also pull in a bunch of dependencies required by git-core (and some of them also by sigrok).  
This will also pull in a bunch of dependencies required by git-core (and some of them also by sigrok).  


Step 4. Install libusb, libzip and libftdi, the sigrok build dependencies.
Install boost, libusb, libzip and libftdi, the libsigrok build dependencies:
  $ '''sudo port install libusb'''
 
  $ '''sudo port install libzip'''
<small>
$ '''sudo port install libftdi'''
  $ '''sudo port install boost libusb libzip libftdi0'''
</small>
 
Install autoconf, automake, cmake, glib2.0+, python 3.3, libtool and pkgconfig to satisfy version dependencies in the build process.
 
<small>
  $ '''sudo port install autoconf automake cmake glib2 python33 libtool pkgconfig'''
</small>
 
Set the PKG_CONFIG_PATH environment variable to reflect the future locations of libsigrok and libsigrokdecode for the sigrok-cli build process.


Step 5. Enter some directory where you want to store the sigrok source, and check it out.
<small>
  $ '''cd some-directory'''
  $ '''export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/'''
$ '''git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok'''
</small>


Step 6. Enter the sigrok source directory.
=== libserialport ===
$ '''cd sigrok'''


Step 7. Generate the platform specific configure script.
[[libserialport]] is optional and required only for devices with serial connection, e.g. most multimeters. If not present during configuring libsigrok, the respective drivers in libsigrok will be disabled.
 
<small>
$ '''git clone git://sigrok.org/libserialport'''
$ '''cd libserialport'''
  $ '''./autogen.sh'''
  $ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>
=== libsigrok ===


Step 8. Generate the Makefiles for the current environment.
<small>
$ '''git clone git://sigrok.org/libsigrok'''
$ '''cd libsigrok'''
$ '''./autogen.sh'''
  $ '''./configure'''
  $ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>


Step 9. Compile the sigrok libraries and the sigrok-cli command-line tool.
=== libsigrokdecode ===
 
<small>
$ '''git clone git://sigrok.org/libsigrokdecode'''
$ '''cd libsigrokdecode'''
$ '''./autogen.sh'''
$ '''./configure'''
  $ '''make'''
  $ '''make'''
$ '''sudo make install'''
</small>


Step 10. Install sigrok libraries and sigrok-cli to /usr/local/lib/ and /usr/local/bin/.
=== sigrok-cli ===
 
<small>
$ '''git clone git://sigrok.org/sigrok-cli'''
$ '''cd sigrok-cli'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
</small>


Step 11. Enter the gui directory.
=== PulseView ===
$ '''cd gui'''


Step 12. Prepare the Qt project to be built using make.
  $ '''git clone git://sigrok.org/pulseview'''
  $ '''PKG_CONFIG_PATH=/usr/local/lib/pkgconfig qmake -spec macx-g++'''
$ '''cd pulseview'''
 
$ '''cmake .'''
Step 13. Compile the sigrok-gui application.
  $ '''make'''
  $ '''make'''
$ '''sudo make install'''


Step 14. Open the sigrok-gui application just built.
Hint: if something goes wrong, you can see what cmake is doing by running
  $ '''open -a sigrok-gui.app'''
  $ '''cmake VERBOSE=1'''


== Notes ==
== Notes ==


To build on Snow Leopard (10.6) you need to use the [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x Cocoa (32bit and 64bit) Qt libraries]. Don't use the default download link on that page but the one you can find further down the page.
* To build on Snow Leopard (10.6) you need to use the [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x Cocoa (32bit and 64bit) Qt libraries]. Don't use the default download link on that page but the one you can find further down the page.
 
* Currently we are using [http://www.macports.org/ macports] for the libusb dependency and are relying on the fact that macports are installed in /opt/local.
Currently we are using [http://www.macports.org/ macports] for the libusb dependency and are relying on the fact that macports are installed in /opt/local.
** Python framework incorrect build for OS X [http://bugs.python.org/issue15353 issue 15353]


== TODO ==
== TODO ==
Line 61: Line 165:
* Find a sane way to bundle libusb with the sigrok.app.
* Find a sane way to bundle libusb with the sigrok.app.
* Include an icon with the app.
* Include an icon with the app.
* [[Mac OS X/Dylib|Set the relative paths in the binary's and DyLibs]]
* [[Mac OS X/Dylib|Set the relative paths in the binary's and DyLibs]].
* [[Mac OS X/Universal| Building universal DyLibs and binaries]]
* [[Mac OS X/Universal|Building universal DyLibs and binaries]].
* Bundle the dynamic libraries with [http://macdylibbundler.sourceforge.net MacDylibBundler]
* Bundle the dynamic libraries with [http://macdylibbundler.sourceforge.net MacDylibBundler].


== Resources ==
== Resources ==
Line 71: Line 175:
* [http://cairographics.org/end_to_end_build_for_mac_os_x CairoGraphics - End to End build for Mac OS X]
* [http://cairographics.org/end_to_end_build_for_mac_os_x CairoGraphics - End to End build for Mac OS X]
* [http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Documentation about bundles]
* [http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Documentation about bundles]
* [http://stackoverflow.com/questions/1596945/building-osx-app-bundle Stackoverflow - Building OSX App Bundle]

Revision as of 21:12, 19 February 2017

This page describes how to build the sigrok subprojects on Mac OS X.

Building using a script under Homebrew

This is the recommended way of building sigrok from sources on MacOS at the moment. (and yes it is homebrew only)

Install build dependencies:

$ brew install libzip libftdi libusb libtool glibmm doxygen autoconf-archive sdcc python3 boost qt pkg-config cmake glib autoconf automake

Clone sigrok-util:

$ git clone git://sigrok.org/sigrok-util
$ cd sigrok-util/cross-compile/macosx
$ ./sigrok-native-macosx

This tool will download all the code, compile and install it in your home directory in sr_macosx directory. To use the tools you need to export the additional path.

$ export PATH=$HOME/sr_macosx/bin:$PATH

You should be now able to access all the bleeding cutting edge sigrok tools from the command line. :)

Building using Homebrew

These instructions have been tested on Mac OS X 10.9.1.

Requirements

Install Homebrew.

Tap sigrok:

$ brew tap rene-dev/sigrok

If you want PulseView, you must install unstable.

Unstable

$ brew install python3
$ brew install --HEAD libserialport
$ brew install --HEAD --with-libserialport libsigrok
$ brew install --HEAD libsigrokdecode
$ brew install --HEAD --with-libserialport sigrok-cli
$ brew install --HEAD pulseview

Stable

If you just want sigrok-cli, you can install stable.

$ brew install sigrok-cli

Building manually

These instructions have been tested on a clean install of Mac OS X 10.6.8, 10.8.4, 10.9.1 and 10.11.1.

Requirements

Install MacPorts, follow the guide on macports.org (this step will require Xcode and Command Line Tools for Xcode be installed on your machine, which are also a dependencies to build sigrok).

Install Qt, download qt-mac-opensource-4.7.4.dmg from qt.nokia.com (Only needed for PulseView).

Install git (not needed at least with 10.8.4):

$ sudo port install git-core

This will also pull in a bunch of dependencies required by git-core (and some of them also by sigrok).

Install boost, libusb, libzip and libftdi, the libsigrok build dependencies:

$ sudo port install boost libusb libzip libftdi0

Install autoconf, automake, cmake, glib2.0+, python 3.3, libtool and pkgconfig to satisfy version dependencies in the build process.

$ sudo port install autoconf automake cmake glib2 python33 libtool pkgconfig

Set the PKG_CONFIG_PATH environment variable to reflect the future locations of libsigrok and libsigrokdecode for the sigrok-cli build process.

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

libserialport

libserialport is optional and required only for devices with serial connection, e.g. most multimeters. If not present during configuring libsigrok, the respective drivers in libsigrok will be disabled.

$ git clone git://sigrok.org/libserialport
$ cd libserialport
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

libsigrok

$ git clone git://sigrok.org/libsigrok
$ cd libsigrok
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

libsigrokdecode

$ git clone git://sigrok.org/libsigrokdecode
$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

sigrok-cli

$ git clone git://sigrok.org/sigrok-cli
$ cd sigrok-cli
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

PulseView

$ git clone git://sigrok.org/pulseview
$ cd pulseview
$ cmake .
$ make
$ sudo make install

Hint: if something goes wrong, you can see what cmake is doing by running

$ cmake VERBOSE=1

Notes

  • To build on Snow Leopard (10.6) you need to use the Cocoa (32bit and 64bit) Qt libraries. Don't use the default download link on that page but the one you can find further down the page.
  • Currently we are using macports for the libusb dependency and are relying on the fact that macports are installed in /opt/local.

TODO

Resources