Next Entry | Previous Entry

HOWTO: Run PD Patches From Ubuntu-Server

11.02.06
This a HOWTO on running Pure-Data (pd) patches from a base install of a Ubuntu-Server (LAMP - Linux, Apache, MySql, Php)

This is a follow-up tutorial on "Setting Up a Home Ubuntu LAMP Server" which is located HERE.




With this tutorial I will set up a "netpd" server using the provided patch from netpd.org using the netpd-server.pd patch.

First I need to get PD (pure-data) running on my ubuntu server. This is the easy part!

First I have to add 'universe' to my ubuntu repositories so that ubuntu knows where to look when i do 'apt-get'. So I first have to edit my 'sources.list" file:

$ sudo pico /etc/apt/sources.list

In this file I either add the following line of uncomment the lines:

deb http://us.archive.ubuntu.com/ubuntu dapper universe
deb-src http://us.archive.ubuntu.com/ubuntu dapper universe

I can also add the 'multiverse' repositories while I am at it:

deb http://archive.ubuntu.com/ubuntu dapper multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper multiverse

NOW I can update my repository/package list:

$ sudo apt-get update

Now I can install PD. First I will build my dependencies. This makes sure that all the libraries are installed that PD relies on before i install PD.

$ sudo apt-get build-dep puredata

You will then be prompted to install some libs. Just say "Y" and they should automatically install. NOW to install PD:

$ sudo apt-get install puredata

That should work fine! Puredata is installed at /usr/lib/pd and your binaries are at /usr/bin
Now you can update teh database so you can search for your files if you want:

$ sudo updatedb
$ locate pdsend (for example)

and you will see something like this maybe:

/usr/bin/pdsend
/usr/share/man/man1/pdsend.1.gz

OK. Now that you know pd is installed you can give is a try:

$ pd

You will probably get something like this:

Application initialization failed: no display name and no $DISPLAY environment variable

And when you exit (ctrl-c) you will get something like this:

Pd: signal 2

This is fine. We at least now know that it is installed. The reason we get a "failed" error is because 'ubuntu-server' does not have a GUI so next time we start PD we must use a GUI suppression flag like so:

$ pd -nogui

Thant should work! NOW, the patch I am going to run needs two extra libraries - zexy and maxlib. Zexy is easy. It already is part of the 'universe' repository so:

$ sudo apt-get install pd-zexy

We will now check to see it load with the '-nogui' flag and the load library flag '-lib zexy':

$ pd -nogui -lib zexy

AND we should see:

????????????????????????????
? the zexy external 2.1 ?
? (l) forum::f?r::uml?ute ?
? compiled: Oct 26 2005 ?
? send me a 'help' message ?
????????????????????????????

Cool! NOW a tricky part! Getting the 'maxlib' to load. First I want to say that nobody's taught me how to do any of this, I taught myself! So some steps might be different to take for some people than others. To get the 'maxlibs' working I did this a little different than someone else might so I will just write how I did it and let the reader decide how one could do it better.

As far as I know the 'maxlibs" have not been kept up to date (I think the last changes were in 2003-2004). For my patch I need the objects 'nerserver' and 'netclient' so I really need to figure out how to install 'maxlib'. Since the repository lacks this library I can't install it the same way as I installed 'zexy' for instance. So I have to get the source for 'maxlib' and compile it myself:

First I will start by 'cd'ing to my home directory:

$ cd ~

Now I need to check out the pd 'externals' from the CVS repository (basically all the source code to all the externals). So if you do not have CVS program installed:

$ sudo apt-get install cvs

Then:

$ cvs -d:pserver:anonymous@pure-data.cvs.sourceforge.net:/cvsroot/pure-data/ login

Hit return when you are asked for a password. Then, to get the source:

$ cvs -z3 -d:pserver:anonymous@pure-data.cvs.sourceforge.net:/cvsroot/pure-data/ co externals

This will give you a local copy of the externals-directory in the repository. If you 'cd' into the directory (cd externals) and type the command 'dir' you will see the 'maxlib' directory. cd into this directory:

$ cd maxlib

Once you are here to have to alter your makefile. All this means is that you have to chhange some stuff that that when you compile the file will compile correctly. SO:

$ pico makefile

Scroll way way down until you get to the section 'Linux i386'. Here you will see a line '# where is your m_pd.h ???". You need to change this to point to your file 'm_pd.h". For me this file is in my externals directory that I just downloaded in my home directory. So I change/add the line:

LINUXINCLUDE = -I/home/mark/externals/build/include -I./include

I guess you would replace "mark" with whatever you login name is etc.

NOW scroll all the way to the bottom of the 'makefile'. You will then see a line that starts with 'PDDIR'. Change this to your pd dir:

PDDIR=/usr/lib/pd

AND hit 'ctr-o' to save file and 'ctr-x' to exit pico. You 'makefile' has bee altered!! No to compile:

$ sudo make pd_linux
$ sudoo make install

