cmm could grab those compiled versions from you please? I

that wouldn't work: you need the dependencies to be installed for those to work.

cmm dpkg-deb: error: '/tmp/pkgs//libcurl4-openssl-dev_7.52.1-5+deb9u4_armhf.deb' is not a debian format archive

So what happened here is that the download failed because the URL of the package is obsolete (and the board - who we trust to provide the URLs) does not know about it because it's not connected to the internet. wget would have not helped.

cmm I can see m_pd.h referenced further up this thread but not sure where to go from here - ran the help, tried adding same PD_INCLUDE lines as emerson.

yes I am a bit confused as to why I did not have to do it earlier. On this other board I have now I have to do:

make PDINCLUDEDIR=/usr/local/include/libpd/
  • cmm replied to this.
  • cmm likes this.

    giuliomoro thank you!! It's working now. This makes transferring presets between Max and Pd/Bela much easier (it's what we use to store the Kellycaster data). Will put the results online soon.

    5 months later

    Hi,

    I know, it's probably all in here but even after four days of trying I'm not able to run Pure Data patches on Bela that make use of externals, because I'm too new to all this.

    Is there someone who could write a step by step guide of how to get this working starting at a very basic level? With 'very' I mean something like: "first you have to create a directory on the board, the necessary command is: XX; then you have to copy the relevant folder into this directory: /XX/YY by using this command: ZZZ" and so on? That would be so helpful!

    I hope someone could help, I'm really lost. Thank you!

    Each external has its own method to be built. There are a lot or similarities, though, so the guidelines above should be applicable to mostly any external, but it's impossible to be more specific than that without knowing exactly which ones you need.

    What externals do you need to build?
    What operating system are you using?

    Hi giuliomoro,

    I need to build a couple of externals, the most important ones are cyclone and ggee and I'm on OS 10.13.6.

    Thank you!

    With Cyclone I've come so far:

    emerson Downloaded the PD fork and copied it into /root/pure-data
    then went back to Bela/projects/pd-externals/externals/cyclone and tried
    'make PDINCLUDEDIR=/root/pure-data/src/ PDLIBDIR=/root/Bela/projects/pd-externals install'

    Then I got these error messages:

    Makefile:305: pd-lib-builder/Makefile.pdlibbuilder: No such file or directory
    make: *** No rule to make target 'pd-lib-builder/Makefile.pdlibbuilder'. Stop.

    The attachment gives an idea what's in the directory ../cyclone.

    Do you know what's wrong? Thank you!

    alt text

    sorry I will hopefully have time tomorrow to try this out myself. It looks like you are missing the pd-lib-builder folder in there. Also, you can delete all of those .pd_darwin files. As per the documentation of the pd-lib-builder/Makefile.pdlibbuilder file, you will need to specify

    # PDINCLUDEDIR:
    # Directory where Pd API m_pd.h should be found, and other Pd header files.
    # Overrides the default search path.

    on the command line. That is the folder where the Pd header files live. On Bela, that is /usr/local/include/libpd/
    So, once you re-add the missing folder, you can re-run the make command (from within the cyclone folder, same as you did earlier, but with an extra command-line option):

    make PDINCLUDEDIR=/usr/local/include/libpd

    however, this may still fail if some files are missing.

    thank you for your help. I included all missing files, ran the "make" command from within the cyclone folder and received some error messages like this one:

    ++++ info: making shared/common/magicbit.o in lib cyclone
    cc -DPD -I "/usr/local/include/libpd" -DUNIX -fPIC -Ishared -DHAVE_STRUCT_TIMESPEC -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -o shared/common/magicbit.o -c shared/common/magicbit.c
    shared/common/magicbit.c:6:22: fatal error: g_canvas.h: No such file or directory
    #include "g_canvas.h"
    ^
    compilation terminated.
    make: *** [shared/common/magicbit.o] Error 1
    pd-lib-builder/Makefile.pdlibbuilder:917: recipe for target 'shared/common/magicbit.o' failed

    Within the cyclone folder I also tried:

    make PDINCLUDEDIR=/root/pure-data/src/ PDLIBDIR=/root/Bela/projects/pd-externals install

    And received:

    root@bela ~/Bela/projects/pd-externals/cyclone# make PDINCLUDEDIR=/root/pure-data/src/ PDLIBDIR=/root/Bela/projects/pd-externals install
    ls:
    cannot access '/root/pure-data/src//m_pd.h'
    ++++ info: using Makefile.pdlibbuilder version 0.5.1
    ++++ info: making target install in lib cyclone
    ++++ info: installpath is '/root/Bela/projects/pd-externals/cyclone'
    : No such file or directory
    ++++ info: making shared/common/magicbit.o in lib cyclone
    cc -DPD -I "/root/pure-data/src/" -DUNIX -fPIC -Ishared -DHAVE_STRUCT_TIMESPEC -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -o shared/common/magicbit.o -c shared/common/magicbit.c
    shared/common/magicbit.c:4:18: fatal error: m_pd.h: No such file or directory
    #include "m_pd.h"
    ^
    compilation terminated.
    make: *** [shared/common/magicbit.o] Error 1
    pd-lib-builder/Makefile.pdlibbuilder:917: recipe for target 'shared/common/magicbit.o' failed

    Do you have an idea what I could do next? It feels as if I am a bit closer now...

    Thank you!

      terbijn shared/common/magicbit.c:6:22: fatal error: g_canvas.h: No such file or directory
      #include "g_canvas.h"
      ^

      yes that's what I meant earlier. Get all the .h files from the src/ folder of this repo and copy them to your board in /usr/local/include/libpd/ then re-run the make commands.

      Excuse me but I couldn’t find that path on the board. Can you tell me where it is located or tell me which command I have to use to copy the files from my desktop there?

      Thank you!

      Now I found some time to do it (Friday night, 2am, of course).

      Preparation:
      - get extra header files needed to compile Cyclone (and ggee, and others) on Bela:
      - on your computer open a terminal and:

      git clone https://github.com/giuliomoro/pure-data &&\
      cd pure-data &&\
      scp src/*h root@192.168.7.2:/usr/local/include/libpd/ 

      - make sure that the pd-externals folder exists on Bela:

      ssh root@192.168.7.2 mkdir -p Bela/projects/pd-externals

      Now, the externals:

      Cyclone:

      • get Cyclone from Github. Go to the releases page. The latest release requires Pd 0.49, but Bela has Pd 0.48-2. So we get the v0.3, RC-1, which requires Pd 0.48-1. Here is the direct link to the source code.
      • Download the code on your computer and uncompress it by double clicking on it. This results into an pd-cyclone-cyclone0.3rc1. In my case, this is on my Desktop.
      • Open a terminal, navigate to the folder containing the pd-cyclone-cyclone0.3rc1 folder. In my case:
        cd ~/Desktop
      • copy the folder to the board:
        scp -r pd-cyclone-cyclone0.3rc1 root@192.168.7.2: 
      • go on the board and go into the cyclone folder we just copied:
        ssh root@192.168.7.2 
        cd pd-cyclone-cyclone0.3rc1/
      • compile Cyclone. The README says that Cyclone uses the pd-lib-builder building system. The provided documentation for pd-lib-builder says that you should invoke make by passing the path to the folder containing the Pd includes (in our case, the /usr/local/include/libpd path we copied the .h files to earlier on). This may take 10 minutes or so to run, and print some warnings, but all should be fine in the end:
        make PDINCLUDEDIR=/usr/local/include/libpd
      • once this is successful, you can install the externals. These go in the ~/Bela/projects/pd-externalsfolder we created earlier, and in order to tell pd-lib-builder about it is to set PDLIBDIR when calling make install:
        make PDLIBDIR=/root/Bela/projects/pd-externals install
      • now if you look into the destination folder you will see all the externals (with extension .pd_linux):
         ls ~/Bela/projects/pd-externals/cyclone
      • great, test it: open the IDE, create a Pd project, upload a patch like this one:

      alt text

      It works!

      Ggee:

      • I struggled to locate the most up-to-date source code. On my computer, Deken shows that there is a v0.27 version, but I cannot find that online, so I go for the v0.26 available via Sourceforge through the Pd website: https://sourceforge.net/projects/pure-data/files/libraries/ggee/ggee-0.26.tar.gz/download
      • download that file, unzip it on your computer by clicking it. This results into a ggee-0.26 folder. In my case, this is on my Desktop.
      • Open a terminal, navigate to the folder containing the ggee-0.26 folder. In my case:
        cd ~/Desktop
      • copy the folder to the board:
        scp -r ggee-0.26 root@192.168.7.2: 
      • go on the board and go into the cyclone folder we just copied:
        ssh root@192.168.7.2 
        cd ggee-0.26
      • compile ggee. The README does not say much about compiling, so we inspect the Makefile and find that the path to the folder containing the Pd headers is given as the PD_INCLUDE variable.
        make PD_INCLUDE=/usr/local/include/libpd
      • however, the above command fails:
        root@bela:~/ggee-0.26# make PD_INCLUDE=/usr/local/include/libpd
        cc -DPD -I. -I"/usr/local/include/libpd"/pd -Wall -W -g -DVERSION='"0.26"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -o "control/constant.o" -c "control/constant.c"
        control/constant.c:4:18: fatal error: m_pd.h: No such file or directory
         #include <m_pd.h>
                          ^
        compilation terminated.
        Makefile:165: recipe for target 'control/constant.o' failed
        make: *** [control/constant.o] Error 1
      • we inspect the error message and notice there that the path provided by -I in the compiler parameters is not, as we expected "/usr/local/include/libpd", but rather it is "/usr/local/include/libpd"/pd. Further inspecting the Makefile we find the line CFLAGS = -DPD -I. -I"$(PD_INCLUDE)"/pd -Wall -W -g, and that is the only place where the PD_INCLUDE variable is used. So instead of passing PD_INCLUDE=, we can pass all the options passed by CFLAGS=, replacing the -I parameter with the correct one. Additionally, we can add some optimization flags here:
        make CFLAGS="-DPD -I. -I"/usr/local/include/libpd" -Wall -W -g -DVERSION='"0.26"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math"
      • now install. Further exploring the Makefile we find that pkglibdir= tells make where to install the externals, so:
        make install pkglibdir=/root/Bela/projects/pd-externals
      • now if you look into the destination folder you will see all the externals (with extension .pd_linux):
         ls ~/Bela/projects/pd-externals/ggee
      • great, test it: open the IDE, create a Pd project, upload a patch like this one:

      alt text

      It works!

      As you can see, there is no hard and fast rule for building externals, though many use pd-lib-builder and therefore will be installed the same way as cyclone. Some others have some different Makefiles, but it's often fairly straightforward to observe the error, inspect the Makefile and figure out what variable needs to be set.

        giuliomoro,

        this is amazingly helpful, thank you so much, I managed to get Cyclone working, hurray!

        Unfortunately, I ran into an unexpected error with Ggee. When

        make PD_INCLUDE=/usr/local/include/libpd

        I got this:

        cc -DPD -I. -I"/usr/local/include/libpd"/pd -Wall -W -g -DVERSION='"0.26"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -o "control/constant.o" -c "control/constant.c"
        control/constant.c:4:18: fatal error: m_pd.h: No such file or directory
        #include <m_pd.h>
        ^
        compilation terminated.
        Makefile:165: recipe for target 'control/constant.o' failed
        make: *** [control/constant.o] Error 1

        I know, the 'm_pd.h' case has been discussed before but I don't know how to solve it here. Could you please help me?

        Thank you so much for your time!

        sorry I had left a couple of bullet points in there that I copied/pasted from the cyclone section, fixed now

        Thank you. I hate to say it but I still cannot get it to work:

        root@bela:~/ggee-0.26# make CFLAGS="-DPD -I. -I"/usr/local/include/libpd"/pd -Wall -W -g -DVERSION='"0.26"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math"
        cc -DPD -I. -I/usr/local/include/libpd/pd -Wall -W -g -DVERSION='0.26' -fPIC -O6 -funroll-loops -fomit-frame-pointer -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -o "control/constant.o" -c "control/constant.c"
        control/constant.c:4:18: fatal error: m_pd.h: No such file or directory
        #include <m_pd.h>
        ^
        compilation terminated.
        Makefile:165: recipe for target 'control/constant.o' failed
        make: *** [control/constant.o] Error 1

        If I had an idea where to start figuring it out, I would...

        Thank you!

        I don't know how I left another typo in there, fixed again.

        giuliomoro,

        thank you so much for your time, help and patience with people who are as clueless as I am! It works and I am really happy!

        6 months later

        I feel quite efficient at Pd patching, but no real coding skills whatsoever (apart from basic arduino and processing coding). So I find it all terribly puzzling.

        I need to install the Helmholtz~ external http://www.katjaas.nl/helmholtz/helmholtz.html#download
        What I managed to do so far is that I created the Bela/projects/pd-externals/ with basic linux commands in the ide. The pd-externals also appears in a "project explorer" in the ide. What am I supposed to do now? I know I should build the projec on bela, but what exactly does it mean, step by step? Should I run the "Makefile" from the ide command line?

        I know most of this stuff is not a rocket science for people with coding and linux experience, but for someone like me who is just patching stuff in pd, max, reaktor and such, this is really puzzling...

        Here is how I compiled helmoltz~. As mentioned earlier, there is no standard way of compiling externals, and each and everyone of them will probably require inspecting the Makefile at some point to get it to build.

        Steps:
        - get the source code and copy it to the board:

        scp -r helmoltz~ root@192.168.7.2:

        - ssh to the board and navigate to the helmoltz~ folder:

        ssh root@192.168.7.2
        cd helmoltz~
        • inspect the files in the folder:
          • There are several pre-built externals in the folder, let's get rid of those manually:
            rm helmholtz~.dll helmholtz~.pd_* src/helmholtz~.pd_darwin
          • There is a file in src/include/m_pd.h which is the pd include. However, we should not compile against this (which - according to the docs - is from Pd0.42), but against the one that is installed on our board. So, first off let's delete this:
            src/include/m_pd.h
        • navigate to the src/ folder where there is a Makefile:
          cd src
        • for good measure, run make clean to get rid of any leftover pre-built files
        • try to run make and see if/how it fails
          root@bela:~/helmholtz~/src# make
          g++ -DPD -O3 -Wall -W -Wshadow -Wno-unused -Wno-parentheses -Wno-switch -fcheck-new -fvisibility=hidden -I ./include	 -c *.cpp
          g++ -bundle -undefined suppress -flat_namespace -o helmholtz~.pd_darwin *.o
          g++: error: suppress: No such file or directory
          g++: error: unrecognized command line option ‘-bundle’; did you mean ‘-Wundef’?
          g++: error: unrecognized command line option ‘-flat_namespace’; did you mean ‘-Wnamespaces’?
          Makefile:44: recipe for target 'helmholtz~.pd_darwin' failed
          So it seems it is trying to build a helmholtz~.pd_darwin external, which would be for macos. We need to rectify this. Open Makefile in your favourite text editor, and you will see the first target (which is the default target) is:
          current: pd_darwin
          Scroll down and you will see that there is a target called pd_linux.
          So the next thing to try is to run make with that target:
          root@bela:~/helmholtz~/src# make pd_linux
          g++ -msse -DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -Wall -W -Wshadow -Wno-unused -Wno-parentheses -Wno-switch -fvisibility=hidden -I ./include -c *.cpp
          g++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’?
          Makefile:23: recipe for target 'helmholtz~.pd_linux' failed
          make: *** [helmholtz~.pd_linux] Error 1
          The error her is that it is trying to use -msse, which instructs the compiler to use the sse instructions, but these are only available on Intel CPUs. So open the Makefile again, and see where these are defined:
          LINUXCFLAGS = -msse -DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC\
              -Wall -W -Wshadow \
              -Wno-unused -Wno-parentheses -Wno-switch -fvisibility=hidden
          Now, with make, the internal variables can be overridden from the command-line, without editing the Makefile, so we can use this feature to remove the -msse option. Inspecting the current list of options, we see that many of those (those starting with -W) refer to warnings, so we can just remove them. While we are at it, we can add in the standard Bela optimization options (which can be found in ~/Bela/Makefile): -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math. Let's not remove the -D options (which define flags that are used by the code).
          The resulting LINUXCFLAGS variable should then contain: -DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -fvisibility=hidden -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math. We can therefore execute the following command:
        make pd_linux LINUXCFLAGS="-DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -fvisibility=hidden -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math"

        This fails like this:

        In file included from Helmholtz.cpp:14:0:
        ./include/Helmholtz.h:53:18: fatal error: m_pd.h: No such file or directory
         #include "m_pd.h"
                          ^
        compilation terminated.
        helmholtz~.cpp:12:18: fatal error: m_pd.h: No such file or directory
         #include "m_pd.h"
                          ^
        compilation terminated.
        Makefile:23: recipe for target 'helmholtz~.pd_linux' failed
        make: *** [helmholtz~.pd_linux] Error 1

        This means that we need to tell make where to find our m_pd.h file. This is in /usr/local/include/libpd. We can simply add -I/usr/local/include/libpd to the LINUXCFLAGS:

        make pd_linux   LINUXCFLAGS="-DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -fvisibility=hidden -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -I/usr/local/include/libpd"

        This produces the following output:

        g++ -DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -fvisibility=hidden -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -I/usr/local/include/libpd -I ./include -c *.cpp
        g++ -Wl -export-dynamic -shared -o helmholtz~.pd_linux *.o -lc -lm -lstdc++
        g++: error: unrecognized command line option ‘-Wl’; did you mean ‘-W’?
        Makefile:23: recipe for target 'helmholtz~.pd_linux' failed
        make: *** [helmholtz~.pd_linux] Error 1

        The first line is the compiling step and it actually works ok. The second line is the linking stage and it fails because of the -Wl option. Not sure here what the original developer meant by that. Options starting with -Wl, normally contain flags to be passed to the linker, but this one is incomplete, so we can just remove it. Inspecting the Makefile once more, we see that the -Wl option is actually hardcoded in the recipe for pd_linux:, so we cannot override it from the command line and we have to delete it manually from the Makefile. Once that is done, we can re-run the command above and this time we obtain:

        g++ -DPD -DUNIX -DICECAST -O3 -funroll-loops -fomit-frame-pointer -fcheck-new -fPIC -fvisibility=hidden -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -I/usr/local/include/libpd -I ./include -c *.cpp
        g++ -export-dynamic -shared -o helmholtz~.pd_linux *.o -lc -lm -lstdc++
        rm -f *.o ../helmholtz~.pd_linux
        cp helmholtz~.pd_linux ../helmholtz~.pd_linux

        Success! The generated file is in ~/helmholtz~/src/helmholtz~.pd_linux, and also it is copied in /root/helmholtz~/helmholtz~.pd_linux. We now can copy this file to ~/Bela/projects/pd-externals, after creating the folder (in case it doesn't exist):

        mkdir -p ~/Bela/projects/pd-externals
        cp ~/helmholtz~/src/helmholtz~.pd_linux ~/Bela/projects/pd-externals/