sunode icon indicating copy to clipboard operation
sunode copied to clipboard

Installing sunode on Apple Silicon via Conda?

Open jucor opened this issue 1 year ago • 13 comments

Hi! What is the recommended way to install Sunode on Apple Silicon via Conda, please?

It seems sundoe does not have a conda-forge package for Apple Silicon: https://anaconda.org/conda-forge/sunode does not show any osx-arm64 label, unlike e.g. pymc: image

Thanks for any help!

jucor avatar Dec 27 '23 12:12 jucor

So, good news: using manual build works on Apple Silicon:

git clone https://github.com/pymc-devs/sunode
cd sunode
# conda install --only-deps sunode # NOT THIS ONE: because there's no sunode package for osx-arm64
pip install -e .

So it's more a question of modifying the feedstock so conda-forge has the right label. I need to remember how I did that for other packages 😅

jucor avatar Dec 27 '23 14:12 jucor

Ah, yes, found back how I did it in the past: https://github.com/conda-forge/conda-forge-pinning-feedstock/pull/4191 I will try to do the same for sunode, and report here.

jucor avatar Dec 27 '23 14:12 jucor

Alright, I've added to the adequate file in conda-forge pinning, now we need to wait for it to be merged then for the bot to update conda-forge a few hours later.

jucor avatar Dec 27 '23 14:12 jucor

Thanks @jucor for taking the initiative on this!

maresb avatar Dec 27 '23 19:12 maresb

When I try

git clone https://github.com/pymc-devs/sunode
cd sunode
pip install -e 

I get 'file not found" for sundials/sundials_types.h. If I conda install sundials, it then fails with all kinds of errors, mainly about incorrect number of arguments, which makes me wonder if I need a specific version of sundials ?

EDIT: Yeah it works if I specify sundials-5.8.0 (that was what was installed on my windows machine).
I see also that the pull request was accepted so this will be a non-issue soon :)

DrEntropy avatar Dec 27 '23 21:12 DrEntropy

I believe you need version 5.8.

On Wed, Dec 27, 2023, 22:02 DrEntropy @.***> wrote:

When I try this I get 'file not found" for sundials/sundials_types.h. If I conda install sundials, it then fails with all kinds of errors, mainly about incorrect number of arguments, which makes me wonder if I need a specific version of sundials is needed?

— Reply to this email directly, view it on GitHub https://github.com/pymc-devs/sunode/issues/46#issuecomment-1870624569, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFBERI7XIVCWAM4U5MSZT3YLSEGNAVCNFSM6AAAAABBEJPXW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZQGYZDINJWHE . You are receiving this because you were mentioned.Message ID: @.***>

jucor avatar Dec 27 '23 22:12 jucor

Update:

  • The sunode package appears as in-pr in https://conda-forge.org/status/#armosxaddition
  • That means the feedstock currently has a PR that needs merging: https://github.com/conda-forge/sunode-feedstock/pull/26
  • But that PR currently fails the builds :'(

jucor avatar Dec 28 '23 11:12 jucor

@maresb sorry to bother you, but you might be more familiar with the sunode build process than I am, and thus might have more sense to make sense of the failing build logs in the feedstock at https://github.com/conda-forge/sunode-feedstock/pull/26 . Would you be able to have a look, please?

Here is a link to the log of the failure: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=850067&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=20c71c51-4b27-578b-485d-06ade2de1d00&l=2177

jucor avatar Dec 28 '23 11:12 jucor

@maresb Here is the exact error that shows up: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=850067&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=20c71c51-4b27-578b-485d-06ade2de1d00&l=878

It's an implicit narrowing casting on sizes from long to int that seems to be the problem in one module.

I'm not sure why that error appears in the CI toolchain, but not when we compile locally :/

jucor avatar Dec 28 '23 11:12 jucor

Digging deeper, that compilation error occurs somewhere deep in some C++ code that seems dynamically compiled from the test test_nodiff_params() at this line: https://github.com/pymc-devs/sunode/blob/f1f7f79026aafcf4a57e2feebea0be74a5e89783/sunode/test_pytensor.py#L47C78-L47C78 Log of the failing call: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=850067&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=20c71c51-4b27-578b-485d-06ade2de1d00&l=955

jucor avatar Dec 28 '23 11:12 jucor

Thank you for looking into this!

It sounds to me like it could be this issue? https://github.com/aesara-devs/aesara/issues/127

This happens in the generated code of pytensor if I understand correctly, maybe it would be better to just add the required cast in pytensor then, instead of adding compiler flags downstream?

aseyboldt avatar Dec 28 '23 11:12 aseyboldt

Does anyone know what sys.platform will report in the CI? Because that's what we use to determine if we add the extra compiler flags: https://github.com/aesara-devs/aesara/pull/972/files#diff-abd6d8030e381e908a5a5bb1829e6524f4686e78f00bddfcebc134f55c762b1bL2362

aseyboldt avatar Dec 28 '23 11:12 aseyboldt

@aseyboldt Excellent question! I just tried, and it turns out that this specific test fails also on my regular macOS m1, so not only just on CI! On my macOS, sys.platform is darwin. Could it be that the flags against narrowing error might not be applied when sunode compiles the pytensor code that it generated dynamically?

jucor avatar Dec 28 '23 15:12 jucor