Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version. From what I remember, I installed msys2 and could only compile using the 32 bit version. Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac.
That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied).
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly.
Cheers, Joseph
Le 08/11/18 à 09:45, pd-list-request@lists.iem.at a écrit :
Date: Thu, 8 Nov 2018 08:10:20 +0000 From: Lucas Cordiviolalucarda27@hotmail.com To:"pd-list@iem.at" pd-list@iem.at, PD ANNOUNCE pd-announce@iem.at Subject: Re: [PD] [PD-announce] jl lib Message-ID: BN3PR01MB195634EA43279FC18018FF97A6C50@BN3PR01MB1956.prod.exchangelabs.com
Content-Type: text/plain; charset="utf-8"
On 11/7/2018 1:07 PM, Joseph Larralde wrote: I'd be glad to hear any kind of feedback if you give it a try.
Hi Joseph,
Some feedback:
I tried compiling the .dek sources for windows64bit and found trouble and solution:
On "Makefile" line 69 I changed "=" to "+=" :
cflags = -std=c++11
to
cflags += -std=c++11
Now all objects compile fine.
Now when I open "gbend~-help.pd" i get this error on the console:
An operation on the array 'flatten-table' in the patch 'flatten-table' failed since it uses garray_getfloatarray while running 64-bit! An operation on the array 'aaa' in the patch 'aaa' failed since it uses garray_getfloatarray while running 64-bit!
I think this is somehow the same problem that happened to CXC and there is a debian patch file (attached) that might give you clues on how to fix it. i.e:
- float *x_vec;
- t_word *x_vec;
- else if (!garray_getfloatarray(a, &x->x_nsampsintab, &x->x_vec))
- else if (!garray_getfloatwords(a, &x->x_nsampsintab, &x->x_vec))
:)
Mensaje telepatico asistido por maquinas.
On 11/8/2018 10:00 AM, Joseph Larralde wrote: Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version. From what I remember, I installed msys2 and could only compile using the 32 bit version.
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: C:\Program Files (x86)\pd 64bit: C:\Program Files\pd If you like you can specify any other dir when calling make: make PDDIR=your/path/to/pd
On Msys2 you have to install the 64bit compiler (you probably did) : pacman -S mingw64/mingw-w64-x86_64-gcc
Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac. Just curious: you don't get the "failed since it uses garray_getfloatarray while running 64-bit!" on OSX 64bit Pd?
That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied).
I opened "jl-objects.pd" and all objects get created, then i started testing at random and when I opened "gbend~" help I spotted the error in the console.
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly.
I wish I could help you more but C code is not for me yet.
Cheers, Joseph
Mensaje telepatico asistido por maquinas.
If one can just cast a t_word into a float or a double, things should go smoothly.
the proper way is to access the union member of t_word, e.g.:
myarray[0].w_float;
Gesendet: Donnerstag, 08. November 2018 um 14:40 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "Joseph Larralde" joseph.larralde@gmail.com, "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
On 11/8/2018 10:00 AM, Joseph Larralde wrote:Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version.
From what I remember, I installed msys2 and could only compile using the 32 bit version.
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: C:\Program Files (x86)\pd 64bit: C:\Program Files\pd If you like you can specify any other dir when calling make: make PDDIR=your/path/to/pd
On Msys2 you have to install the 64bit compiler (you probably did) : pacman -S mingw64/mingw-w64-x86_64-gcc Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac.Just curious: you don't get the "failed since it uses garray_getfloatarray while running 64-bit!" on OSX 64bit Pd? That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied). I opened "jl-objects.pd" and all objects get created, then i started testing at random and when I opened "gbend~" help I spotted the error in the console. I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly. I wish I could help you more but C code is not for me yet. Cheers, Joseph Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hmmm, that's what I was fearing. In my c++ lib I read the buffers/tables contents passing them as pointers to floats/doubles. I'm not sure I can do this anymore with t_words, without either copying the whole buffer to provide a simple pointer to it, or modifying the c++ API in some other way, using getters ore some other trick.
Le 08/11/18 à 15:12, Christof Ressi a écrit :
If one can just cast a t_word into a float or a double, things should go smoothly.
the proper way is to access the union member of t_word, e.g.:
myarray[0].w_float;
Gesendet: Donnerstag, 08. November 2018 um 14:40 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "Joseph Larralde" joseph.larralde@gmail.com, "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
On 11/8/2018 10:00 AM, Joseph Larralde wrote:Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version.
From what I remember, I installed msys2 and could only compile using the 32 bit version.
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: C:\Program Files (x86)\pd 64bit: C:\Program Files\pd If you like you can specify any other dir when calling make: make PDDIR=your/path/to/pd
On Msys2 you have to install the 64bit compiler (you probably did) : pacman -S mingw64/mingw-w64-x86_64-gcc Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac.Just curious: you don't get the "failed since it uses garray_getfloatarray while running 64-bit!" on OSX 64bit Pd?
That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied). I opened "jl-objects.pd" and all objects get created, then i started testing at random and when I opened "gbend~" help I spotted the error in the console.
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly. I wish I could help you more but C code is not for me yet.
Cheers, Joseph
Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
in your case, casting definitly won't work in 64 bit Pd because a t_word is 64bit (the largest union member is a pointer) while a float is only 32 bit, so every other float would be garbage.
you *could* introduce an optional stride value in bytes to your API by which you advance the pointers. but I would start with simply copying the array data and profile.
Gesendet: Donnerstag, 08. November 2018 um 16:50 Uhr Von: "Joseph Larralde" joseph.larralde@gmail.com An: "Christof Ressi" christof.ressi@gmx.at, Pd-List pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
Hmmm, that's what I was fearing. In my c++ lib I read the buffers/tables contents passing them as pointers to floats/doubles. I'm not sure I can do this anymore with t_words, without either copying the whole buffer to provide a simple pointer to it, or modifying the c++ API in some other way, using getters ore some other trick.
Le 08/11/18 à 15:12, Christof Ressi a écrit :
If one can just cast a t_word into a float or a double, things should go smoothly.
the proper way is to access the union member of t_word, e.g.:
myarray[0].w_float;
Gesendet: Donnerstag, 08. November 2018 um 14:40 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "Joseph Larralde" joseph.larralde@gmail.com, "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
On 11/8/2018 10:00 AM, Joseph Larralde wrote:Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version.
From what I remember, I installed msys2 and could only compile using the 32 bit version.
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: C:\Program Files (x86)\pd 64bit: C:\Program Files\pd If you like you can specify any other dir when calling make: make PDDIR=your/path/to/pd
On Msys2 you have to install the 64bit compiler (you probably did) : pacman -S mingw64/mingw-w64-x86_64-gcc Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac.Just curious: you don't get the "failed since it uses garray_getfloatarray while running 64-bit!" on OSX 64bit Pd?
That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied). I opened "jl-objects.pd" and all objects get created, then i started testing at random and when I opened "gbend~" help I spotted the error in the console.
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly. I wish I could help you more but C code is not for me yet.
Cheers, Joseph
Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Ok, this confirms umlaeute's PR and comments on my github repo. His PR uses the garray_getfloatwords function and copies the contents to a float array to make it accessible to the c++ code. It works very well (at least on my osx 32 bit pd), but I really dislike the waste of CPU it takes to duplicate all this data. umlaeute also pointed me to a stride-based solution, which I think is the good direction to follow, so this is what I'm considering right now. Thanks to both of you for this very useful and cross-validated tip :)
Le 08/11/18 à 17:54, Christof Ressi a écrit :
in your case, casting definitly won't work in 64 bit Pd because a t_word is 64bit (the largest union member is a pointer) while a float is only 32 bit, so every other float would be garbage.
you *could* introduce an optional stride value in bytes to your API by which you advance the pointers. but I would start with simply copying the array data and profile.
Gesendet: Donnerstag, 08. November 2018 um 16:50 Uhr Von: "Joseph Larralde" joseph.larralde@gmail.com An: "Christof Ressi" christof.ressi@gmx.at, Pd-List pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
Hmmm, that's what I was fearing. In my c++ lib I read the buffers/tables contents passing them as pointers to floats/doubles. I'm not sure I can do this anymore with t_words, without either copying the whole buffer to provide a simple pointer to it, or modifying the c++ API in some other way, using getters ore some other trick.
Le 08/11/18 à 15:12, Christof Ressi a écrit :
If one can just cast a t_word into a float or a double, things should go smoothly.
the proper way is to access the union member of t_word, e.g.:
myarray[0].w_float;
Gesendet: Donnerstag, 08. November 2018 um 14:40 Uhr Von: "Lucas Cordiviola" lucarda27@hotmail.com An: "Joseph Larralde" joseph.larralde@gmail.com, "pd-list@lists.iem.at" pd-list@lists.iem.at Betreff: Re: [PD] [PD-announce] jl lib
On 11/8/2018 10:00 AM, Joseph Larralde wrote:Hi Lucas,
Thanks a lot for the hints !
I'm curious to know how you compiled the win64 version.
From what I remember, I installed msys2 and could only compile using the 32 bit version.
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: C:\Program Files (x86)\pd 64bit: C:\Program Files\pd If you like you can specify any other dir when calling make: make PDDIR=your/path/to/pd
On Msys2 you have to install the 64bit compiler (you probably did) : pacman -S mingw64/mingw-w64-x86_64-gcc Later I added the [tonnetz] object to the library and had to add the "cflags = -std=c++11" line in the makefile in order for it to compile (because of some c++ vector initializers I introduced in my underlying c++ lib). Then I didn't push my investigations forward because ATM I was happy enough with the windows 32 bit version and had a working fat external for mac.Just curious: you don't get the "failed since it uses garray_getfloatarray while running 64-bit!" on OSX 64bit Pd?
That's good to know that I just need to add a "+" to the makefile to get the lib to compile for windows 64 bit, and, apparently, to get all objects to work except gbend~ (if I understood correctly what you implied). I opened "jl-objects.pd" and all objects get created, then i started testing at random and when I opened "gbend~" help I spotted the error in the console.
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly. I wish I could help you more but C code is not for me yet.
Cheers, Joseph
Mensaje telepatico asistido por maquinas. _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Le 08/11/18 à 14:40, Lucas Cordiviola a écrit :
pd-lib-builder is ready to use 32 and 64 bit Pds if they are in the default location:
32bit: /C:\Program Files (x86)\pd/ 64bit: /C:\Program Files\pd/ If you like you can specify any other dir when calling make: /make PDDIR=your/path/to/pd/
On Msys2 you have to install the 64bit compiler (you probably did) : /pacman -S mingw64/mingw-w64-x86_64-gcc/
I don't remember what I did exactly, but I think I postponed worrying about 64 bit builds at some point because of the getfloatarray issue ...
Just curious: you don't get the "/failed since it uses garray_getfloatarray while running 64-bit!/" on OSX 64bit Pd?
My bad, indeed I get it on OSX 64bit Pd. I don't know why I assumed I didn't. Not enough testing ... Things are getting more clear now, and I will definitely wrap my head around this issue asap.
On 08.11.18 14:00, Joseph Larralde wrote:
I'll try the changes that you suggested. I hope I won't have to rewrite a part of my underlying lib's API. If one can just cast a t_word into a float or a double, things should go smoothly.
i've submitted a PR to fix this.