I'm needing some compilation help with the markov object I found here:
http://icem-www.folkwang-hochschule.de/~finnendahl/pd.html (bottom of the page)
I'm using it on linux, but I can't get it to compile on win32.
"Can't get it to compile" is not enough info to give us a chance to help. Please tell us a bit more about your problem.
Yes, my apologies. I'm using cygwin.
It seems that the makefile is tailored only to linux, and my goal is to compile a .dll for windows. At first the compilation itself failed with lots of "undefined reference to ..." that quickly scrolled off the dos window (why can't they put a scrollbar on it?!).
I tried hacking the makefile, and now it compiles to the *.o files OK, but the linking still failes with a similar multitude of "undefined reference" errors, all things to do with pd, like "outlet_float," etc. I've pasted the makefile below.
I understand that the problem is with includes and libraries, but I haven't find a solution. Any clues (or a working makefile!) are appreciated :)
-Chris
(makefile)
current: all
# This makefile is a ripoff of the zexy lib makefile # by johannes m. zmoelnig (thanks, johannes :-) # mahash/mapwrite/mapread makefile # everything is GnuGPL that should come with the object # make sure that the "m_pd.h" is somehow available either by putting it into this # directory, by adding it's path to the INCLUDE-path or by putting it into an # already included path, e.g. "/usr/local/include/"
#these are the user adjustables : adjust them to fit into your system # PD will install to $(DESTDIR)$(INSTALLL_PREFIX)$(PDLIBDIR), which is /usr/local/lib/pd # by default DESTDIR = INSTALL_PREFIX = /cygdrive/c/WINDOWS/Desktop/pd-0.38-4/pd-0.38-4-devel-2 PDLIBDIR = /lib INSTALLDIR = /externs HELPFILEDIR = /doc/5.reference #these were the user adjustables
TARGETS = dice in_out markovUtils rb_tree buffer dice2 fileio markov rand table
# ----------------------- LINUX ---------------------------- .SUFFIXES: .pd_linux
LINUXOBJECTS = $(TARGETS:%=%.o) ARCH = $(shell uname --machine)
PD_DIR = $(DESTDIR)$(INSTALL_PREFIX)$(PDLIBDIR)
ifeq (${ARCH},alpha) AFLAGS = -mieee -mcpu=ev56 endif
LINCLUDE = -I/usr/include -I/cygdrive/c/WINDOWS/Desktop/pd-0.38-4/pd-0.38-4-devel-2/src
$(LINUXOBJECTS): *.h
CFLAGS = -O2 -g -Wall $(LINCLUDE) $(UCFLAGS) $(AFLAGS)
-DPD -O2 -funroll-loops -fomit-frame-pointer
-W -Wshadow -Wstrict-prototypes
-Wno-unused -Wno-parentheses -Wno-switch
everything: clean all install distclean
install: # cp maphash.pd_linux $(PD_DIR)$(INSTALLDIR) # cp maphash-help.pd $(PD_DIR)$(HELPFILEDIR)/maphash.pd # cp maphash-io.pd $(PD_DIR)$(INSTALLDIR) # cp maphash-io-example.txt $(PD_DIR)$(INSTALLDIR) # ln -s $(PD_DIR)$(HELPFILEDIR)/maphash.pd $(PD_DIR)$(HELPFILEDIR)/mapread.pd # ln -s $(PD_DIR)$(HELPFILEDIR)/maphash.pd $(PD_DIR)$(HELPFILEDIR)/mapwrite.pd
uninstall: # rm $(PD_DIR)$(INSTALLDIR)/maphash.pd_linux # rm $(PD_DIR)$(INSTALLDIR)/maphash-io.pd # rm $(PD_DIR)$(INSTALLDIR)/maphash-io-example.txt # rm $(PD_DIR)$(HELPFILEDIR)/maphash.pd # rm $(PD_DIR)$(HELPFILEDIR)/mapread.pd # rm $(PD_DIR)$(HELPFILEDIR)/mapwrite.pd
distclean: touch dummy.o touch dummy.pd_linux touch dummy~ touch _dummy rm *.o *.pd_linux *~ _*
clean: touch dummy.o touch dummy.pd_linux rm *.o *.pd_linux
all: $(LINUXOBJECTS)
@echo :: $(LINUXOBJECTS)
ld -L/cygdrive/c/WINDOWS/Desktop/pd-0.38-4/pd-0.38-4-devel-2/lib
-export_dynamic -shared -o markov.dll *.o -lc -lm strip --strip-unneeded markov.dll
.c.pd_linux: gcc $(CFLAGS) -O2 -DPD -fPIC $(INCLUDE) -c -o $*.o $*.c
(end makefile)
c.m.bryan wrote:
I'm needing some compilation help with the markov object I found here:
http://icem-www.folkwang-hochschule.de/~finnendahl/pd.html (bottom
of the
page)
I'm using it on linux, but I can't get it to compile on win32.
"Can't get it to compile" is not enough info to give us a chance to help. Please tell us a bit more about your problem.
Yes, my apologies. I'm using cygwin.
It seems that the makefile is tailored only to linux, and my goal is to compile a .dll for windows. At first the compilation itself failed with lots of "undefined reference to ..." that quickly scrolled off the dos window (why can't they put a scrollbar on it?!).
you can pipe the output of your make command into a file, like "make > make.log"
it would be interesting which undefined references you get. most likely they refer to symbols defined by pd, which you can fix by linking against pd.lib
and you will need to change your makefile to produce a .dll and not a .pd_linux (but that is more or less cosmetic compared to your current problems)
btw, in theory you can cross-compile objects on linux for windows via mingw (there are debian packages), which might work (or not): iemmatrix and zexy both have an option for this (look at their README.txt/INSTALL.txt for further explanations); probably you could rip their build-system to build the markov objects (iemmatrix's build-system should be fairly general: your main task would be replacing "iemmatrix" by a name of your choice)
mfg.asdr IOhannes
you can pipe the output of your make command into a file, like "make > make.log"
for some reason when the errors start, it just goes to the standard out instead of getting piped! Weird.
I can see that "getbytes," "post," "outlet_float," and "outlet_bang" are all undefined references. The last 2 are definitely defined by pd.
... which you can fix by linking against pd.lib
I do not have this file, nor could I find anything about it. What package is it a part of?
By the way, I'm working with pd-0.38-4-devel-2
Thanks, I'll experiment with cross-compiling now, see if that works any better...
Chris
c.m.bryan wrote:
you can pipe the output of your make command into a file, like "make > make.log"
for some reason when the errors start, it just goes to the standard out instead of getting piped! Weird.
That's because stdout and stderr are two different things, you need to say something like make 2> make.log (I forget the exact syntax)
I can see that "getbytes," "post," "outlet_float," and "outlet_bang" are all undefined references. The last 2 are definitely defined by pd.
... which you can fix by linking against pd.lib
I do not have this file, nor could I find anything about it. What package is it a part of?
It's built when you compile pd. It comes with Miller's version.
By the way, I'm working with pd-0.38-4-devel-2
pd-0.39-2 seems to be the current version.
Thanks, I'll experiment with cross-compiling now, see if that works any better...
AFAIK you need to compile either with MINGW or MSVC for Windows. I tried with cygwin but cygwin tries to make a unix version, which is not compatible with the tcl/tk for Windows.
Martin
Chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Alright, I installed mingw on my linux box and test-compiled an exe which ran ok. I took the original markov makefile and simply changed all the ".pd_linux" to ".dll", and changed the gcc call to i386-mingw32-gcc. This gave me a dll without errors: however, trying to load it in pd gives:
C:\WINDOWS\DESKTOP\PD-0.38-4\PD-0.38-4-DEVEL-2\extra\markov.dll: couldn't load markov ... couldn't create
The "couldn't load" error tells me that it's seeing the file correctly, it just can't handle it.
Looking at other pd makefiles, they're calling "cl" and "link" to generate the .dll, but they're not part of mingw.
Am I missing something?
-Chris
c.m.bryan wrote:
Alright, I installed mingw on my linux box and test-compiled an exe which ran ok. I took the original markov makefile and simply changed all the ".pd_linux" to ".dll", and changed the gcc call to i386-mingw32-gcc. This gave me a dll without errors: however, trying to load it in pd gives:
C:\WINDOWS\DESKTOP\PD-0.38-4\PD-0.38-4-DEVEL-2\extra\markov.dll: couldn't load markov ... couldn't create
The "couldn't load" error tells me that it's seeing the file correctly, it just can't handle it.
Looking at other pd makefiles, they're calling "cl" and "link" to generate the .dll, but they're not part of mingw.
I guess those are the Microsoft tools, not the gnu ones. The makefiles are set up for some version of MSVC. I find it easier to use VisualC++ Express (which you can get for free) to build pd stuff for Windows, MINGW being such a pain to set up. Setting up a project in VC is only about 90% the hassle of redoing the makefile...;( I'm not sure (!), but I don't think MINGW dlls will work with binaries built with Microsoft tools. The 'couldn't load' message may relate to that. One way to find out would be to build pd first and try linking to the pd.lib you get from that. The other cause of externs not loading is that the setup routine is not exported, something which is done differently in MINGW vs MSVC. Martin
Am I missing something?
-Chris
On Aug 1, 2006, at 12:17 PM, Martin Peach wrote:
c.m.bryan wrote:
Alright, I installed mingw on my linux box and test-compiled an exe which ran ok. I took the original markov makefile and simply changed all the ".pd_linux" to ".dll", and changed the gcc call to i386-mingw32-gcc. This gave me a dll without errors: however, trying to load it in pd gives:
C:\WINDOWS\DESKTOP\PD-0.38-4\PD-0.38-4-DEVEL-2\extra\ \markov.dll: couldn't load markov ... couldn't create
The "couldn't load" error tells me that it's seeing the file correctly, it just can't handle it.
Looking at other pd makefiles, they're calling "cl" and "link" to generate the .dll, but they're not part of mingw.
I guess those are the Microsoft tools, not the gnu ones. The
makefiles are set up for some version of MSVC. I find it easier to
use VisualC++ Express (which you can get for free) to build pd
stuff for Windows, MINGW being such a pain to set up. Setting up a
project in VC is only about 90% the hassle of redoing the
makefile...;( I'm not sure (!), but I don't think MINGW dlls will work with
binaries built with Microsoft tools. The 'couldn't load' message may relate to that. One way to find out
would be to build pd first and try linking to the pd.lib you get
from that. The other cause of externs not loading is that the setup routine is
not exported, something which is done differently in MINGW vs MSVC. Martin
I've gotten down installed MinGW to a practiced art with the HOWTO I
wrote. I can get it working quite quickly these days. Have you
tried the HOWTO? There are a couple key details which make life much
easier, like the /usr/local mount.
Using MinGW on Windows has made life so much easier since it uses
gcc. It makes porting Linux or Mac OS X externals soooo much easier
than when using the Microsoft tools.
.hc
c.m.bryan wrote:
Alright, I installed mingw on my linux box and test-compiled an exe which ran ok. I took the original markov makefile and simply changed all the ".pd_linux" to ".dll", and changed the gcc call to i386-mingw32-gcc. This gave me a dll without errors: however, trying to load it in pd gives:
C:\WINDOWS\DESKTOP\PD-0.38-4\PD-0.38-4-DEVEL-2\extra\markov.dll: couldn't load markov ... couldn't create
The "couldn't load" error tells me that it's seeing the file correctly, it just can't handle it.
Looking at other pd makefiles, they're calling "cl" and "link" to generate the .dll, but they're not part of mingw.
Am I missing something?
yes. look at the iemmatrix makefile generated when you follow the instructions for cross-compiling. it is different from the linux-gcc makefile (and even more different from the makefile you posted)
the most important thing is the "-mms-bitfields" flag to the compiler, which gets the registers right for libraries to be loaded by applications compiled with msvc (like vanilla pd.exe)
mfg.asdr. IOhannes
-Chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Yes, my apologies. I'm using cygwin.
use MinGW. (or make sure your cygwin build environment only sees mingw headers and libs, you want to cross-compile from cygwin to win32)
It seems that the makefile is tailored only to linux
linux makefiles work on windows with two changes,
, and my goal is
to compile a .dll for windows. At first the compilation itself failed with lots of "undefined reference to ..." that quickly scrolled off the dos window (why can't they put a scrollbar on it?!).
yeah why isnt there a 'show onlyl last 10 lines of error'. that is totally maddening and it seems the only solution is set scrollback to infinity and run 'clear' right before make..