Compiling objects for Mac OSX
In case anyone is interested in how to do this from the terminal window on OS X:
- Copy necessary files for the compile to the object folder directory, including m_pd.h & g_canvas.h. I edited the attached "Makefile" to read the appropriate Pd source: /Applications/Pd-extended.app/Contents/Resources and copied it to the object folder.
I then loaded the terminal window and accessed the object directory using the "cd" command, like so:
cd /Applications/Pd-extended.app/Contents/Resources/extra/unauthorized/grid
Followed by the command, "make."
If the compile is successful, you should now have grid.pd_darwin in your object folder, which you can move to wherever it needs to be in order for Pd to access it.
Compiling pdvjtools on Mac OS X 10.5.8
dear all,
is there a way to get the pdvjtools working on Mac OS X10.5.8?
I would be especially interested in the videogrid object (as I hope if I am able to compile this all the other pdvjtools can also be built).
What I did by now (besides having Xcode on the system):
1. install pd-extended binary from:
http://downloads.sourceforge.net/pure-data/Pd-0.41.4-extended-macosx104-i386.dmg
2. install ffmpeg via macports (a "ffmpeg -version" results in ffmpeg version 0.5)
3. get ffmpeg sources from: http://ffmpeg.org/releases/ffmpeg-0.5.tar.bz2
4. get the PD sources from:
http://downloads.sourceforge.net/pure-data/Pd-0.41.4-extended.tar.bz2
5. get the pdvjtools from:
http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/pdvjtools/
6. modified the first line of the videogrid-makefile to fit my pd sources:
PD_SRC=/Daten/pdsrc/Pd-0.41.4-extended/pd/src
7. tried to modify the second line of the makefile to:
FFMPEG_HEADERS=-I/Daten/pdsrc/ffmpeg-0.5
This is the folder with the ffmpeg sources.
After make clean I start make - it fires up gcc with some correct path to the pd-sources - but the ffmpeg sources are the problem:
g++ -I/Daten/pdsrc/ffmpeg-0.5 -I/Daten/pdsrc/Pd-0.41.4-extended/pd/src -fPIC -c -O -o videogrid.o videogrid.cc
videogrid.cc:47:32: error: ffmpeg/avcodec.h: No such file or directory
...
Question 1: why this path? I never said "ffmpeg" is the path but "ffmpeg-0.5"?
Question 2: Ok - avcodec.h is really not in ffmpeg but in:
/Daten/pdsrc/ffmpeg-0.5/libavcodec/avcodec.h
(I also "opened up" the rights to not be trapped in a permission thingy)
make still does not work
- same error;
So I tried:
FFMPEG_HEADERS=-I/ffmpeg-0.5
in the makefile - the result was the same.
So I changed the ffmpeg headers to:
FFMPEG_HEADERS=-I/Daten/pdsrc/ffmpeg-0.5/libavcodec/
Result:
g++ -I/Daten/pdsrc/ffmpeg-0.5/libavcodec/ -I/Daten/pdsrc/Pd-0.41.4-extended/pd/src -fPIC -c -O -o videogrid.o videogrid.cc
videogrid.cc:47:32: error: ffmpeg/avcodec.h: No such file or directory
So I started to mess around even more - i renamed the "libavcodec" dir to "ffmpeg" and restored the headers to FFMPEG_HEADERS=-I/Daten/pdsrc/ffmpeg-0.5
This results (as avcodec.h is now found) in:
g++ -I/Daten/pdsrc/ffmpeg-0.5 -I/Daten/pdsrc/Pd-0.41.4-extended/pd/src -fPIC -c -O -o videogrid.o videogrid.cc
videogrid.cc:48:33: error: ffmpeg/avformat.h: No such file or directory
This for me looks like a never-ending pain - hence the last question:
Does somebody have a working makefile for the pdvjtools for Mac OS X or at least some hint on how to get them working?
cheers
clouds11
Opencv Linux Installing???
Hello People,
I have recently started running PD through Linux to take advantage of the better compatibility and so I am a little lost as to how to set somethings up. It seems there are pd files in many different folders and I'm unsure where the necessary ones are.
I am using pd-extended.40.3 for Ubuntu Hardy, but on Xubuntu.
In particular I am trying to use the opencv and haarcascades with PD, hence the changeover.
The website that informs on opencv& PD when talking about installing the libraries
http://hangar.org/wikis/lab/doku.php?id=start:puredata_opencv says
" edit the Makefile to fit your system and sources folders:
for pix_opencv edit the Makefile and change the values for PD_DIR and GEM_DIR variables
for pdp_opencv edit the Makefile.config and change the values for OPENCV_CPPFLAGS, PD_CPPFLAGS, PDP_CFLAGS variables
then, compile it :: "
My Makefile does not have this it has
srcdir = .
top_srcdir = .
Does anyone know what to change these to or how to find the relevant folder.
Please, I am dieing to have some fun with opencv.
Compiling externals on OSX
this is the simplest way to compile externals on osx 10.5 and pd-0.41-4
(really rude method)
-
install Xcode
-
write your external.c or find one already done
-
open finder -> applications -> pd-package. open package.
Then go to Resources -> extra.
there are some built in externals folders
-make a copy of one of these folders and rename the same as your external.
-inside this folder delete all the files except the makefile and copy your external.c there.
-open the makefile and rewrite the fields NAME and CSYM with the name of your external (if sou wrote a tilde external -> see one of the built in as fiddle~)
Save -
ok, now come back to "extra" folder, open makefile and change at first row "pd_linux" with "d_fat"
Save -
open terminal and type:
cd /Applications/Pd-0.41-4.app/Contents/Resources/extra/your-external
make -
copy the external in "extra" folder or where it needs
it's done.
Zexy compiling os x
ok, here's the deal.
i'm trying to install zexy 2.1. i'm using pd 0.41-1, on a macbook pro os x.4.11 with xcode.
i've put the zexy-2.1 folder in ~/Library/Application Support/Pd
i've changed the terminal directory to the src folder within this directory, and executed "./configure" successfully.
the problem comes in the next step. the linux install instructions say type "make" followed by "make install".
once i've run "make", it comes up with the following:
zexy.h:38:18: error: m_pd.h: No such file or directory
and from what i've read, m_pd.h is quite important. the terminal also displays lots of other error messages, mainly starting with:
a2l.c:XX:
i've also tried this command, which is stated in the install instructions:
"make -f makefile.darwin"
but it comes up with this:
make: makefile.darwin: No such file or directory
make: *** No rule to make target `makefile.darwin'. Stop.
this makes sense, as "makefile.darwin" is not included in the src directory (or anywhere in "zexy-2.1" for that matter)
i'm new to all this compiling malarkey, so any help on this matter would be greatly appreciated.
cheers
dom
Problem compiling external on Windows
Hi Middlepetal,
I also noticed that Mingw externals are "thin" instead of
the fat MSVC. Dunno why exactly. For sure the
strip --strip-unneeded $*.dll
strips everything unnecessary out from the .dll
Yes, you tailored the makefile perfectly for the
helloworld project. When you start mastering makefiles there is no
way back
.
Regarding
>Also, I tried using your makefile as you said, but got the response:
>
> make: Nothing to be done for `current'.
be sure to first remove the .o and .dll from the current directory
that you probably had produced by compiling manually from
command line.
PS: how do you make colored, bold text in the forum?
I didn't realize it was possible :-0
cheers,
Alberto
Problem compiling external on Windows
Great tutorial, very detailed!
Thanks for this addition..
Sorry for coming later on this subject but I'll try to add few lines about
compiling externals in Win without going through MSVC Express
edition (by the way: what are the limitations of the express edition
w.r.t. the full package?).
Even if MSVC offers an integrated environment for developing there
can be some good reasons for giving a try to the old-man "unix" way of
compiling, which in windows is best represented by MINGW32 and
cygwin. Both offers linux-like environments (i.e. command line tools)
for compiling and other shell tasks which, sometimes, in windows are
a pain in the ass.
There are at least three good reasons for giving a look at mingw:
- gives strong linux compatibility on external compilation
(almost same command lines arguments etc.) - there is the possibility to use makefiles in an almost straightforward way
(with minor modifications to linux makefiles). - no dependency on expensive MS programs (except for the
small, bug-free Operating System
I did this exercise by porting the E. Lyon "LyonPoutpourry" externals for win
(http://www.sarc.qub.ac.uk/~elyon/LyonSoftware/Pd/). Give a look at
the win source package: inside there is a makefile for darwin (MAC)
linux and win. I added the latter, and as you can see the modifications
are minor.
----------- 1. Prelude: compilation environment ------------------
First of all we have to set once for all the compilation environment.
Let's forget for the moment cygwin and concentrate on mingw32 (http://www.mingw.org/). The following is taken from (H.C. Steiner's wiki http://www.puredata.org/docs/developer/mingw)
Download the MinGW package installer and run it:
(http://prdownloads.sourceforge.net/mingw/MinGW-5.1.1.exe)
Choose the Candidate distribution. Install the defaults and add the g++ compiler, g77 compiler, and MinGW make or you can just download my MinGW install, MinGW-Pd.tar.bz2, and uncompress it so that its installed into C:\MinGW.
Then we need MSYS which is a shell (an interpreter of the commands, like a
colorful dos prompt 
http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe
Now you will be using the MSYS shell that was installed from the MSYS installer. You can launch it from the Desktop shortcut or Start -> Programs -> MinGW -> MSYS -> msys
----------- 2. Allegro: compilation trial ------------------
a. open MSYS
b. at the prompt type:
cd c:
(or the drive you whish to go for the pd external compilation)
c. go to the external directory (note the backslashes instead of slashes !),
mine is external-compiling. Inside I have helloworld.c
cd alberto/backup/PureData_Archive/patches/AlbertoZ/external-compiling/
d. copy m_pd.h (from the PD distribution directory) into external-compiling
(or whatever is its name)
e. type:
gcc -c helloworld.c -o helloworld.o
f. type:
ld -export_dynamic -shared -o helloworld.dll helloworld.o c:/Programmi/pd039e
xt4/bin/pd.dll
(this is the linker step. note that I linked to a particular version of pd.dll - 0.39 extended test 4, so probably (I'm not sure about this) the external will
run on 0.39 only. Can someone confrm this?)
g. If everything was ok then you should have a helloworld.dll in your
directory. Move it on the extra folder of your pd distribution
(I assume that extra folder is in the pd predefined path) and make a
new patch with the helloworld object. Again, if everything is correct,
you should have a "Hello world!!" printed on the console.
----------- 3. Adagio: makefile ------------------
A makefile can be used for compilation. Even if a simple helloworld
application does not need it, complex programs may do.
The makefile.win is attached with this post. Modify it according to your
path in
Make sure you have
helloworld.c
m_pd.h
makefile.win
in your directory. Now type at MSYS prompt:
make -f makefile.win
This will automatically produce:
the object, the linker step (the dll) and will copy the helloworld.dll
in the extra folder of you pd distribution (overwriting the existing one
.
----------- 4. Allegro con brio: conclusions ------------------
Why not give a try to the old-man compilation on Win?

----------- 5. Minuetto: greetings ------------------
I apologize if I said some crap somewhere, just let me know if it
doesn't work. Have fun!
Best regards,
Alberto
Problem compiling external on Windows
This has been answered on pd-list today
Hopefully this is helpful to others. I never go near Windows myself,
but anyway, post copied verbatim for the benefit of all...
> Iohannes Zmoelnig wrote:
> have you tried any online resources: e.g.
> http://puredata.info/docs/developer lists at least 2 pages that only
> deal with compiling on windows
> (http://puredata.info/docs/developer/mingw which basically deals with
> compiling pd itself on windows; but once you are there, it is simple;
> http://nul.jp/2002/pd_bc deals with compiling externals with the
> borland-compiler).
> i can give you a step-by-step guide for compiling zexy though (but mind
> that this is how i _remember_ it; i will not go and search for a windows
> machine with VC installed just to verify each step).
> - purchase M$ VC6 (elitarism on my side...:-)) and install it
> - get pd
> - download zexy (sources!) for free (e.g.
> ftp://ftp.iem.at/pub/pd/Externals/ZEXY/)
> - extract zexy to you favourite folder
> - double-click on the zexy.dsp (or was it zexy.dsw??) in the zexy/src/
> folder; this should open VC
> - to to the Project->Properties (or however this is called in your
> locale) and change the settings to match your setup (mainly these are
> the paths to find pd's headers and libraries; you should basically go
> through every item in the settings for the "release" and/or "debug"
> builds; the most important stuff is in "compiler->preprocessor",
> "compiler->path" and "linker->path"
> - when you are finished, return to the main project window
> - hit "F7" to start the build.
> - if you encounter any errors, either the settings are not yet correct
> (return to item-6) or the project is a bit out-of-date; the latter
> basically means, that the c-files to be included have not been updated;
> to fix this, just delete all the c-files from the project file browser
> (here this used to be un the left-side of the project-window), then
> right click on the folder in the project file browser that used to
> contain these files and select "add"; in the openpanel choose all
> c-files in zexy/src and hit "OK"
> - return to item-8 until you stop getting errors
> mind, that you must not use the dll while it is created (best close pd)
> if you want step-by-step instructions for vc7, vc2000, vc2006 and
> vc3000, please send them to me and i'll give it a go
(dev-elitarism
> again)
> pd comes with some externals (e.g. the foo-stuff, or [fiddle~]) and uses
> makefiles to build these.
> for this to work, you have to setup your environment correctly:
-> first open the makefile (e.g. pd/doc/6.externs/makefile) with your
> favourite text-editor and correct all the paths that are wrong
> - VC6 came with a vc6vars.bat (ok the name is wrong but something along
> these lines; it was a .bat-file which would set your envirnment
> variables when run; more modern incarnations might do without the .bat
> - open the dosbox (the rest will happen within the dosbox)
> - run the vc6vars.bat (or however it is called) if this is needed for
> your compiler-incarnation
> - cd to your path (e.g. pd/doc/6.externs/)
> - run "nmake pd_nt"
> if nmake, cl, link cannot be found, you might want to add the paths to
> them to your PATH variable.
Martin Peach wrote:
> If you're on some kind of MSVC, you set up a project to build a dll, in
> "preprocessor defines" define MSW, in "additional include paths" include
> the path to pd/src/m_pd.h, link with pd.lib from pd/bin, and in the
> linker command line add "/export:yourexternal_setup" to export the setup
> function. All the other functions in your code can be static and don't
> need to be exported. After it builds you take the dll from the release
> folder and put it in your pd/extra folder.
> That should be everything you need, but if it's too cryptic I can go
> into more detail...
> Martin
Makefile
hi, if this is too dumb a question on my part, then dont bother. i currently have this random version of linux on a computer. I got PD on it, though it has issues opening GEm (its pd-extended, probably newest version, got it like 4 days ago or less). I downloaded Gem from that IEM website and read instructions for installing the GEM folder. It said a lot of stuff by running the makefile and makeauxlibs out of the source folder. I found these files. (I also have gcc if thats of help). I was wondering what to do. I've like clicked these makefile and makeauxlibs files and I don't know if that's supposed to do anything, I can't tell if it did. I've never done this make thing before and I dont understand how it works. Pointing to a solution elsewhere on the internet that describes this stuff or some aid would help much. thanks

