New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Co-installable double-builds #1995
Conversation
the basic workflow I imagine is like this:
typically i would build the single- and double-precision version either on two independent machines (for the CI), or in two separate build directories (locally):
ping @Lucarda for testing. the Windows installer-builder ( |
09fa87d
to
2df4355
Compare
fafanfantafantastic!I builded with:
It works like a charm. :) I had also tested the GUI startup pref. This is wonderful! |
This comment was marked as resolved.
This comment was marked as resolved.
tested and it seems great now other than testing the 3.audio.examples/B15.tabread4~-onset example I don't know how to check in a patch wether we have a different precision. I thought number boxes would show larger numbers or more digits, but they still have the same look (and shouldn't it be different tough?). Any other hints? |
This comment was marked as resolved.
This comment was marked as resolved.
@porres they look pretty much the same (i never picked katja's formatting changes for double-precision).
|
@umlaeute I was about to report on this. I thought I would get an error but I got a crash while loading a
crash. I'm on note that in this path there's no file |
yikes. this probably means that the entire idea of having a
possibly we need to ressort to a different filesystem-scheme, like
|
I’d suggest bin64 if you go with separate folders.
|
@danomatika yes of course @Lucarda could you check, whether removing the |
Yes. renaming or moving the file fixes the crash. |
One simple thing that we can do is rename the
then some magic has to be done so that the GUI handles starting the right stuff. The Windows installed app always start wish8*.exe from the |
if we rename the directory, there's no need to rename the binary (with that is, it should be as simple as ./configure --with-floatsize=64
make app bindir='${exec_prefix}/bin64' |
I'm going to test build that right now. |
I would really try to avoid having different naming schemes on different platforms ( I am sure this has been discussed already, but why don't we have a dedicated mandatory file extension for double precision externals? (FWIW, SuperCollider does this to distinguish Another big advantage: single-precision and double-precision externals could co-exist and even be shipped as a single Deken package. What are the downsides? (Alternatively, we could have a different name of the setup function. Although this could be done with a simple macro, it would require slight modification of all existing external sources...) Generally, I think it is the responsibility of the host application to only select suitable plugins - and not just load optimistically and let it error out. (The PS: How do you currently deal with the |
it turns out we have:
if I start @Spacechild1 said
I agree with this. I'll be offline for a couple of hours. |
9214be3
to
3c0c8ac
Compare
with the current scheme, they can co-exist and even be shipped as a single deken package.
i'm sure i said this before, but: this just doesn't work.
they ship with different extensions.
it adds additional technical debt to the host application. |
Wouldn't this require different setup functions? I think it was actually me who had this idea. My thought was that you could just compile the source twice and then link it together; you would have to use a macro around the setup function which would expand to a different name for the double-precision version.
Sorry, maybe I am stupid or not up to date, but let's say I have a 64-bit Windows external
To be clear: I am talking about the entry point of the external. Every external binary has a (single) entry point. Or can you point me to an exception? |
One nice thing about a new mandatory extension for double precision externals would be that we could just ignore all the legacy extensions and only allow a single possible extension, e.g. |
the file extension as layed out for now is what i do not want to add is specific code to check whether this is a double-precision build and skip extensions based on that info. |
it's easy to use other methods than the entry point to execute code.
no. |
Ah, so we do have dedicated file extensions for single/double precisions.
But - why not? In my naive view, everything you'd have to do is use an IMO if we already have a dedicated file extensions, it would be dumb to not use it for filtering... Why keep the myriads of extensions if we have the chance to make a clean break? |
No. It is not legal to do this. You cannot even expect Pd to be fully initialized at the time the global construtor runs, e.g. if the plugin is linked statically. You must not call any Pd API function before the setup function.
Ah, right, makes sense. |
I think it would also be fair to limit double builds to newer platforms which are best able to take advantage of it anyway. This would limit some of the choices and possible maintenance headaches.
|
There is something we should take note: If we start using I prefer to say this now. |
in a wonderful world we should have
|
Could it be symlink / alias or the Windows equivalent?
enohp ym morf tnes
-----------
Dan Wilcox
danomatika.com
robotcowboy.com
… On Jun 23, 2023, at 5:06 PM, Lucas Cordiviola ***@***.***> wrote:
There is something we should take note:
If we start using pd64.dll (as in the combined app) and people start linking to it in externals, then we might not be able to stop shipping it. May be (in the future, if needed) there's a way to make it a kind of symlink to pd.dll.
I prefer to say this now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Maybe I'm missing something but... pd64.dll would never be interchangeable with pd.dll because, although both are 64-bit Windows libs, one uses 64-bit audio samples and the other uses 32-bit ones. We need to keep the 32-bit-sample version alive for compatibility with hardware that lacks fast 64-bit arithmetic (including, I believe, Raspberry Pi). |
only older ones actually, new ones are 64 bit |
I'm not sure but I believe that even on RPI 4 the arithmetic units take multiple cycles to do 64-bit operations, so 32-bit arithmetic is way faster than 64. |
Personally, I don't really have a strong opinion about "fat" installers VS separate installers. The only thing I deeply care about is a01a264.
Yes, but I think that |
No that I look at the "runtime-selectable precision switch" code I see that it doesn't do anything if Pd is packaged for only one precision type - so there's no reason it can't go into master. I'll just merge the whole banana now... |
The Cortex-A72 is a 64-bit ARMv8 chip, so that would surprise me... In general, all Intel and ARM CPUs can use vector registers/instructions for floating point math. 64-bit Intel actually mandates at least SSE2 support. Even with 32-bit Intel you would typically compile with at least SSE support, so there would be no difference between floats and doubles, at least for scalar code. AFAICT, floats vs. doubles only really makes a difference for vectorized code. SSE registers can hold 4 floats, but only 2 doubles; AVX registers can hold 8 floats, but only 4 doubles. |
Is rather difficult that now we can have a double
we should make the name mangling automatic in the autotools script. |
On MINGW we can do:
|
we don't need different names for the binaries. I think Linux does not have them. For Windows we can have same names but different:
EDIT: and
|
How would you install both Pd versions simultaneously on Linux? I thought both binaries would go to |
Am 23. Juni 2023 20:02:29 MESZ schrieb Christof Ressi ***@***.***>:
> I think Linux does not have them.
How would you install both Pd versions simultaneously on Linux? I thought both binaries would go to `/usr/bin` resp. `/usr/local/bin`, so you would need different names. I am a bit confused now.
On Linux, like on macOS, there is no "pd.dll" equivalent, since the runtime linker can resolve symbols using the calling application (so all the stuff that needs to go into pd.dll on Windows, lives in the "pd.exe")
Both variants can be co-installed if they have different names.
mfg.gss.owh
IOhannes
|
@millerpuckette please don't oppose to "both variants in a single app" on Windows and macOS. |
I know :) With "both binaries" I meant
Ok, that's what I figured. While we could use the same name on macOS and Windows - even for "universal apps" -, this is not a practical option on Linux. IMO it would be good to have the same naming scheme ( I think @Lucarda is right that at least on Windows we really have to decide on a canonical name because externals link back to it. We should do that before starting to actually ship "official" double-precision builds. |
Sure. |
Is this something that needs further discussion - or can we (you) push this to develop (if @millerpuckette agrees)? |
Assuming this is a configure or make option and “normal builds” still function, from my side this is a good step in that people can try if they build themselves. We can then iron out issues in a new version, at a minimum.
|
oh, i think i actually misunderstood the "default" part. from my side:
from my side this would be enough. i (now) understand that with your notion of default, you probably do not like the following caveats:
|
Or the less obscure Anyway, the warning is nice and all, but why not just set |
because it's slightly more complicated than it should be (it's hard to tell whether the user asked for transforming the program-name) in any case, i think i have it working now. |
I think for now at least 32-bit samples should be the default. 64-bitness will change the audio output of existing patches which I think needs careful warning and preparation. |
Totally. the last few comments were about the "default" filename of the binaries, if (and only if) somebody is brave enough to compile a double-precision Pd by passing |
this PR deals with the idea that both a single-precision Pd and a double-precision Pd can be installed at the same time (with the same package/installer/...).
The PR mostly fixes bugs with the buildsystem, that prevent the creation of co-installable binaries.
from a "new feature" perspective, I think the sole new feature is that
after a lot of discussing and experimenting (see below), it also turned out that it's best that double-precision and single-precision do not share the same filename space (that is: they should use different file-extensions as a way to never accidentally try to load a double-precision external into a single-precision runtime; this was mostly problematic on Windows, where a single-precision library would force a single-precision runtime by means of loading the single-precision
pd.dll
).the simple solution for that was to not use the good ole' library extensions (e.g.
.pd_linux
) for double-precision externals at all.the remainder is really
bug fixes in the build system that prevented building a
pd64.exe
(or rather: to allow mangling the name of the main binary, something that autotools does provide infrastructure for, but our Windows and macOS specific quirks did not take into account)Closes: use 'make install' as part of the osx-app.sh process #1992
Closes: double-precision: audio dialog broken #2000
Closes: Pd 0.54-0 test1 macOS unable to open preferences #2006
for practical reasons (to resolve a merge conflict), this includes the (current)
develop
branch...the main idea was laid out by @danomatika on the mailinglist and expanded by @Lucarda later on:
pd.exe
(for the single-precision build) andpd64.exe
(for the double-precision build)this PR doesn't automatically build double-precision binaries (this still has to be done explicitly by whoever creates the packages)