forked from pure-data/pure-data
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.txt
599 lines (398 loc) · 19.6 KB
/
INSTALL.txt
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# Installing Pure Data
This README file contains info for installing Pure Data from source.
Pd is built on the commandline using traditional Unix-style tools. The source
distribution comes with two build systems:
* autotools: easy to use, many compilation options, recommended for most users
* makefile: smaller & simpler, used for Pd binary downloads
## Requirements
Core build requirements:
* Unix command shell: bash, dash, etc
* C compiler chain: gcc/clang & make
Core runtime requirements:
* Tcl/Tk: Tk wish shell
Optional features:
* autotools: autconf, automake, & libtool (if building with the autotools)
* gettext: build localizations in the po directory
* JACK: audio server support
* FFTW: use the optimized FFTW Fast Fourier Transform library
## Autotools Build (recommended)
Building Pd using the GNU autotools involves the following steps for all
platforms:
1. configure: detect & set library and platform options
2. make: compile Pd, associated tools, and resource files (ie. translations)
3. install: install the Pd binaries and resources onto your system
Overview:
cd path/to/pd
./autogen.sh
./configure
make
Note: Additional platform-specific options and build targets are listed in
following subsections.
Start by opening a commandline shell and navigating to the Pd source directory:
cd path/to/pd
First generate the configure script and various build files by running:
./autogen.sh
Next configure Pd with the default options for your platform:
./configure
You can verify the configuration options that the configure step script prints:
pd 0.47.1 is now configured
Platform: Mac OSX
Debug build: no
Universal build: no
Localizations: no
Source directory: .
Installation prefix: /usr/local
...
audio APIs: PortAudio
midi APIs: PortMidi
If you want to change these options, you can specify/override the configure
script settings on the commandline:
# change install prefix to /usr
./configure --prefix /usr
# build Pd with the JACK audio server backend
./configure --enable-jack
# build Pd using a system installed PortAudio
./configure --without-local-portaudio
If you need to run Pd through a debugger (like gdb), you can
build Pd with debugging symbols using the "--enable-debug" flag.
# build Pd with debugging information
./configure --enable-debug
An important configure option for some platforms is --enable-universal which
allows you to specify the desired architecture(s) when building Pd. For Intel
and AMD processors, 32 bit is called "i386" and 64 bit is "x86_64". By default,
Pd is built for the architecture of the current system, however you may want a
32 bit Pd to work with existing 32 bit externals on a 64 bit system. You can
override the defaults with --enable-universal:
# build 32 bit Pd
./configure --enable-universal=i386
# build 64 bit Pd
./configure --with-universal=x86_64
The full list of available configuration options can printed by running:
./configure --help
Now that Pd is configured, build by running:
make
Building should take a minute or two. If compilation was successful, you can
run Pd from the build directory without installing it:
cd bin
./pd
To install to your system using the configuration prefix (default /usr/local):
sudo make install
You can also to a custom location via:
make install DESTDIR=~/pd-xxx prefix=/
Once installed, you should now be able to run Pd from the commandline:
pd
If want to uninstall, make sure Pd is configured and then run:
sudo make uninstall
If you compiled Pd using the --enable-universal configure option and want to
double check which architectures Pd was built with, use the "file" command:
# examine binary in the src directory
file src/pd
...
src/pd: Mach-O 64-bit executable x86_64
# look at pd inside a macOS .app bundle
file Pd.app/Contents/Resources/bin/pd
...
Pd-0.47.1.app/Contents/Resources/bin/pd: Mach-O 64-bit executable x86_64
### Linux
Platform requirements:
* ALSA: Linux sound library (recommended)
* OSS: historical precursor to ALSA, generally not used
* JACK: JACK audio server (optional)
Install the core build requirements using your distribution's package manager.
For Debian, you can install the compiler chain, autotools, & gettext with:
sudo apt-get install build-essential automake autoconf libtool gettext
For libraries, you will need to install the "development" versions which include
the source code header files. In Debian, the ALSA development package is called
"libasound2-dev":
sudo apt-get install libasound2-dev
Similarly, optional development libraries can be also be installed to for
additional features. Install the JACK development files on Debian:
sudo apt-get install libjack-jackd2-dev
In case you are using jackd1 instead of jackd2, use:
sudo apt-get install libjack-dev
Most distributions come with Tcl/Tk installed, so you should be able to run Pd
after it is built.
Once your build system is set up, you can follow the general autotools build
steps to build Pd.
### macOS
macOS is built on top of a BSD system and the bash commandline can be accessed
with the Terminal application in the /Applications/Utility directory.
The clang compiler and associated tools are provided by Apple. If you are
running macOS 10.9+, you *do not* need to install the full Xcode application and
can install the Commandline Tools Package only by running the following:
xcode-select --install
If you are running macOS 10.6 - 10.8, you will need to install Xcode
from the Mac App Store or downloaded from http://developer.apple.com
Tcl/Tk is already included macOS.
To install the autotools, gettext, and libraries for additional features,
you can use one of the open source package managers for macOS:
* homebrew: https://brew.sh (recommended)
* macports: https://www.macports.org
Follow the package manager set up instructions and then install the software you
need. For example, to install the autotools & gettext using Homebrew:
brew install automake autoconf libtool pkg-config gettext
brew link --force gettext
By default, Pd is built for the current system architecture, usually 64 bit. If
you want to override this you can use the --enable-universal configure option
which allows you to specify the desired architecture(s) when building Pd. For
Intel/AMD processors, 32 bit is called "i386" and 64 bit is "x86_64". For Apple
Silicon processors (M1, M2, etc), the 64 bit architecture is called "arm64". By
default, Pd is built for the architecture of the current system, however you may
want a 32 bit Pd to work with existing 32 bit externals on a 64 bit system. You
can override the defaults with --enable-universal:
you want to override this you can use the --enable-universal configure option,
as mentioned in the main Autotools Build section. On macOS, running this option
without arguments will build a "fat" Pd for all architectures supported by the
compiler:
* macOS 10.6: i386, x86_64, ppc
* macOS 10.7+: i386, x86_64
* macOS 10.15: x86_64
* macOS 11+: x86_64, arm64
Note: a "fat" Pd may not work on all systems and/or be able to load both 32 or
64 bit externals. Additionally, you can specify multiple architectures directly:
# build a "fat" Pd for both 32 and 64 bit Intel
# may not work on all systems
./configure --enable-universal=i386,x86_64
# build a "fat" Pd for all detected architectures (macOS: i386, x86_64, ppc)
# may not work on all systems
./configure --enable-universal
The JACK audio server is supported by Pd on macOS. By default, Pd can use either
the offical 64-bit builds for macOS 10.12+ from https://jackaudio.org or the
older, 32-bit Jack OS X runtime framework if one is installed on the system.
Optionally, Pd can also be built with Jack installed via Homebrew or Macports,
however the runtime framework support must be disabled:
brew install jack
./configure --disable-jack-framework --enable-jack
You should now be ready to build Pd by following the general autotools build
steps. Once built, there are two options for installation:
* build a standalone macOS application (recommended)
* install to your system as a commandline program
To build the Pd macOS application, simply run:
make app
This builds Pd-#.##.#.app in the Pd source directory which can be then be
double-clicked and/or copied to /Applications. For more info & options regarding
the Pd .app bundle, see mac/README.txt
If you want to have both the Pd application *and* use Pd from the commandline,
add command aliases to the binaries inside the .app to your shell environment
~/.zshrc (newer systems with zsh, macOS 10.15+) or ~/.bash_profile (older
systems with bash):
# pd commandline
WHICHPD="Pd-0.47-1"
alias pd="/Applications/$WHICHPD.app/Contents/Resources/bin/pd"
alias pdsend="/Applications/$WHICHPD.app/Contents/Resources/bin/pdsend"
alias pdreceive="/Applications/$WHICHPD.app/Contents/Resources/bin/pdreceive"
Next, reload the shell environment by either opening a new Terminal window or
running:
# zsh (new)
. ~/.zshrc
# bash (old)
source ~/.bash_profile
If you install Pd to your system with "make install", the Tk 8.5.9 currently
included with the system (as of macOS 10.14) is buggy and should *not* be used.
It is recommended to install a newer version, either via Homebrew or from the
ActiveState Tcl/Tk downloads.
To see which version the Pd GUI is using: set the log level to 4 & look for the
Tk version log line in the Pd window.
Another option is to set the Tk Wish command Pd uses to launch the GUI. At
start, Pd does a quick search in the "usual places" for Wish and chooses the
first path that exists. Versions of macOS up to 10.12 also ship with Tcl/Tk 8.4
which works fine and this wish can be invoked by Pd using the full path
"/usr/bin/wish8.4". You can configure Pd to use this search path first with:
./configure --with-wish=/usr/bin/wish8.4
To see Pd's path search info, run Pd with the -verbose flag:
pd -verbose
Note: Pd installed to your system or run from the build/bin directory will not
use the default font and will be missing the various macOS GUI hints (such as
retina rendering) which are specified by the Info.plist file inside the .app
bundle. Again, it is recommended to build a .app and use the aforementioned
aliases to provide the pd command.
### Windows
Pd on Windows can be built with either MinGW or Cygwin which provide the
core build requirements: a compiler chain & shell environment.
It is recommended to use the Msys2 distribution which provides both a Unix
command shell and MinGW. Download the Msys2 "x86_64" 64 bit installer (or "i686"
if you are using 32 bit Windows) from:
http://www.msys2.org/
Then install to the default location (C:\msys32 or C:\msys64) and follow the
setup/update info on the Msys2 webpage.
Msys2 provides both 32 and 64 MinGW and command shells. As of Pd 0.50, the Pd
release is 64 bit for Windows, so it is recommended to set up and use the MinGW
64 bit shell. If you want to build a 32 bit Pd, similarly use the MinGW 32 bit
shell. Due to how MinGW is designed, you cannot build a 64 bit Pd with a 32 bit
MinGW and vice versa. This also means the Pd configure --enable-universal build
option has no effect in MinGW.
Note: Msys2 development seems to change frequently, so some of the package names
below may have changed after this document was written.
Open an Msys2 shell and install the compiler chain, autotools, & gettext via:
# 64 bit
pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang \
make autoconf automake libtool \
mingw-w64-x86_64-gettext
# 32 bit
pacman -S mingw-w64-i686-toolchain mingw-w64-i686-clang \
make autoconf automake libtool \
mingw-w64-i686-gettext
Install git if you want to clone the Pd sources from Github, etc:
pacman -S git
and/or the nsis installer tool if you want to build the Pd Windows installer:
# 64 bit
pacman -S mingw-w64-x86_64-nsis
# 32 bit
pacman -S mingw-w64-i686-nsis
Note: You can also search for packages in Msys2 with:
pacman -S -s <searchterm>
Once the packages are installed, you should now be ready to build Pd by
following the general autotools build steps.
The following audio APIS are available on Windows and can be enabled/disabled
via their configure flags:
* MMIO: --enable-mmio or --disable-mmio (default enabled)
* ASIO: --enable-asio or --disable-asio (default enabled, if found)
* JACK: --enable-jack or --disable-jack
For example, to build Pd without MMIO support:
./configure --disable-mmio
Note: Because of license restrictions, Pd cannot distribute the ASIO SDK source
files. If you want to build Pd with ASIO support, see asio/README.txt for
further instructions.
Once built Pd is built, you can either:
* build a Pd application directory for Windows (recommended)
* build a Windows installer
A Pd application directory is essentially a self-contained Pd package which
should run out of the box. To build, simply use:
make app
This will create a "pd-VERSION" directory (ie. pd-0.48.1) which can then be used
by running pd.exe in the bin directory and placed wherever on your system. For
more info & options regarding the Pd app directory, see msw/README.txt
To build a .msi Windows installer for Pd, see msw/build-nsi.sh.
Note: The standard "make install" requires Tcl/Tk and won't work outside your
Cygwin/Msys2 environment (if at all).
### Cross-compilation for Windows on Linux
You can also build a Windows binary of Pd on a Linux system, using a
cross-compilation toolchain.
For Debian based systems (e.g. Ubuntu), you can install the toolchain with:
sudo apt-get install build-essential automake autoconf libtool gettext
sudo apt-get install mingw-w64 mingw-w64-tools
sudo apt-get install nsis
The "mingw-w64" package will install the cross compilation toolchains for both
32bit (g++-mingw-w64-i686, binutils-mingw-w64-i686) and
64bit (g++-mingw-w64-x86-64, binutils-mingw-w64-x86-64).
The "nsis" package is purely optional, and only needed if you want to build the
installer.
You must tell configure that you want to cross-compile for a given architecture
via the "--host" configure flag.
For example, to build a 32 bit Pd:
./configure --host=i686-w64-mingw32
Similarly, to build a 64 bit Pd without ASIO support:
./configure --disable-asio --host=x86_64-w64-mingw32
If all went well, you should now be ready to build Pd, as explained in the
instructions above in the "Windows" section:
make app
### BSD
Building Pd for the various BSD variants is similar to the Linux way.
The major difference is the used package manager (and the names of the packages),
you'll want to install.
### FreeBSD
(Tested on FreeBSD-13)
Install the core build requirements:
sudo pkg install gcc automake autoconf libtool gettext gmake
You may install one (or more) libraries (depending on your needs).
It seems that with FreeBSD-13, there are ALSA and JACK packages available:
sudo pkg install alsa-lib jackit
Once your build system is set up, you can follow the general autotools build
steps to build Pd, but make sure to use `gmake` (aka "GNU make").
The ordinary BSD `make` will not suffice!
./autogen.sh
./configure --deken-os=FreeBSD MAKE=gmake
gmake
sudo gmake install
### OpenBSD
(Tested on OpenBSD-7)
Install the core build requirements:
sudo pkg_add gcc automake autoconf libtool gettext-tools gmake
(If there are multiple versions for one or more of the packages, pick your favourite or the newest one).
You may install one (or more) libraries (depending on your needs).
It seems that with OpenBSD-7, there are only JACK packages available:
sudo pkg_add jack
By default, OpenBSD installs all its packages into `/usr/local/`,
but the compiler does not look for headers resp. libraries in this directory.
We can instruct autotools to automatically consider these directories
by creating a file '/usr/local/share/config.site':
cat | sudo tee /usr/local/share/config.site>/dev/null << EOF
CPPFLAGS="-I/usr/local/include \$CPPFLAGS"
LDFLAGS="-L/usr/local/lib \$LDFLAGS"
EOF
Also, because OpenBSD allows to coinstall multiple versions of the autotools (with no "default"),
we must specify which version we want to use:
export AUTOCONF_VERSION=$(ls -S /usr/local/bin/autoconf-* | sed -e 's|.*-||' | sort -n | tail -1)
export AUTOMAKE_VERSION=$(ls -S /usr/local/bin/automake-* | sed -e 's|.*-||' | sort -n | tail -1)
Now that your build system is set up, you can follow the general autotools build
steps to build Pd, but make sure to use `gmake` (aka "GNU make").
The ordinary BSD `make` will not suffice!
./autogen.sh
./configure --deken-os=OpenBSD --enable-jack MAKE=gmake
gmake
sudo gmake install
### NetBSD
(Tested on NetBSD-9)
Install the core build requirements:
sudo pkgin install gcc automake autoconf libtool gettext-tools gmake
You may install one (or more) libraries (depending on your needs).
It seems that with NetBSD-9, there are JACK and ALSA packages available,
but the ALSA packages seem to be broken. OSS appears to be built-in.
sudo pkgin install jack
By default, NetBSD installs all its packages into `/usr/pkg/`,
but the compiler does not look for headers resp. libraries in this directory.
We can instruct autotools to automatically consider these directories
by creating a file '/usr/pkg/share/config.site':
cat | sudo tee /usr/pkg/share/config.site>/dev/null << EOF
CPPFLAGS="-I/usr/pkg/include \$CPPFLAGS"
LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib \$LDFLAGS"
EOF
Now that your build system is set up, you can follow the general autotools build
steps to build Pd, but make sure to use `gmake` (aka "GNU make").
The ordinary BSD `make` will not suffice!
./autogen.sh
./configure --deken-os=NetBSD --prefix=/usr/pkg --disable-alsa --enable-jack MAKE=gmake
gmake
sudo gmake install
## Makefile Build
Alternatively, and often more simply, to the autotools build, you can use the
fallback makefiles in the src directory:
* src/makefile.gnu: GNU/Linux
* src/makefile.mac: macOS
* src/makefile.msvc: Windows with Microsoft Visual C
* src/makefile.mingw: Windows with MinGW GCC
On Linux, for example, run the GNU-specific makefile in the src directory:
cd src
make -f makefile.gnu
You can then run directly out of the bin directory without installing:
cd ../bin
./pd
For Microsoft Visual C, first build Pd with the MS VC makefile and then build
each external in the extra directory:
cd src
make -f makefile.msvc
cd ../extra/bob~
make pd_nt
cd ../bonk~ && make pd_nt
cd ../choice && make pd_nt
cd ../fiddle~ && make pd_nt
...
To install Pd to your system on Linux, macOS, & MinGW (Windows), use the
"install" makefile target. For Linux, this is:
make -f makefile.gnu install
Once installed, you should now be able to run Pd from the commandline:
pd
If want to uninstall, simply run the "uninstall" makefile target:
make -f makefile.gnu uninstall
On macOS, you can build a clickable Pd .app bundle using the supplemental build
scripts in the mac directory. See mac/README.txt for more info.
## Reporting Bugs
Let us know if you run into any bugs or issues with building or installing Pd:
* send an email: https://lists.puredata.info/listinfo
* post to the Pd forum: https://forum.pdpatchrepo.info
* create a bugreport: https://bugs.puredata.info
* open an issue: https://github.com/pure-data/pure-data/issues
Please include information involved with your problem such as:
* information about your system: OS version, libraries installed, etc
* configure or make output including error lines
* steps you took: configuration options, etc