Hi al, what woud be the general approach for compiling a pd-extended external for Bela? For example, the ggee/filters. Is it out there and step by step guide?
Thanks
josep m

    jeppius it should be possible but I have not tried myself yet, also I probably need to recompile libpd with support for dynamic linking. Feel free to play around with it and report back otherwise I may be able to give it a try next week

    12 days later
    5 days later

    thanks, I compiled several ones, all with complete success!

    Nice!
    We are actually thinking through how to best integrate building external into the Bela IDE.
    So far the plan is to create an example project called 08-PureData/your-external, you open it as an example and save as.
    The project will basically contain Pd's externals/template files, with minor modifications. The Makefile included with the project will make sure that once the project is built, the produced binary is moved to a folder (e.g.: ~/Bela/projects/pd-externals/), which in turn should be added by default to libpd-based projects.

    Not sure how to better handle the libdir part of pd's external/template: this allows to easily create libraries of externals (as opposed to individual externals).

    Thoughts appreciated.

    21 days later

    the latest master and dev branches will automatically add the current path and projects/pd-externals to libpd's search path so that you can just drop a compiled external in there and it will work!

      21 days later

      hmmm.. doesn't seem to work for me!
      a compiled external in a project folder is seen, but when I move it to the folder projects/pd-external (which I created, as it wasn't there), it's not anymore..
      That's with Bela 0.2.

      Hm. That's right, I guess there was a typo in my post above (fixed now): it is projects/pd-externals

        giuliomoro could have almost guessed that 😉

        but I still get this error:

        mirror~
        error: ... couldn't create
        error: signal outlet connect to nonsignal inlet (ignored)

        when I put the external into the project folder directly, it works.
        Path is ~/Bela/projects/pd-externals , object is called mirror~.pd_linux

        ok, this sounds strange. Can you check that the render file you are using (whether core/default_libpd_render.cpp, or a custom one if you have it in your project) has the following lines:

             //Add the current folder to the search path for externals
             libpd_add_to_search_path(".");
             libpd_add_to_search_path("../pd-externals");

        If this is ok, then it may be that your YOUROBJECT_new method is returning NULL, for whatever reason. Can you add a printf in YOUROBJECT_setup and YOUROBJECT_new to make sure they are being called?

        ah, using a custom one - which doesn't have that added.
        sorry, didn't know the connection was coming from there!
        adding those lines worked. thanks!

        a month later

        Hello! I'm struggling with with adding pd externals to my projects.
        Is is possible to use xxx.pd_darwin externals or does it have to be xxx.pd_linux externals?
        I tried to use the template mentioned earlier both running make file on OSX and in ubuntu64 bit and 32 bit.
        I only get error ... couldn't create with OSX and ubuntu 32 bit.
        With ubuntu 64bit I get a message ./hrtf2~.pd_linux: ./hrtf2~.pd_linux: wrong ELF class: ELFCLASS64
        hrtf2~.pd is my external.
        Can any of you clear up what you did right?

        Sorry I never got around writing appropriate instructions for this. You have to compile the externals on the BeagleBone itself. At that point, your compiled file will be called hrtf2~.pd_linux. Mind you, this will have a different architecture from the one with the same name which you obtained on your Ubuntu computer(arm the former, x86 the latter).

        Thanks a bunch! It's running!
        Explanation: I made it work by copying .c .h and makefile to ../projects/pd-externals/ and running makefile from IDE command line.

        2 months later

        I guess this should help
        https://github.com/pure-data/helloworld

        when building on Bela you will want to use at least

        make PDINCLUDEDIR=/usr/local/include/libpd/ 

        or

        make PD_INCLUDE=/usr/local/include/libpd/ 

        (or something similar, it really depends on your Makefile).
        so that it can find m_pd.h in /usr/local/include/libpd/.

        3 months later

        Hello,
        I think I have similar problem.
        I've uploaded and successfully compiled zexy on bella.
        Then I moved the compiled external to ~/Bela/projects/pd-externals/ , but my patch located on ~/Bela/projects/Bela-pd does not recognize zexy.
        I've tried also to put it into my patch folder, recompile all by doing ./bela-update which resets all and checked for libpd_add_to_search_path("../pd-externals"); in core/default_libpd_render.cpp.
        Still the problem exists.
        My board is up to date using master-dev branch.
        Please help.

        also, do you want to send me your .pd_linux binary so I can test in on my side?