Skip to content
This repository was archived by the owner on Nov 18, 2023. It is now read-only.

Compilation

residuum edited this page Oct 26, 2012 · 48 revisions

Compilation instructions

Compilation should be working on Linux, Windows with MinGW and Mac OS X. You will need header files of Puredata, as well as libcurl, json-c, and liboauth.

The package uses the Pd library template.

Linux

You need build-essentials, header files for puredata, libjson0, libcurl4, liboauth. If you have Debian or a derivative (e.g. Ubuntu, Linux Mint), you can install the build utils and needed headers with apt-get install build-essentials puredata-dev libjson0-dev libcurl4-openssl-dev liboauth-dev. If you are not root, prefix the command with sudo.

Drop the sources in a directory and run make. You will get files with a suffix of pd_linux for each object (json-decode.pd_linux, json-encode.pd_linux, rest-json.pd_linux) and a shared file libpurest_json.so. These are needed to use the library.

Building a deb package (Optional for Debian Based Distributions)

Install the package devscript with apt-get install devscript.

Remove the file embed-MacOSX-dependencies.sh.

Run make dpkg-deb, you will get a deb file in the parent folder. Install this file with dpkg -i pd-purest-json_0.7.1_i386.deb (or whatever your file is called).

Windows with MinGW

You need to install MinGW on your computer. Follow the instructions on http://puredata.info/docs/developer/WindowsMinGW leaving out Cygwin. If you do not plan to compile Pd-extended, you may stop after following the instructions for "MinGW extras".

Install the additional packages:

Extract the latter zip files and put the contents in the correct MinGW folders.

If you encounter an error with two definition of boolean, delete the line typedef int boolean; from the file %MinGW%/include/json/json_object.h.

Navigate to the folder of purest_json in MinGW Shell and run make. You will get four dll files (json-decode.dll, json-encode.dll, rest-json.dll, libpurest_json.dll).

To use the library, you will also need the dll from the libcurl download, and rename libcurl.dll to libcurl-4.dll. This will not run on current releases (Pd-extended 0.42 or Pd vanilla 0.43), only on Pd-extended 0.43 auto-builds.

Compilation on Mac OS X

I do not have a Mac available, but you will need to install json-c and libcurl4-ssl (TODO: development versions of these packages as well? Have not found liboauth.) via Fink.

You will need to set up part of the Pd build environment on your computer

Run make in the purest_json folder.

If the build succeeded, run ./embed-MacOSX-dependencies.sh to embed the dependencies in the shared library.

Cross-compilation for Windows on Linux with MXE

Working on it.

Clone this wiki locally