Method to compile Pure Data and libraries on MacOS

On MacOSX 10.13.

Documentation
http://msp.ucsd.edu/Pd_documentation/x6.htm#s6.4


Preliminary:

Homebrew install
https://brew.sh


GNU C compiler (gcc) install
Terminal:
Update brew:
pc36:~ g$ brew update
...
pc36:~ g$ brew upgrade
...
Install gcc:
pc36:~ g$ brew info gcc
...
pc36:~ g$ brew install gcc
...
pc36:~ g$ brew cleanup
...


Create a "FolderPd" folder on the desktop of the Mac
-> /Users/g/Desktop/FolderPd/


Compile the percolate library

The source code:
https://sourceforge.net/projects/fork-percolate/  (1 2020)
PeRColate is an open-source distribution of a variety of synthesis and signal processing algorithms...

Method written in March 2021.
Pd-0.48-1-i386 is installed in the Mac
pd-lib-builder by Katja Vetter is used and included in the source code.
See:
https://forum.pdpatchrepo.info/topic/12428/64-bit-build-of-percolate-library

Download source code of percolate library:
https://sourceforge.net/projects/fork-percolate/ 
    -> PeRColate4PD.tar.gz
        -> PeRColate4PD
Place the PeRColate4PD folder in FolderPd:
   -> /Users/g/Desktop/FolderPd/PeRColate4PD/

Build percolate library
Terminal:
pc36:~ g$ cd /Users/g/Desktop/FolderPd/PeRColate4PD
pc36:PeRColate4PD g$ make arch="i386 x86_64"
++++ info: using Makefile.pdlibbuilder version 0.6.0
++++ info: using Pd API /Applications/Pd-0.48-1-i386.app/Contents/Resources/src/m_pd.h
++++ info: making target all in lib percolate
++++ info: making src/absmax~.o in lib percolate
...
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
++++info: target all in lib percolate completed

percolate.pd_darwin is built:
/Users/g/Desktop/FolderPd/PeRColate4PD/percolate.pd_darwin
It is a "fat" version: 32bit & 64bit.

pc36:PeRColate4PD g$ lipo -info percolate.pd_darwin
Architectures in the fat file: percolate.pd_darwin are: i386 x86_64  

Variations by changing the line: make arch="i386 x86_64"
make arch="i386"   builds a 32bit library.
make arch="x86_64"   builds a 64bit library.
make arch="ppc"   builds a PowerPC library.

In the percolate library, the 9 objects "PhiSM models": bamboo~, cabasa~, guiro~, metashake~, sekere~, shaker~, sleigh~, tamb~, wuter~ do not work. And the munger~ object do not work.
The others are working.

percolate.pd_darwin "fat" (32bit & 64bit):
PercolateMacOS.zip
PeRColate: written for Max/MSP by Dan Trueman and R. Luke DuBois
PeRColate: ported to PD by Olaf Matthes <olaf.matthes@gmx.de>
PeRColate: adapted to Linux by Maurizio Umberto Puxeddu <umbpux@tin.it>
PeRColate: help files ported by Martin Dupras <martin.dupras@uwe.ac.uk>
PeRColate: version: 0.09
PeRColate: compiled: Mar 26 2021, 15:53:12
PeRColate: home: http://www.akustische-kunst.org/puredata/percolate/

A use of the percolate library:
https://github.com/gerardparesys/ARGOPd/. ./ExMM217-FilterBank



Compile the neuralnet library

The source code:
https://github.com/alexdrymonitis/neuralnet  (6 2022)
"An Artificial Neural Network framework for Pure Data" by Alexandros Drymonitis ...

Method written in july 2022.
pd-lib-builder by Katja Vetter is used but not included in the source code.

Download source code of neuralnet library:
https://github.com/alexdrymonitis/neuralnet 
    -> neuralnet-main.zip
        -> neuralnet-main
Place the neuralnet-main folder in FolderPd:
   -> /Users/g/Desktop/FolderPd/neuralnet-main/

Download pd-lib-builder:
https://github.com/pure-data/pd-lib-builder 
    -> pd-lib-builder-master.zip
        -> pd-lib-builder-master
            -> rename -> pd-lib-builder
Place the pd-lib-builder folder in FolderPd:
   -> /Users/g/Desktop/FolderPd/pd-lib-builder

Build neuralnet library
Terminal:
pc22:~ g$ cd /Users/g/Desktop/FolderPd/neuralnet-main
pc22:neuralnet-main g$ make arch="i386 x86_64"
++++ info: using Makefile.pdlibbuilder version 0.6.0
++++ info: using Pd API /Applications/Pd-0.49-1-i386.app/Contents/Resources/src/m_pd.h
++++ info: making target all in lib neuralnet
++++ info: evaluating implicit prerequisites in lib neuralnet.....
++++ info: linking objects in neuralnet.pd_darwin for lib neuralnet
cc -undefined suppress -flat_namespace -bundle  -arch i386 -arch x86_64 -mmacosx-version-min=10.6  -o neuralnet.pd_darwin neuralnet.o  -lc  
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
++++info: target all in lib neuralnet completed

neuralnet.pd_darwin is built:
/Users/g/Desktop/FolderPd/neuralnet-main/neuralnet.pd_darwin
It is a "fat" version: 32bit & 64bit.

pc22:neuralnet-main g$ lipo -info neuralnet.pd_darwin
Architectures in the fat file: neuralnet.pd_darwin are: i386 x86_64  


Compile Pure Data

The source code:
https://msp.puredata.info/Software/pd-0.52-2.src.tar.gz  (3 2022)
from:
http://puredata.info/downloads/pure-data
Get Pure Data for All platforms (Source code) (9.0MB)

Method written in july 2022.
See:
https://github.com/pure-data/pure-data/blob/master/INSTALL.txt
http://msp.ucsd.edu/Pd_documentation/x6.htm


Download source code
pd-0.52-2.src.tar.gz
    -> folder pd-0.52-2 
Place the pd-0.52-2 folder in FolderPd:
   -> /Users/g/Desktop/FolderPd/pd-0.52-2/

Install the tools:
Terminal:
MBP-de-g:~ g$ brew install automake autoconf libtool pkg-config gettext
...
and compile:
MBP-de-g:~ g$ cd /Users/g/Desktop/FolderPd/pd-0.52-2
MBP-de-g:pd-0.52-2 g$ sh ./autogen.sh
...
MBP-de-g:pd-0.52-2 g$ ./configure CFLAGS=""
...
    pd 0.52.2 is now configured
    Platform:             Mac OSX
    Debug build:          no
    Universal build:      no
    Localizations:        yes
    Source directory:     .
    Installation prefix:  /usr/local
...
    audio APIs:           PortAudio
    midi APIs:            PortMidi
...
MBP-de-g:pd-0.52-2 g$ make CFLAGS=""
...
MBP-de-g:pd-0.52-2 g$ cd mac
MBP-de-g:mac g$ sh tcltk-wish.sh
Usage: tcltk-wish.sh [OPTIONS] VERSION
MBP-de-g:mac g$ sh osx-app.sh  

The application:
FolderPd/pd-0.52-2/mac/Pd.app
is created.


Links:
http://puredata.info
https://github.com/pure-data/externals-howto
http://msp.ucsd.edu/Pd_documentation/x6-a.htm
[PD] Hints On How To Compile For Mac PPC On An Intel 


Paresys Accueil 21 2 2023    Valid HTML 4.01 Transitional Paresys Home