sisl/CUDD.jl

CUDD on Apple M1

Opened this issue · 5 comments

CUDD is working on the Apple M1 platform using Julia v1.9 for Apple silicon.
But it has to be handled a special way to get it started.
This works for me: (1) start Julia v1.9 for M1, (2) do Pkg.add("CUDD"), (3) do using CUDD---will get ERROR telling you that the platform is not compatible, (4) repeat using CUDD---everything will work properly from this point on. At least that's my experience.
So the ISSUE is that you have to work around a starting problem.

We don't have access to Apple M1 machines. Could you share the full error stacktrace? Maybe it's an unnecessary error and we can fix it.

Yes, I'll try to do that. Here is what I see.


Last login: Sat Nov 19 19:56:26 on ttys000
/Applications/Julia-1.10.app/Contents/Resources/julia/bin/julia ; exit;
delmasbuckleyjr@Delmass-Mac-mini ~ % /Applications/Julia-1.10.app/Contents/Resources/julia/bin/julia ; exit;
_
_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.10.0-DEV.12 (2022-11-16)
/ |_'|||_'_| | Commit ee0f3fc334a (4 days old master)
|__/ |

julia> using CUDD
ERROR: InitError: cfunction: closures are not supported on this platform
Stacktrace:
[1] init()
@ CUDD ~/.julia/packages/CUDD/OUmdR/src/ADD_apply.jl:53
[2] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
@ Base ./loading.jl:925
[3] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
@ Base ./loading.jl:1133
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1409
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1295
[6] macro expansion
@ ./loading.jl:1275 [inlined]
[7] macro expansion
@ ./lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1238
during initialization of module CUDD

julia> using CUDD

julia>


I had switched to Julia 1.10, one of the nightlies, to see if it had been fixed. But it is still the same. After that second "using CUDD" the system works properly, so far as I can tell. Everything I use seems to be working. It's just in getting started that I see an ERROR message.

Best regards,
Robert Buckley

If I have reported this problem to the wrong entity, can you suggest who I should report it to?
Thank you,
Robert Buckley

I think this will be quite hard to debug without an M1 machine at hand. There is a bunch of metaprogramming happening here it seems https://github.com/sisl/CUDD.jl/blob/master/src/ADD_apply.jl#L37
Maybe the solution is to manually define all those add_plus add_minus functions.

I am not so sure what the point of this renaming was. @drbuckleyjr , maybe to see if this indeed the source of the bug, you could try commenting out this line? https://github.com/sisl/CUDD.jl/blob/master/src/CUDD.jl#L30

rtjoa commented

For those who don't need the ADD functions, simply removing the @cfunction suffices, as in:
rtjoa@8c0be8c

I've personally just been runningPkg.add(url="https://github.com/rtjoa/CUDD.jl.git", rev="m1compat") whenever I open a CUDD-but-not-ADD-dependent project