-
Notifications
You must be signed in to change notification settings - Fork 20
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
avoid closure cfunctions #467
Conversation
I can reproduce the issue with Julia master on my M1 mac, and also can verify that this PR fixes |
@@ -1,3 +1,5 @@ | |||
_test_rand_fun() = return 42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better just " = 42"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
If _test_rand_fun is made a global function, then the macro
***@***.***_cfunction can construct a cfunction at compile time, and this
works well on M1; however, with the current LLVM, julia cannot construct
the cfunction at runtime, which is what Polymake tried to do by passing a
function.
It's possible the whole problem could have been resolved by tagging
set_rand_source(::Function) with @inline; but in all cases we're in
hackland here, with a problem that (hopefully) will disappear when LLVM
gets fixed.
…On Wed, 24 Jan 2024 at 15:03, Benjamin Lorenz ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/util.jl
<#467 (comment)>
:
> @@ -1,3 +1,5 @@
+_test_rand_fun() = return 42
why?
—
Reply to this email directly, view it on GitHub
<#467 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARAQUBUSIVZD2QPVOJNQJLYQEICNAVCNFSM6AAAAABCHZRIFWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNBRGQ2TENJXHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Laurent Bartholdi laurent.bartholdi<at>gmail<dot>com
Fachrichtung Informatik+Mathematik, Universität des Saarlandes
Postfach 151150, 66041 Saarbrücken, Germany
Tel. +49 681 3023227, Sekr. +49 681 3023430
|
With this PR both helper functions are global and there should be no closures. Once I have access to an M1 mac myself I can do some testing if this can be solved with a macro or something like My |
Maybe fix some errors on M1 with julia nightly.
Still unclear why this only happens with nightly.