NOW I thought that this would install it to the right directory automatically because I changes the makefile to point to my pd directory. Unfortunately when I cd too my pd directory it is not there.... weird. So in my externals/maxlib directory I notice that the file that 'make pd_linux' created was called "maxlib.pd_linux". OK this is what I need in my pd/extras directory. So on my g4 Mac I have a program I use called Transmit that is basically a ssh (secure shell) client with a nice GUI. Instead of using the 'terminal' to copy (cp) the file over to the pd/extras directory I get a little lazy because my eyes are starting to get sore.

So I just log in to my server with Transmit. Drag the 'maxlib.pd_linux' file to the desktop of my g4, navigate to the pd/extras directory and 'drag&drop' the file into it. Done! 'maxlib' is on my ubuntu system!

Now back in terminal i give it a try:

$ pd -nogui -lib zexy -lib maxlib

????????????????????????????
? the zexy external 2.1 ?
? (l) forum::f?r::uml?ute ?
? compiled: Oct 26 2005 ?
? send me a 'help' message ?
????????????????????????????


maxlib :: Music Analysis eXtensions LIBrary
written by Olaf Matthes
version 1.5.2
compiled Oct 29 2006
latest version at http://www.akustische-kunst.org/puredata/maxlib/
objects: allow arbran arraycopy average beat beta bilex borax cauchy
chord delta deny dist divide divmod edge expo fifo gauss
gestalt history ignore iso lifo linear listfifo listfunnel
match minus mlife multi nchange netclient netdist netrec
netserver nroute pitch plus poisson pong pulse remote rewrap
rhythm scale score speedlim split step subst sync temperature
tilt timebang triang unroute urn velocity weibull wrap

priority 8 scheduling enabled.
priority 6 scheduling enabled.

GREAT! It loaded! Now to upload my patch and write a startup script. So back in 'Transmit' I 'drag&drop' my 'netpd_server.pd' patch in my home folder (~/home/mark). Now a write a startup script with my flags in it. SO:

$ pico netpd_boot.sh

This will open a new document. In this document add the following line

pd -nogui -noaudio -lib zexy -lib maxlib -open netpd_server.pd

Save the file by hitting 'ctr-o' and quit pico with 'ctr-x'. Now if you do a 'dir' command you should see the new file! To try it out type:

$ sh netpd_boot.sh

EVERYTHING SHOULD WORK!!! Now you can try to login with your 'netpd' program to your new server!

NEXT: We will write a 'boot-up' script so that your 'netpd_boot.sh" script boots with your system!



seven comments

hi,
i just went through the tutorial and had some error messages first while trying to do $ sudo make install. if anyone has problems, too check your makefile again and search for the string (at the bottom of the makefile):

cp help/help-*.pd $(PDDIR)/doc/5.reference/maxlib

and replace it with:

cp help/*-help.pd $(PDDIR)/doc/5.reference/maxlib

then it worked perfectly. and since i don’t have a mac to connect to my linuxbox and to move files there i just did

sudo cp ~/externals/maxlib/maxlib.pd_linux /usr/lib/pd/extra/

:-)

otherwise everything went fine. thanks a lot! saved me quite some time!

cheers,
carlos

_________________________________
carlos (URL) - 26 04 07 - 05:29

Thx Carlos, that worked perfect for me, thanks for the how to Mark!

___________________________________
cooper - 16 06 07 - 05:48

i try but the terminal show this error:

pelao@pelao:~/externals/maxlib$ sudo make pd_linux
Password:
cc -DPD -DMAXLIB -DUNIX -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wno-unused -Wno-parentheses -Wno-switch -I/home/pelao/externals/build/include -I./include -c src/allow.c
src/allow.c:26:20: error: string.h: No existe el fichero ó directorio
src/allow.c: En la función ‘allow_new’:
src/allow.c:81: aviso: declaración implícita de la función ‘memcpy’
src/allow.c:81: aviso: declaración implícita incompatible de la función interna ‘memcpy’
make: *** [maxlib.pd_linux] Error 1

_______________________________________
oscar santis (URL) - 19 06 07 - 11:30

Yes. I remember this happening to me too. Make sure you have all the right libraries installed. See:

http://puredata.org/docs/developer/Debia..

cheers
m

______________________________________________
mark edward grimm (Email) (URL) - 19 06 07 - 11:48

maxlib is running ok
can i install all externals at the same time?

other thing check http://www.flickr.com/photos/oscarsantis
thanks

__________________________________________________
oscar santis (Email) (URL) - 01 08 07 - 09:47

timebang: read in 1 times of day:
23:59:59
timebang: read in 1 times of day:
00:00:00
error: /home/all/log/log-2007-10-23.txt: can’t open in /home/pelao/netpd
... you might be able to track this down from the Find menu.
error: /home/all/log/log-2007-10-23.txt: can’t open in /home/pelao/netpd

______________________________________
oscar santis (Email) - 23 10 07 - 11:26

Hi mark

instead of

$ sudo updatedb
$ locate pdsend (for example)

I think that $whereis pd will do the trick!

bye

O.

____________________________________
oli44 (Email) - 12 01 08 - 13:00


No trackback:

Trackback link:

Please enable javascript to generate a trackback url

  
Remember personal info?

/ Textile

Comment moderation is enabled on this site. This means that your comment will not be visible on this site until it has been approved by an editor.

To prevent automated commentspam we require you to answer this silly question.
 

  ( Register your username / Log in )

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.