Could we have special extension for double-precision external?
Something like foo.m_amd64dp ?
This way we can have external pkgs including both single and double externals.
Also instruct Pd to *not* try to load the not current precision and avoid crashes.
On 12/10/19 7:22 PM, Lucas Cordiviola wrote:
Could we have special extension for double-precision external?
Something like foo.m_amd64dp ?
This way we can have external pkgs including both single and double externals.
Also instruct Pd to *not* try to load the not current precision and avoid crashes.
actually, this is already kind-of-solved.
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
gmasdr IOhannes
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
~~~~~~~~~~~~~~~~~~
#include "m_pd.h"
#include <stdio.h> #include <stdarg.h>
#ifdef __WIN32__ # define vsnprintf _vsnprintf #endif
typedef struct liblucdep { t_object t_ob; } t_liblucdep;
t_class *liblucdep_class=NULL;
static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); }
void liblucdep_setup(void) {
post("*******************"); post("liblucdep loaded."); post("*******************");
liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0);
/* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); }
~~~~~~~~~~~~~~~~~
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
How is that?
As I am willing to contribute to the w32/64-double Deken.
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 9:45 PM, Lucas Cordiviola wrote:
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
what's the purpose of this? and what's the license?
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
could you provide a backtrace?
gmdsar IOhannes
On 12/10/2019 6:32 PM, IOhannes m zmölnig wrote:
On 12/10/19 9:45 PM, Lucas Cordiviola wrote:
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
what's the purpose of this? and what's the license?
Currently I share Pd-Albums (like CD albums, but these are played back with Pd) and there is a few externals i use and I ship (with licenses).
Now there are a lot of single files (for win/mac/linux) and i decided to compile them all into a single file per OS/ARCH and also for single and double.
These are going to be shipped also with sources and a makefile with pd-lib-builder.
So far all good except that my single binary crashes the unmatched precision.
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
could you provide a backtrace?
Windows tell me it's liblucdep.dll that produces the fault.
I'll try to get a backtrace with Msys2 but I never did it . I will investigate in Linux first.
:)
gmdsar IOhannes
Mensaje telepatico asistido por maquinas.
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
Is there an easier way?
If not, then a new extension could be handy, so people can throw both versions into the same folder.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
#include "m_pd.h" #include <stdio.h> #include <stdarg.h> #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif typedef struct liblucdep { t_object t_ob; } t_liblucdep; t_class *liblucdep_class=NULL; static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); } void liblucdep_setup(void) { post("*******************"); post("liblucdep loaded."); post("*******************"); liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0); /* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); } ~~~~~~~~~~~~~~~~~ > > # pkgs including both single- and double-precision externals > a single external binary (say: "foo.dll") can hold both single-precision > and double-precision variants of the [foo] object. How is that? As I am willing to contribute to the w32/64-double Deken. :) Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
@christof
How do I build Pd with debug symbols?
How do I install gdb in msys2?
How do I use it?
or can I send you the .dll lib and test patch do you get the backtrace?
--
Mensaje telepatico asistido por maquinas.
On 12/10/19 6:48 PM, Christof Ressi wrote:
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
Is there an easier way?
If not, then a new extension could be handy, so people can throw both versions into the same folder.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
#include "m_pd.h" #include <stdio.h> #include <stdarg.h> #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif typedef struct liblucdep { t_object t_ob; } t_liblucdep; t_class *liblucdep_class=NULL; static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); } void liblucdep_setup(void) { post("*******************"); post("liblucdep loaded."); post("*******************"); liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0); /* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); } ~~~~~~~~~~~~~~~~~ > # pkgs including both single- and double-precision externals > a single external binary (say: "foo.dll") can hold both single-precision > and double-precision variants of the [foo] object. How is that? As I am willing to contribute to the w32/64-double Deken. :) Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
How do I install gdb in msys2?
pacman -S gdb
Execute in MinGW32 shell and MINGW64 shell accordingly
How do I use it?
gdb --args pd [arguments]
run // actually run the program
... wait for crash ...
bt // get the backtrace
press Enter repeatedly to see more lines
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 22:59 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at, "Christof Ressi" christof.ressi@gmx.at Betreff: Re: [PD-dev] Double precision externals extensions.
@christof
How do I build Pd with debug symbols?
How do I install gdb in msys2?
How do I use it?
or can I send you the .dll lib and test patch do you get the backtrace?
--
Mensaje telepatico asistido por maquinas.
On 12/10/19 6:48 PM, Christof Ressi wrote:
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
Is there an easier way?
If not, then a new extension could be handy, so people can throw both versions into the same folder.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
#include "m_pd.h" #include <stdio.h> #include <stdarg.h> #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif typedef struct liblucdep { t_object t_ob; } t_liblucdep; t_class *liblucdep_class=NULL; static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); } void liblucdep_setup(void) { post("*******************"); post("liblucdep loaded."); post("*******************"); liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0); /* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); } ~~~~~~~~~~~~~~~~~ > # pkgs including both single- and double-precision externals > a single external binary (say: "foo.dll") can hold both single-precision > and double-precision variants of the [foo] object. How is that? As I am willing to contribute to the w32/64-double Deken. :) Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Thx
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:59 PM, Christof Ressi wrote:
How do I install gdb in msys2?
pacman -S gdb
Execute in MinGW32 shell and MINGW64 shell accordingly
How do I use it?
gdb --args pd [arguments]
run // actually run the program
... wait for crash ...
bt // get the backtrace
press Enter repeatedly to see more lines
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 22:59 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at, "Christof Ressi" christof.ressi@gmx.at Betreff: Re: [PD-dev] Double precision externals extensions.
@christof
How do I build Pd with debug symbols?
How do I install gdb in msys2?
How do I use it?
or can I send you the .dll lib and test patch do you get the backtrace?
--
Mensaje telepatico asistido por maquinas.
On 12/10/19 6:48 PM, Christof Ressi wrote:
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
Is there an easier way?
If not, then a new extension could be handy, so people can throw both versions into the same folder.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
#include "m_pd.h" #include <stdio.h> #include <stdarg.h> #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif typedef struct liblucdep { t_object t_ob; } t_liblucdep; t_class *liblucdep_class=NULL; static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); } void liblucdep_setup(void) { post("*******************"); post("liblucdep loaded."); post("*******************"); liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0); /* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); } ~~~~~~~~~~~~~~~~~ > # pkgs including both single- and double-precision externals > a single external binary (say: "foo.dll") can hold both single-precision > and double-precision variants of the [foo] object. How is that? As I am willing to contribute to the w32/64-double Deken. :) Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
This is the backtrace with Msys2:
~~~~~~~~~~~~~~~~~~
Program received signal SIGSEGV, Segmentation fault. 0x000000006eb469f5 in pddplink_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll (gdb) bt #0 0x000000006eb469f5 in pddplink_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll #1 0x000000006eb41467 in liblucdep_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll #2 0x00000000673e8c85 in sys_trylock () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #3 0x00000000673e9304 in sys_loadlib_iter () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #4 0x0000000067374ed5 in pd!canvas_declare () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #5 0x00000000673e95e8 in sys_load_lib () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #6 0x00000000673747d8 in pd!glist_menu_open () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #7 0x0000000067374c7d in pd!canvas_declare () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #8 0x00000000673d68db in pd!binbuf_eval () --Type <RET> for more, q to quit, c to continue without paging-- from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #9 0x00000000673d73f6 in pd!binbuf_evalfile () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #10 0x0000000067379977 in pd!glob_evalfile () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #11 0x00000000673e9789 in sys_run_scheduler () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #12 0x00000000673ea6ec in pd!glob_initfromgui () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #13 0x00000000673d68db in pd!binbuf_eval () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #14 0x00000000673e75bd in socketreceiver_read () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #15 0x00000000673e6906 in sys_oktoloadfiles () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll --Type <RET> for more, q to quit, c to continue without paging-- #16 0x00000000673e825b in sys_pollgui () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #17 0x00000000673dfdda in pd!m_mainloop () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #18 0x00000000004013b4 in ?? () #19 0x00000000004014db in ?? () #20 0x00007fffdec01611 in KERNEL32!BaseThreadInitThunk () from /c/Windows/system32/KERNEL32.DLL #21 0x00007fffdfb764ad in ntdll!RtlUserThreadStart () from /c/Windows/SYSTEM32/ntdll.dll #22 0x0000000000000000 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb)
~~~~~~~~~~~~~
Mensaje telepatico asistido por maquinas.
On 12/10/2019 8:07 PM, Lucas Cordiviola wrote:
Thx
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:59 PM, Christof Ressi wrote:
How do I install gdb in msys2?
pacman -S gdb
Execute in MinGW32 shell and MINGW64 shell accordingly
How do I use it?
gdb --args pd [arguments]
run // actually run the program
... wait for crash ...
bt // get the backtrace
press Enter repeatedly to see more lines
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 22:59 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at, "Christof Ressi" christof.ressi@gmx.at Betreff: Re: [PD-dev] Double precision externals extensions.
@christof
How do I build Pd with debug symbols?
How do I install gdb in msys2?
How do I use it?
or can I send you the .dll lib and test patch do you get the backtrace?
--
Mensaje telepatico asistido por maquinas.
On 12/10/19 6:48 PM, Christof Ressi wrote:
# pkgs including both single- and double-precision externals a single external binary (say: "foo.dll") can hold both single-precision and double-precision variants of the [foo] object.
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
Is there an easier way?
If not, then a new extension could be handy, so people can throw both versions into the same folder.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote:
# avoiding crashes an external that has been compiled with single-precision will not register objectclasses in a double-precision Pd - so the doubl-precision Pd will not know about those new objects and not crash while using them. same goes for the other way round.
I see with normal externals itt refuses to load and thats fine.
But I'm creating a single binary external with a collection of authors [zexy] [cyclone] [ggee] [pddplink] ...
I create a setup for the lib and is working *OK* in Pd-w64-32 but it crashed the double precision.
this is my wrapper setup:
#include "m_pd.h" #include <stdio.h> #include <stdarg.h> #ifdef __WIN32__ # define vsnprintf _vsnprintf #endif typedef struct liblucdep { t_object t_ob; } t_liblucdep; t_class *liblucdep_class=NULL; static void *liblucdep_new(void) { t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); return (x); } void liblucdep_setup(void) { post("*******************"); post("liblucdep loaded."); post("*******************"); liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, sizeof(t_liblucdep), 0, 0); /* ************************************** */ coll_setup(); comment_setup(); freeverb_tilde_setup(); glue_setup(); helplink_setup(); image_setup(); pddplink_setup(); pink_tilde_setup(); reson_tilde_setup(); tabminmax_setup(); time_setup(); z_tilde_setup(); } ~~~~~~~~~~~~~~~~~ > # pkgs including both single- and double-precision externals > a single external binary (say: "foo.dll") can hold both single-precision > and double-precision variants of the [foo] object. How is that? As I am willing to contribute to the w32/64-double Deken. :) Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
We must find out where exactly the segfault happens. You can either look up how to set breakpoints and step through the code, or use good 'ol printf debugging :-)
Gesendet: Mittwoch, 11. Dezember 2019 um 00:31 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at, "Christof Ressi" christof.ressi@gmx.at Betreff: Re: [PD-dev] Double precision externals extensions.
This is the backtrace with Msys2:
Program received signal SIGSEGV, Segmentation fault. 0x000000006eb469f5 in pddplink_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll (gdb) bt #0 0x000000006eb469f5 in pddplink_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll #1 0x000000006eb41467 in liblucdep_setup () from /d/00-lucarda-external-dep/out64single-new-cyc/lucdep/liblucdep.dll #2 0x00000000673e8c85 in sys_trylock () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #3 0x00000000673e9304 in sys_loadlib_iter () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #4 0x0000000067374ed5 in pd!canvas_declare () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #5 0x00000000673e95e8 in sys_load_lib () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #6 0x00000000673747d8 in pd!glist_menu_open () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #7 0x0000000067374c7d in pd!canvas_declare () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #8 0x00000000673d68db in pd!binbuf_eval () --Type <RET> for more, q to quit, c to continue without paging-- from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #9 0x00000000673d73f6 in pd!binbuf_evalfile () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #10 0x0000000067379977 in pd!glob_evalfile () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #11 0x00000000673e9789 in sys_run_scheduler () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #12 0x00000000673ea6ec in pd!glob_initfromgui () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #13 0x00000000673d68db in pd!binbuf_eval () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #14 0x00000000673e75bd in socketreceiver_read () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #15 0x00000000673e6906 in sys_oktoloadfiles () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll --Type <RET> for more, q to quit, c to continue without paging-- #16 0x00000000673e825b in sys_pollgui () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #17 0x00000000673dfdda in pd!m_mainloop () from /c/Users/Lucarda/Downloads/pure-data-double-precision/build4/pd-0.50.2-double/bin/pd.dll #18 0x00000000004013b4 in ?? () #19 0x00000000004014db in ?? () #20 0x00007fffdec01611 in KERNEL32!BaseThreadInitThunk () from /c/Windows/system32/KERNEL32.DLL #21 0x00007fffdfb764ad in ntdll!RtlUserThreadStart () from /c/Windows/SYSTEM32/ntdll.dll #22 0x0000000000000000 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb) ~~~~~~~~~~~~~ Mensaje telepatico asistido por maquinas. On 12/10/2019 8:07 PM, Lucas Cordiviola wrote: > Thx > > :) > > Mensaje telepatico asistido por maquinas. > > On 12/10/19 7:59 PM, Christof Ressi wrote: >>> How do I install gdb in msys2? >> pacman -S gdb >> >> Execute in MinGW32 shell and MINGW64 shell accordingly >> >>> How do I use it? >> gdb --args pd [arguments] >>> run // actually run the program >> ... wait for crash ... >>> bt // get the backtrace >> press Enter repeatedly to see more lines >> >> Christof >> >>> Gesendet: Dienstag, 10. Dezember 2019 um 22:59 Uhr >>> Von: "Lucas Cordiviola" <lucarda27@hotmail.com> >>> An: "pd-dev@lists.iem.at" <pd-dev@lists.iem.at>, "Christof Ressi" <christof.ressi@gmx.at> >>> Betreff: Re: [PD-dev] Double precision externals extensions. >>> >>> @christof >>> >>> How do I build Pd with debug symbols? >>> >>> How do I install gdb in msys2? >>> >>> How do I use it? >>> >>> or can I send you the .dll lib and test patch do you get the backtrace? >>> >>> >>> -- >>> >>> Mensaje telepatico asistido por maquinas. >>> >>> On 12/10/19 6:48 PM, Christof Ressi wrote: >>>>>> # pkgs including both single- and double-precision externals >>>>>> a single external binary (say: "foo.dll") can hold both single-precision >>>>>> and double-precision variants of the [foo] object. >>>> I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions). >>>> >>>> Is there an easier way? >>>> >>>> If not, then a new extension could be handy, so people can throw both versions into the same folder. >>>> >>>> Christof >>>> >>>>> Gesendet: Dienstag, 10. Dezember 2019 um 21:45 Uhr >>>>> Von: "Lucas Cordiviola" <lucarda27@hotmail.com> >>>>> An: "pd-dev@lists.iem.at" <pd-dev@lists.iem.at> >>>>> Betreff: Re: [PD-dev] Double precision externals extensions. >>>>> >>>>> On 12/10/2019 4:54 PM, IOhannes m zmölnig wrote: >>>>>> # avoiding crashes >>>>>> an external that has been compiled with single-precision will not >>>>>> register objectclasses in a double-precision Pd - so the doubl-precision >>>>>> Pd will not know about those new objects and not crash while using them. >>>>>> same goes for the other way round. >>>>> I see with normal externals itt refuses to load and thats fine. >>>>> >>>>> But I'm creating a single binary external with a collection of authors >>>>> [zexy] [cyclone] [ggee] [pddplink] ... >>>>> >>>>> I create a setup for the lib and is working *OK* in Pd-w64-32 but it >>>>> crashed the double precision. >>>>> >>>>> this is my wrapper setup: >>>>> >>>>> ~~~~~~~~~~~~~~~~~~ >>>>> >>>>> #include "m_pd.h" >>>>> >>>>> #include <stdio.h> >>>>> #include <stdarg.h> >>>>> >>>>> >>>>> #ifdef __WIN32__ >>>>> # define vsnprintf _vsnprintf >>>>> #endif >>>>> >>>>> >>>>> >>>>> typedef struct liblucdep { >>>>> t_object t_ob; >>>>> } t_liblucdep; >>>>> >>>>> t_class *liblucdep_class=NULL; >>>>> >>>>> >>>>> >>>>> >>>>> static void *liblucdep_new(void) >>>>> { >>>>> t_liblucdep *x = (t_liblucdep *)pd_new(liblucdep_class); >>>>> return (x); >>>>> } >>>>> >>>>> void liblucdep_setup(void) >>>>> { >>>>> >>>>> post("*******************"); >>>>> post("liblucdep loaded."); >>>>> post("*******************"); >>>>> >>>>> liblucdep_class = class_new(gensym("liblucdep"), liblucdep_new, 0, >>>>> sizeof(t_liblucdep), 0, 0); >>>>> >>>>> >>>>> /* ************************************** */ >>>>> coll_setup(); >>>>> comment_setup(); >>>>> freeverb_tilde_setup(); >>>>> glue_setup(); >>>>> helplink_setup(); >>>>> image_setup(); >>>>> pddplink_setup(); >>>>> pink_tilde_setup(); >>>>> reson_tilde_setup(); >>>>> tabminmax_setup(); >>>>> time_setup(); >>>>> z_tilde_setup(); >>>>> } >>>>> >>>>> >>>>> ~~~~~~~~~~~~~~~~~ >>>>> >>>>> >>>>>> # pkgs including both single- and double-precision externals >>>>>> a single external binary (say: "foo.dll") can hold both single-precision >>>>>> and double-precision variants of the [foo] object. >>>>> How is that? >>>>> >>>>> As I am willing to contribute to the w32/64-double Deken. >>>>> >>>>> >>>>> :) >>>>> >>>>> Mensaje telepatico asistido por maquinas. >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pd-dev mailing list >>>>> Pd-dev@lists.iem.at >>>>> https://lists.puredata.info/listinfo/pd-dev >>>>> >>>> _______________________________________________ >>>> Pd-dev mailing list >>>> Pd-dev@lists.iem.at >>>> https://lists.puredata.info/listinfo/pd-dev >> >> _______________________________________________ >> Pd-dev mailing list >> Pd-dev@lists.iem.at >> https://lists.puredata.info/listinfo/pd-dev > _______________________________________________ > Pd-dev mailing list > Pd-dev@lists.iem.at > https://lists.puredata.info/listinfo/pd-dev
I could get this from linux, at least is something:
~~~~~~~~~~~~~
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6170e93 in pddplink_setup () at pddp/pddplink.c:353
353 sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
~~~~~~~~~~~~~~~
But no worries is just an edge case. If I compile the lib without [pddplink] everything works on /single/ and fails correctly (no crashes) on /double/.
I can replace pddplink with [pdcontrol]
:)
On 12/10/19 8:53 PM, Christof Ressi wrote:
We must find out where exactly the segfault happens. You can either look up how to set breakpoints and step through the code, or use good 'ol printf debugging
Mensaje telepatico asistido por maquinas.
ah, now I see! class_new() returns a null pointer if the precision doesn't match. In pddplink_setup() they try to access members of the class instance, that's why you get a segfault. Just add a null pointer check and you're done.
Gesendet: Mittwoch, 11. Dezember 2019 um 02:07 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "pd-dev@lists.iem.at" pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
I could get this from linux, at least is something:
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6170e93 in pddplink_setup () at pddp/pddplink.c:353 353 sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
But no worries is just an edge case. If I compile the lib without [pddplink] everything works on /single/ and fails correctly (no crashes) on /double/.
I can replace pddplink with [pdcontrol]
:)
On 12/10/19 8:53 PM, Christof Ressi wrote:
We must find out where exactly the segfault happens. You can either look up how to set breakpoints and step through the code, or use good 'ol printf debugging
Mensaje telepatico asistido por maquinas.
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Thanks Christof now everything's fine and I learned how to use msys2 gdb compiling with "alldebug" with pd-lib-builder.
As for the "null pointer check" I just did this on pddplink_setup():
~~~~~~~~~~~~~~~~~
if (dirsym) { dirsym = pddplink_class->c_externdir; /* FIXME */ sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name); } else { dirsym = NULL; }
~~~~~~~~~~~~~~~~~
This is working for not crashing the incorrect precision Pd.
Side-note:
I can not statically link pthread (used by cyclon/coll) when compiling the lib with "make CPPFLAGS="-DPD_FLOATSIZE=64""
:(
Mensaje telepatico asistido por maquinas.
On 12/10/2019 10:29 PM, Christof Ressi wrote:
ah, now I see! class_new() returns a null pointer if the precision doesn't match. In pddplink_setup() they try to access members of the class instance, that's why you get a segfault. Just add a null pointer check and you're done.
Am 11. Dezember 2019 17:32:40 MEZ schrieb Lucas Cordiviola
if (dirsym) { dirsym = pddplink_class->c_externdir; /* FIXME */ sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name); } else { dirsym = NULL; }
this is bogus. you set dirsym to NULL if it's already NULL (the default) and to something if it already points to something.
the proper condition is: if(pddplink_class) { dirsym=... } else { dirsym=NULL; }
mfg.hft.fsl IOhannes
On 12/11/2019 2:36 PM, IOhannes m zmölnig wrote:
the proper condition is: if(pddplink_class) { dirsym=... } else { dirsym=NULL; }
Ok right, I posted what i did because I was not sure. Had fixed it :)
Coming back to the subject of this thread:
The combined single/double dll is a bit complicated (for example for me to just upload double precision versions of the so many unmaintained libs that I have been uploading to Deken this last year (almost all w64 Deken).
Could we leave the combined dll just for experts and have a new defaults for double-precision?
Also this will shorten the possibilities of a crash. We don't want to go thru all sources and check if there's something like in pddplink.c that will cause a crash.
Also: You mention some time ago (when pd-w64 was released) the possibility to generate a "file" at compile time that stores current arch build. This file gets the "platform detected" info sooner than deken. We can also have the "precision" in that generated "file".
?
Mensaje telepatico asistido por maquinas.
On 12/10/19 10:48 PM, Christof Ressi wrote:
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
that's about the idea.
gdsa r IOhannes
I get the segfault on linux (it also crashes Pd-double)
~~~~~~~~~~~
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6170e93 in pddplink_setup () from /home/lucarda/Desktop/luclibdep/00-lucarda-external-dep/out64single/lucdep/liblucdep.so
~~~~~~~~~~~~~~~
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:06 PM, IOhannes m zmölnig wrote:
On 12/10/19 10:48 PM, Christof Ressi wrote:
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
that's about the idea.
gdsa r IOhannes
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Is this: "A_FLOAT" forbidden?
~~~~~
void pddplink_setup(void)
{
t_symbol *dirsym;
pddplink_class = class_new(gensym("pddplink"),
(t_newmethod)pddplink_new,
(t_method)pddplink_free,
sizeof(t_pddplink),
CLASS_NOINLET | CLASS_PATCHABLE,
A_GIMME, 0);
class_addanything(pddplink_class, pddplink_anything);
class_setwidget(pddplink_class, &pddplink_widgetbehavior);
pddplinkbox_class = class_new(gensym("pddplink"), 0,
(t_method)pddplink_free,
sizeof(t_pddplink), 0, A_GIMME, 0);
class_addbang(pddplinkbox_class, pddplink_bang);
class_addanything(pddplinkbox_class, pddplink_anything);
class_addmethod(pddplinkbox_class, (t_method)pddplink_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
dirsym = pddplink_class->c_externdir; /* FIXME */
sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
}
~~~~~
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:30 PM, Lucas Cordiviola wrote: I get the segfault on linux (it also crashes Pd-double)
~~~~~~~~~~~
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6170e93 in pddplink_setup () from /home/lucarda/Desktop/luclibdep/00-lucarda-external-dep/out64single/lucdep/liblucdep.so
~~~~~~~~~~~~~~~
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:06 PM, IOhannes m zmölnig wrote: On 12/10/19 10:48 PM, Christof Ressi wrote: I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
that's about the idea.
gdsa r IOhannes
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.atmailto:Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Ok. So why do I get a segfault on linux and a crash on windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void pddplink_setup(void)
{
t_symbol *dirsym;
pddplink_class = class_new(gensym("pddplink"),
(t_newmethod)pddplink_new,
(t_method)pddplink_free,
sizeof(t_pddplink),
CLASS_NOINLET | CLASS_PATCHABLE,
A_GIMME, 0);
class_addanything(pddplink_class, pddplink_anything);
class_setwidget(pddplink_class, &pddplink_widgetbehavior);
pddplinkbox_class = class_new(gensym("pddplink"), 0,
(t_method)pddplink_free,
sizeof(t_pddplink), 0, A_GIMME, 0);
class_addbang(pddplinkbox_class, pddplink_bang);
class_addanything(pddplinkbox_class, pddplink_anything);
class_addmethod(pddplinkbox_class, (t_method)pddplink_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
dirsym = pddplink_class->c_externdir; /* FIXME */
sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:45 PM, Christof Ressi wrote:
Is this: "A_FLOAT" forbidden?
I'm not sure what you mean exactly, but A_FLOAT is an atom type, so it's 100% unrelated to single/double precision. *Gesendet:* Dienstag, 10. Dezember 2019 um 23:37 Uhr *Von:* "Lucas Cordiviola" lucarda27@hotmail.com *An:* "pd-dev@lists.iem.at" pd-dev@lists.iem.at *Betreff:* Re: [PD-dev] Double precision externals extensions.
Is this: "A_FLOAT" forbidden?
void pddplink_setup(void) { t_symbol *dirsym; pddplink_class = class_new(gensym("pddplink"), (t_newmethod)pddplink_new, (t_method)pddplink_free, sizeof(t_pddplink), CLASS_NOINLET | CLASS_PATCHABLE, A_GIMME, 0); class_addanything(pddplink_class, pddplink_anything); class_setwidget(pddplink_class, &pddplink_widgetbehavior); pddplinkbox_class = class_new(gensym("pddplink"), 0, (t_method)pddplink_free, sizeof(t_pddplink), 0, A_GIMME, 0); class_addbang(pddplinkbox_class, pddplink_bang); class_addanything(pddplinkbox_class, pddplink_anything); class_addmethod(pddplinkbox_class, (t_method)pddplink_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); dirsym = pddplink_class->c_externdir; /* FIXME */ sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name); }
Mensaje telepatico asistido por maquinas. On 12/10/19 7:30 PM, Lucas Cordiviola wrote:
I get the segfault on linux (it also crashes Pd-double) ~~~~~~~~~~~ Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6170e93 in pddplink_setup () from /home/lucarda/Desktop/luclibdep/00-lucarda-external-dep/out64single/lucdep/liblucdep.so ~~~~~~~~~~~~~~~ :) Mensaje telepatico asistido por maquinas. On 12/10/19 7:06 PM, IOhannes m zmölnig wrote: On 12/10/19 10:48 PM, Christof Ressi wrote: I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions). that's about the idea. gdsa r IOhannes _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
I mean this works fine on linux and windows single-precision but this single-precision lib crashes Pd-double in win and linux.
?
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:50 PM, Lucas Cordiviola wrote:
Ok. So why do I get a segfault on linux and a crash on windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void pddplink_setup(void)
{
t_symbol *dirsym;
pddplink_class = class_new(gensym("pddplink"),
(t_newmethod)pddplink_new,
(t_method)pddplink_free,
sizeof(t_pddplink),
CLASS_NOINLET | CLASS_PATCHABLE,
A_GIMME, 0);
class_addanything(pddplink_class, pddplink_anything);
class_setwidget(pddplink_class, &pddplink_widgetbehavior);
pddplinkbox_class = class_new(gensym("pddplink"), 0,
(t_method)pddplink_free,
sizeof(t_pddplink), 0, A_GIMME, 0);
class_addbang(pddplinkbox_class, pddplink_bang);
class_addanything(pddplinkbox_class, pddplink_anything);
class_addmethod(pddplinkbox_class, (t_method)pddplink_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
dirsym = pddplink_class->c_externdir; /* FIXME */
sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:45 PM, Christof Ressi wrote:
Is this: "A_FLOAT" forbidden?
I'm not sure what you mean exactly, but A_FLOAT is an atom type, so it's 100% unrelated to single/double precision. *Gesendet:* Dienstag, 10. Dezember 2019 um 23:37 Uhr *Von:* "Lucas Cordiviola" lucarda27@hotmail.commailto:lucarda27@hotmail.com *An:* "pd-dev@lists.iem.at"mailto:pd-dev@lists.iem.at pd-dev@lists.iem.atmailto:pd-dev@lists.iem.at *Betreff:* Re: [PD-dev] Double precision externals extensions.
Is this: "A_FLOAT" forbidden?
~~~~~
void pddplink_setup(void)
{
t_symbol *dirsym;
pddplink_class = class_new(gensym("pddplink"),
(t_newmethod)pddplink_new,
(t_method)pddplink_free,
sizeof(t_pddplink),
CLASS_NOINLET | CLASS_PATCHABLE,
A_GIMME, 0);
class_addanything(pddplink_class, pddplink_anything);
class_setwidget(pddplink_class, &pddplink_widgetbehavior);
pddplinkbox_class = class_new(gensym("pddplink"), 0,
(t_method)pddplink_free,
sizeof(t_pddplink), 0, A_GIMME, 0);
class_addbang(pddplinkbox_class, pddplink_bang);
class_addanything(pddplinkbox_class, pddplink_anything);
class_addmethod(pddplinkbox_class, (t_method)pddplink_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
dirsym = pddplink_class->c_externdir; /* FIXME */
sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);
}
~~~~~
Mensaje telepatico asistido por maquinas. On 12/10/19 7:30 PM, Lucas Cordiviola wrote:
I get the segfault on linux (it also crashes Pd-double)
~~~~~~~~~~~
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6170e93 in pddplink_setup () from /home/lucarda/Desktop/luclibdep/00-lucarda-external-dep/out64single/lucdep/liblucdep.so
~~~~~~~~~~~~~~~
:)
Mensaje telepatico asistido por maquinas.
On 12/10/19 7:06 PM, IOhannes m zmölnig wrote:
On 12/10/19 10:48 PM, Christof Ressi wrote:
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
that's about the idea.
gdsa r IOhannes
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.atmailto:Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.atmailto:Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.atmailto:Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.atmailto:Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
pretty complicated for many people, I guess. Maybe there's a way to automate this?
One idea:
add a macro for setup functions:
#ifdef DOUBLEBUILD #define SETUP(setup) ... // mangle "setup" based on PD_FLOATSIZE #else #define SETUP(setup) setup #endif
add another macro:
#if defined(DOUBLEBUILD) && PD_FLOATSIZE == 32 #define EXPORT(setup) EXTERN void setup { ... call both setup functions ... } // only export in one file #else #define EXPORT(setup) EXTERN void setup; // just redeclare as extern #endif
Usage:
void SETUP(foo_setup) { ... }
EXPORT(foo_setup)
If you define DOUBLEBUILD, compile the .c file two times (one with -DPD_FLOATSIZE=32 and the other with -DPD_FLOATSIZE=64) and link both .o files, you get a single exported setup function which calls both private setup functions. This could be done automatically by pd-lib-builder when requested.
Just some brainstorming.
Christof
Gesendet: Dienstag, 10. Dezember 2019 um 23:06 Uhr Von: "IOhannes m zmölnig" zmoelnig@iem.at An: pd-dev@lists.iem.at Betreff: Re: [PD-dev] Double precision externals extensions.
On 12/10/19 10:48 PM, Christof Ressi wrote:
I'm also interested in how this works. The following solution popped up in my head: compile the object twice, one time with -DPD_FLOATSIZE=32 and another time with -DPD_FLOATSIZE=64, with different setup functions based on -DPD_FLOATSIZE, then link it with a third file which exports the "real" setup function (which calls the other two private setup functions).
that's about the idea.
gdsa r IOhannes
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev