Skip to content
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

problems with IntervalArithmetic in MacBook Pro with Apple M3 Max chip #691

Closed
justinmccrary opened this issue Dec 21, 2024 · 5 comments
Closed

Comments

@justinmccrary
Copy link

Hi everybody.
I'm experienced in econometrics, but new to Julia (and GitHub) and still learning about package management.

THE PROBLEM:
I'm using Julia version 1.11.2 and have been trying to install IntervalArithmetic. My computing environment is a MacBook Pro with an Apple M3 Max chip.

THE STUFF THAT SEEMS TO WORK OK:
The sequence

using Pkg; Pkg.add("IntervalArithmetic")

seems to works fine. For example,

Pkg.status("IntervalArithmetic")

shows

Status ~/.julia/environments/v1.11/Project.toml
⌅ [d1acc4aa] IntervalArithmetic v0.17.8

which I think just is saying that there might be a more recent version of IntervalArithmetic out there. (I installed everything today, so I'm not quite sure how that might be true, but maybe that is where my error lies?)

THE STUFF THAT SEEMS TO BREAK:
However, issuing

a = @interval(1, 2)

leads to the frightening error

[96649] signal 11 (2): Segmentation fault: 11
in expression starting at none:0

followed by many other errors and finally

[1] 96648 segmentation fault sudo julia

QUESTION:
Does anybody know what I might be doing wrong? Apologies if this is answered somewhere already--I looked for much of today and couldn't find any relevant posts.

Thank you!

@dpsanders
Copy link
Member

That's an ancient version - we're up to 0.22 now.
There's probably something wrong with version bounds somewhere, thanks for the report.

@justinmccrary
Copy link
Author

Thank you for this catch! I really appreciate the response.

I forced Julia to update with this:

Pkg.add(PackageSpec(name="IntervalArithmetic", version="0.22.20"))

which seems to work. (For example,
Pkg.status()
confirms
[d1acc4aa] IntervalArithmetic v0.22.20
). However, while this fixes the segmentation fault, it does not seem to fully work--the command

using IntervalArithmetic
a = @interval(1, 2)

still produces the error below:

ERROR: MethodError: no method matching atomic(::Int64, ::Int64)
The function atomic exists, but no method is defined for this combination of argument types.

Any idea what is going on?

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 21, 2024

Status ~/.julia/environments/v1.11/Project.toml
⌅ [d1acc4aa] IntervalArithmetic v0.17.8

The symbol means that another installed package prevent IntervalArithmetic from getting the latest version, and that was the initial problem (I see you solved that in the meantime).

using IntervalArithmetic a = @interval(1, 2)

still produces the error below:

The function you are looking for is probably interval (without @), which is expected to give the following:

julia> interval(1, 2)
[1.0, 2.0]_com

@interval is instead used to replace numbers with intervals in an expression. The docstrings give a bit more details:

julia> ? @interval
  @interval(expr)
  @interval(T, expr)
  @interval(T, expr1, expr2)

  Walk through an expression and wrap each argument of functions with the internal
  constructor atomic.

  Examples
  ≡≡≡≡≡≡≡≡

  julia> setdisplay(:full);

  julia> @macroexpand @interval sin(1) # Float64 is the default bound type
  :(sin(IntervalArithmetic.atomic(Float64, 1)))

  julia> @macroexpand @interval Float32 sin(1)
  :(sin(IntervalArithmetic.atomic(Float32, 1)))

  julia> @interval Float64 sin(1) exp(1)
  Interval{Float64}(0.8414709848078965, 2.7182818284590455, com)

@justinmccrary
Copy link
Author

@Kolaru thank you so much!!! This was in fact exactly the issue. Installation was just fine, it was my "hello world" that was the problem. :)

@Kolaru
Copy link
Collaborator

Kolaru commented Dec 22, 2024

Happy to help! Feel free to open a new issue if something is unclear in the documentation or if you hit another problem.

@Kolaru Kolaru closed this as completed Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants