cmm Important to note that you need to include the cyclone/ part of the object name..I wouldn't have thought of that.

yes I mentioned it up here

giuliomoro (e.g.: [cyclone/delay~]),

This is due to the folder structure of the Cyclone externals: all the externals live as file in the cyclone/ folder. If you want, you can add another line

	libpd_add_to_search_path("../pd-externals/cyclone");

to the core/default_libpd_render.cpp file, https://github.com/BelaPlatform/Bela/blob/master/core/default_libpd_render.cpp#L382-L383, if you want the setting to be applied to all your projects, or provide a custom render.cpp file with this change if you want it to be applied only to a specific project.

  • cmm replied to this.

    giuliomoro yeah, I would have been lost if you hadn't said that, I was going in circles until I remembered your post. It's not something I've ever needed to do in Pd before.

    You have to do it also in Pd unless you set up the path in the preferences.

    12 days later

    giuliomoro Hi, could you exactly explain how to do that? it doesn't seem to work for me...i have a patch .pd with a external library object; which file should i place inside projects/pd-externals? the .c or the .pd_linux? At the moment neither is working for me...

    It's always the .pd_linux that needs to go in projects/pd-externals. If you have a library external, then you have to create an object with the name of the library FIRST, then you can create all the objects from the library. For instance:

    [zexy]

    then

    [pack~]

    CAVEAT: the main library object ([zexy]) needs to be created BEFORE you try to create the individual objects. The order in which objects are created is the order in which they are in the plain-text representation of the Pd patch. Basically, there is no way of telling just by looking at the patch, and you cannot arbitrarily move them around in the text file. So the solution is: cut everything except the main library object, then paste everything: the newly pasted objects will be created by Pd after whatever was there.

    Alternatively, the proper way of doing it should be: [declare -lib zexy], but I have not tested this on Bela.

      giuliomoro So if i am using cyclone for example i will need cyclone.pd_linux plus object.pd_linux for each object i need? I tried to compile in the IDE the cyclone_lib.c file and it generated a cyclone_lib.pd_linux but it still prompts the same error: couldn't create...

      Would you mind posting the process in steps or something similar?

        londonpride I also tried to do it without the library object.
        - uploaded the object.c
        - uploaded a Makefile specific for the object.
        - uploaded the needed headers and run the makefile in the IDE console.
        Worked like a charm for some objects but others would still prompt: couldn't create...

          londonpride Worked like a charm for some objects but others would still prompt: couldn't create...

          What objects fail to create?

          londonpride uploaded a Makefile specific for the object.

          How did you generate the Makefile?

          londonpride Would you mind posting the process in steps or something similar?

          Was this not good enough?

            giuliomoro i compiled [cyclone/cycle~] using the .c source code and worked perfectly, [cyclone/gate~] on the other hand compiled and created the .pd_linux file but would still fail to generate.
            I created the makefile in sublime text and it worked for [cyclone/cycle~]
            I am sorry if you misunderstood my asking for the steps, i didn't mean to diminish your explanation or anything is just that i am a bit of a newbie using pd on bela. I've only worked with c++ on bela before.

            What is in these Makefiles? Why don't you use the one that comes with the project?

            a month later

            Hello, I'm having a few issues compiling pd externals. I've worked through this post without success and I eventually found this very helpful guide: https://forum.bela.io/d/580-compiling-pd-externals-a-guide which clears most things up.

            However, I'm still getting errors - "make: *** No targets specified and no makefile found. Stop" for [cyclone], [comport] and [list-abs] objects. I read the post above on [cyclone] and have taken the following steps:

            • Updated Bela code
            • 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'

            But I'm getting "make: *** No rule to make target "install". Stop.

            Any ideas?

              Great, thanks. Managed to successfully compile [cyclone] and [list-abs] objects now.

              Having a slight issue with the cyclone -- coll object though. It turns the project window blank (although it doesn't say 'couldn't create' in the console). Not sure what's going on with it.

              Also I haven't managed to compile the [comport] object. I can't find a Makefile for it. But in the readme file it says:

              compile:
              
               Unix (Linux):   
                make pd_linux,  make pd_irix5, make pd_irix6, make pd_darwin
                should produce a comport.pd_linux, .... 

              this is all new to me so not really sure what to do with that... do I still need a makefile from somewhere?

                Where is the source code for the [comport] object?

                emerson Having a slight issue with the cyclone -- coll object though. It turns the project window blank (although it doesn't say 'couldn't create' in the console). Not sure what's going on with it.

                I cannot reproduce this. Can you send the Pd file?

                Ok, so now got the source code for [comport] from the puredata.info site, which has a make file in it. Copied the new comport folder to the pd-externals folder on Bela but getting:

                Makefile:191: recipe for target 'comport.o' failed
                make: *** [comport.o] Error 1
                root@bela:~/Bela/projects/pd-externals/pd-comport# make PD_INCLUDE=/root/Bela/projects/pd-externals
                 -I"/root/Bela/projects/pd-externals/pd" -Wall -W -g -DPD -DVERSION='"0.2"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -o "comport.o" -c "comport.c"
                comport.c:24:18: fatal error: m_pd.h: No such file or directory
                 #include "m_pd.h"
                                  ^
                compilation terminated.
                Makefile:191: recipe for target 'comport.o' failed 

                for whatever I try. It says to use PD_INCLUDE = $(PD_PATH)/include in the make file.

                I tried:
                make PD_INCLUDE=/usr/local/include/libpd/
                make PD_INCLUDE=/root/Bela/projects/pd-externals install
                make PD_INCLUDE=/usr/local/include/libpd PDLIBDIR=/root/Bela/projects/pd-externals install
                make PD_INCLUDE=/root/pure-data/src/ PDLIBDIR=/root/Bela/projects/pd-externals install
                make PDINCLUDEDIR=/root/pure-data/src/ PDLIBDIR=/root/Bela/projects/pd-externals install

                This is what's in the [comport] folder:

                CHANGES.txt  Makefile    comport-help.pd  comport-stress-test.pd  comport.dsp  
                comport.pd_darwin LICENSE.txt  README.txt  comport-meta.pd  comport.c               
                comport.dsw  makefile_win

                can you link to the source code? I struggle to find it on the website. Is it the "get comport for all platforms" download link from https://puredata.info/downloads/comport/releases/0.2 ?

                Inspecting the Makefile in there, there is one line:

                CFLAGS = -I"$(PD_INCLUDE)/pd" -Wall -W -g

                so it seems to append /pd to whatever value you give to PD_INCLUDE=. I'd recommend you edit the Makefile and remove that /pd so you can pass the correct path straight from the command line.

                Additionally, PDLIBDIR= is not taken into consideration by this Makefile, and the paths used for the install target are a bit complicated. I'd recommend you just manually copy the generated comport.pd_linux file to ~/Bela/projects/pd-externals/.

                  Here's the pd patch for the cyclone/coll object. I put the Coll object in the patch first, if that makes a difference? Sorry to post so many probs!

                  #N canvas 771 243 450 300 10;
                  #X obj 18 161 cyclone/coll;
                  #C restore;
                  #X obj 16 192 print coll;
                  #X obj 34 24 loadbang;
                  #X msg 36 49 in 11;
                  #X obj 37 74 s bela_setDigital;
                  #X obj 70 102 r bela_digitalIn11;
                  #X msg 68 126 next;
                  #X msg 19 128 1;
                  #X connect 0 0 1 0;
                  #X connect 2 0 3 0;
                  #X connect 2 0 7 0;
                  #X connect 3 0 4 0;
                  #X connect 5 0 6 0;
                  #X connect 6 0 0 0;
                  #X connect 7 0 0 0;

                  Here's what happens when I run the patch in the IDE:

                  alt text

                  How do you generate that patch? With Pd vanilla? Pd vanilla does not recognize the #C restore; line, so maybe that is what is crashing the preview in the browser? Either way, it's not a big deal: you only miss the preview, but the patch will still run fine. The two things are separate.

                    giuliomoro Yes that's the link to the source code I used. Thanks for the advice on the make file, I'll give that a try.

                      giuliomoro Ha, good to know, thanks. I thought the patch wasn't running properly because it wasn't printing the coll data to the console....but just figured out it's because I forgot to include the .txt file in the Bela project!! All sorted now, thanks.