Trying to understand how to compile PD Externals (static library and Windows)
on the windows makefile question: depends what the errors are, but from glancing at it it seems like the makefile was created w/ a very specific directory layout in mind..
afaict when you link with a static library the entire machine code of the necessary translation units (.c files) is just included in the binary you're compiling. That's opposed to dynamic/shared libraries that are stored in their own binaries and loaded (dynamically) at runtime.
To me it makes sense to use a shared library when you have multiple programs that need to use the same library. I think this cuts down on space and ram..
But it makes sense to use a static library if you're distributing a single binary application for instance, and you aren't sure if the necessary dynamic/shared lib exists on the user's computer yet.
If you use dynamic/shared libs you also have to point the binaries that use them to them. (like set rpath)
Can't load [ann] objects
I'm trying to load the [ann] objects created by Davide Morelli, which @seb-harmonik.ar has uploaded on his GitHub and compiled it for OSX.
I'm using Linux so I had to compile myself. Since compiling with the makefile that comes with the library doesn't work, I tried the pd-lib-builder makefile and it did compile, but Pd still can't load the objects. In the README of the library it mentions that it has been built and only works with FANN 1.2, whereas FANN's latest version is 2.2.0 (and that's since 2012). I can't find any previous version of FANN, and I don't really know how to link this external to the current version of FANN.
Any ideas how to make this work?
I can't play mp3 files with readsf~ (purr-data)
@Jona I tried installing it, but i got this error:
$ sudo make
++++ info: using Makefile.pdlibbuilder version 0.6.0
ls: cannot access '/m_pd.h': No such file or directory
pd-lib-builder/Makefile.pdlibbuilder:802: Where is Pd API m_pd.h? Do 'make help' for info.
++++ info: making target all in lib ffmpeg
++++ info: making ffplay~.o in lib ffmpeg
cc -DPD -I "" -DUNIX -fPIC -Wall -Winline -Wstrict-aliasing -Wshadow -Wno-unused-function -Wno-unused-parameter -Wno-unused-value -Wno-unused-variable -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -mfpmath=sse -msse -msse2 -msse3 -o ffplay~.o -c ffplay~.c
In file included from ffplay~.c:1:
ufloat.h:1:10: fatal error: m_pd.h: No such file or directory
1 | #include "m_pd.h"
| ^~~~~~~~
compilation terminated.
make: *** [pd-lib-builder/Makefile.pdlibbuilder:957: ffplay~.o] Error 1
EDIT: I did some research and it turns out I have to compile it in /opt/purr-data/include/pd-l2ork/, oops...
Troubles getting Ofelia to work
Some progress, maybe. I edited the Ofelia makefiles to use the system libraries for runtime paths instead of the OF libs, same problem. This suggests that the two libraries which the Ofelia makefiles explicitly links to the OF libs in the makefiles (kiss and tess2) are the culprit, they are trying to find the libraries they were compiled against. But this raises the question as to why it is a problem for me and not for everyone using archlinux, which uses the same versions or newer of the libraries as I have. So I will try replacing them with my own versions in a few days when I have time to fight with this again. Unless someone else has a bright idea.
Building on Windows - works from Git source, not from tarball
I wanted to build PD on Windows 10 to get ASIO support. I failed when I used the "Source" files from the PD website. I succeeded when I used source that I cloned from Github. I followed the same instructions from the wiki both when I failed and when I succeeded. (They are the same as in the manual, just a little more concise.)
I am sharing below my terminal output from the failed build attempts from the downloaded source code (the tar.gz file). Some of these messages suggest that there might be errors in the makefiles. I don't know anything about makefiles, so I can't really interpret the errors. But I did want to pass them along, in case a developer might find them useful. Here you go:
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ ./autogen.sh
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'm4/config'.
libtoolize: linking file 'm4/config/config.guess'
libtoolize: linking file 'm4/config/config.sub'
libtoolize: linking file 'm4/config/install-sh'
libtoolize: linking file 'm4/config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4/generated'.
libtoolize: linking file 'm4/generated/libtool.m4'
libtoolize: linking file 'm4/generated/ltoptions.m4'
libtoolize: linking file 'm4/generated/ltsugar.m4'
libtoolize: linking file 'm4/generated/ltversion.m4'
libtoolize: linking file 'm4/generated/lt~obsolete.m4'
configure.ac:166: warning: The macro `AC_LIBTOOL_DLOPEN' is obsolete.
configure.ac:166: You should run autoupdate.
aclocal.m4:8488: AC_LIBTOOL_DLOPEN is expanded from...
configure.ac:166: the top level
configure.ac:166: warning: AC_LIBTOOL_DLOPEN: Remove this warning and the call to _LT_SET_OPTION when you
configure.ac:166: put the 'dlopen' option into LT_INIT's first parameter.
../autoconf-2.71/lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:8488: AC_LIBTOOL_DLOPEN is expanded from...
configure.ac:166: the top level
configure.ac:167: warning: The macro `AC_LIBTOOL_WIN32_DLL' is obsolete.
configure.ac:167: You should run autoupdate.
aclocal.m4:8523: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:167: the top level
configure.ac:167: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
configure.ac:167: put the 'win32-dll' option into LT_INIT's first parameter.
../autoconf-2.71/lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:8523: AC_LIBTOOL_WIN32_DLL is expanded from...
configure.ac:167: the top level
configure.ac:168: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:168: You should run autoupdate.
aclocal.m4:121: AC_PROG_LIBTOOL is expanded from...
configure.ac:168: the top level
configure.ac:182: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:182: You should run autoupdate.
../autoconf-2.71/lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:182: the top level
configure.ac:213: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:213: You should run autoupdate.
../autoconf-2.71/lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:213: the top level
configure.ac:235: warning: The macro `AC_CHECK_LIBM' is obsolete.
configure.ac:235: You should run autoupdate.
aclocal.m4:3879: AC_CHECK_LIBM is expanded from...
configure.ac:235: the top level
configure.ac:276: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:276: You should run autoupdate.
../autoconf-2.71/lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
m4/universal.m4:14: PD_CHECK_UNIVERSAL is expanded from...
configure.ac:276: the top level
configure.ac:168: installing 'm4/config/compile'
configure.ac:9: installing 'm4/config/missing'
asio/Makefile.am: installing 'm4/config/depcomp'
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ autoupdate
configure.ac:182: warning: The preprocessor macro `STDC_HEADERS' is obsolete.
Except in unusual embedded environments, you can safely include all
ISO C90 headers unconditionally.
configure.ac:213: warning: your code may safely assume C89 semantics that RETSIGTYPE is void.
Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ ^C
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ ./configure
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
configure: iPhone SDK only available for arm-apple-darwin hosts, skipping tests
configure: Android SDK only available for arm-linux hosts, skipping tests
checking for as... as
checking for dlltool... dlltool
checking for objdump... objdump
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... (cached) objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... (cached) dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for vfork.h... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether make sets $(MAKE)... (cached) yes
checking whether ln -s works... no, using cp -pR
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for windres... windres
checking for egrep... (cached) /usr/bin/grep -E
checking for fcntl.h... yes
checking for limits.h... yes
checking for malloc.h... yes
checking for netdb.h... no
checking for netinet/in.h... no
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/ioctl.h... no
checking for sys/param.h... yes
checking for sys/socket.h... no
checking for sys/soundcard.h... no
checking for sys/time.h... yes
checking for sys/timeb.h... yes
checking for unistd.h... (cached) yes
checking for int16_t... yes
checking for int32_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for working alloca.h... no
checking for alloca... yes
checking for error_at_line... no
checking for fork... no
checking for vfork... no
checking for GNU libc compatible malloc... (cached) yes
checking for GNU libc compatible realloc... (cached) yes
checking return type of signal handlers... void
checking for dup2... yes
checking for floor... yes
checking for getcwd... yes
checking for gethostbyname... no
checking for gettimeofday... yes
checking for memmove... yes
checking for memset... yes
checking for pow... yes
checking for regcomp... no
checking for select... no
checking for socket... no
checking for sqrt... yes
checking for strchr... yes
checking for strerror... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
checking for dlopen in -ldl... no
checking for cos in -lm... yes
checking for CoreAudio/CoreAudio.h... no
checking for pthread_create in -lpthread... yes
checking for msgfmt... yes
checking for sys/soundcard.h... (cached) no
checking for snd_pcm_info in -lasound... no
configure: Using included PortAudio
configure: Using included PortMidi
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating asio/Makefile
config.status: creating doc/Makefile
config.status: creating font/Makefile
config.status: creating mac/Makefile
config.status: creating man/Makefile
config.status: creating msw/Makefile
config.status: creating portaudio/Makefile
config.status: creating portmidi/Makefile
config.status: creating tcl/Makefile
config.status: creating tcl/pd-gui
config.status: creating po/Makefile
config.status: creating src/Makefile
config.status: creating extra/Makefile
config.status: creating extra/bob~/GNUmakefile
config.status: creating extra/bonk~/GNUmakefile
config.status: creating extra/choice/GNUmakefile
config.status: creating extra/fiddle~/GNUmakefile
config.status: creating extra/loop~/GNUmakefile
config.status: creating extra/lrshift~/GNUmakefile
config.status: creating extra/pd~/GNUmakefile
config.status: creating extra/pique/GNUmakefile
config.status: creating extra/sigmund~/GNUmakefile
config.status: creating extra/stdout/GNUmakefile
config.status: creating pd.pc
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
pd 0.51.4 is now configured
Platform: MinGW
Debug build: no
Universal build: no
Localizations: yes
Source directory: .
Installation prefix: /mingw64
Compiler: gcc
CPPFLAGS:
CFLAGS: -g -O2 -ffast-math -funroll-loops -fomit-frame-pointer -O3
LDFLAGS:
INCLUDES:
LIBS: -lpthread
External extension: dll
External CFLAGS: -mms-bitfields
External LDFLAGS: -s -Wl,--enable-auto-import -no-undefined -lpd
fftw: no
wish(tcl/tk): wish85.exe
audio APIs: PortAudio ASIO MMIO
midi APIs: PortMidi
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/c/Useras/bhage/Downloads/pd-0.51-4/m4/config/missing' aclocal-1.16 -I m4/generated -I m4
configure.ac:170: error: AC_REQUIRE(): cannot be used outside of an AC_DEFUN'd macro
configure.ac:170: the top level
autom4te: error: /usr/bin/m4 failed with exit status: 1
aclocal-1.16: error: autom4te failed with exit status: 1
make: *** [Makefile:451: aclocal.m4] Error 1
bhage@LAPTOP-F1TU0LRH MINGW64 /c/Users/bhage/Downloads/pd-0.51-4
$ make app
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/c/Users/bhage/Downloads/pd-0.51-4/m4/config/missing' aclocal-1.16 -I m4/generated -I m4
configure.ac:170: error: AC_REQUIRE(): cannot be used outside of an AC_DEFUN'd macro
configure.ac:170: the top level
autom4te: error: /usr/bin/m4 failed with exit status: 1
aclocal-1.16: error: autom4te failed with exit status: 1
make: *** [Makefile:451: aclocal.m4] Error 1
TheTechnobear's Mi4Pd (Mutable Instruments modules) with updated helpfiles
I managed to compile in msys2 MinGW 64-bit on win10 after adding this to CMakeList.txt
if(WIN32)
message("windows support limited")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST -fPIC" )
set(PD_CMAKE_PATH "C:/Program Files/Pd")
set(EXECUTABLE_NAME mi4pd)
endif()
also, to force cmake to use Unix Makefile generator instead of default MSVC
I added file next to CMakeList.txt called PreLoad.cmake with following:
set(CMAKE_GENERATOR "Unix Makefiles" CACHE INTERNAL "" FORCE)
So,
mkdir build && cd build && cmake .. && make
produces DLLs in ./release/bin/ with some minor warnings, but all audio object causes segmentation fault and crashes Pd straight after enabling DSP. Only grids is usable.
Problems building PD051.2 Ubuntu Studio 20.04
Hi, got errors when make app:
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:2808: pd.dll] Erro 1
make[4]: Saindo do diretório '/home/marcelo/Downloads/pd-0.51-2/src'
make[3]: *** [Makefile:497: install-recursive] Erro 1
make[3]: Saindo do diretório '/home/marcelo/Downloads/pd-0.51-2'
make[2]: *** [Makefile:797: install] Erro 2
make[2]: Saindo do diretório '/home/marcelo/Downloads/pd-0.51-2'
make[1]: *** [Makefile:470: app] Erro 2
make[1]: Saindo do diretório '/home/marcelo/Downloads/pd-0.51-2/msw'
make: *** [Makefile:938: app] Erro 2
Any suggestions on how to fix it?
Thanks
Why does Pd look so much worse on linux/windows than in macOS?
@ingox it means you video card is actually being used by the system, /dev/drive/card0 is your video card. The standard test using lsmod or dmesg actually only checks to see if the kernel loaded the driver, does not actually tell you that it is being utilized. I have no idea where I was going with that, I think it was just 4AM logic, but I may have actually had a plan and just forgot it during sleep.
@ddw_music said:
We might be having a terminology problem here.
No, I was referring to the aliasing error shown in Ingox's screen grabs, the line changes thickness, it is not aliased properly. In my experience most people realize this given the context. With anti-aliasing you never have nice crisp single pixel lines, you have 3 or 4 pixel lines of two shades of grey depending on the angle, they are not crisp, just smooth.
If it's a driver issue
The aliasing error being a driver issue. Aliasing vs anti-aliasing is obviously a software issue.
The distro's TK version:
I meant implementation not version, the hour was late. A quick glance at the pd source, its config and the Makefile suggests there is nothing there that enables anti-aliasing for OSX, which strongly suggests that you just need to compile TK with anti-aliasing and you will have it (possibly after recompiling TK apps, did not bother to look into it to see how it works). Most likely every linux distro assumes that anyone choosing TK is doing so for speed over aesthetics, a fair assumption, so they package TK without aliasing. I did not give a thorough search of the source, just a few greps, read the readme and checked the configs help, but considering that there is not one mention of TK in the Makefile, I think it is a safe assumption. This is part of linux, distros have to consider being able to run on less than state of the art hardware.
Optimizing pd performances to fit an RPI 3
This is Pure Data that needs to be compiled with -fno-omit-frame-pointer flag.
< http://www.brendangregg.com/blog/2014-06-22/perf-cpu-sample.html >
Incomplete stacks usually mean -fomit-frame-pointer was used – a compiler optimization that makes little positive difference in the real world, but breaks stack profilers. Always compile with -fno-omit-frame-pointer. More recent perf has a -g dwarf option, to use the alternate libunwind/dwarf method for retrieving stacks.
And AFAIK Pure Data is compiled without < https://github.com/pure-data/pure-data/blob/f22d621e5c595572179cdd2aa51eab032b964240/configure.ac#L36 >.
Optimizing pd performances to fit an RPI 3
Hi I manage to get the perf tools source but don't know where I should put the -fno-omit-frame-pointer flag. All the tutrial I found show how to compile it with the makefile, so how do I put this gcc flag in the makefile ?




