tpapp / julia-repl

Run an inferior Julia REPL in a terminal inside Emacs
Other
169 stars 35 forks source link

Can't pass `-C` flag to Julia as a repl switch #129

Closed chriselrod closed 1 year ago

chriselrod commented 1 year ago

When reporting an issue, please provide

  1. the Emacs version (M-x emacs-version [RET], will also appear in the buffer *Messages*),

29.0.50, GTK+

  1. the Julia version (VERSION)

Any I've tried, e.g. 1.8, 1.6, master

  1. the version of julia-repl (something like “latest master” is fine).

A few versions.

  1. self-contained steps to replicate the issue.
(use-package julia-mode
    :straight t)
(use-package julia-repl
  :straight t
  :hook (julia-mode . julia-repl-mode)
  :config
  (setq julia-repl-set-terminal-backend 'vterm)
  (setq julia-repl-switches "-O3 -q -tauto -C\"native\"")
  (add-hook 'julia-mode-hook 'julia-repl-mode))

Starting a Julia-repl now yields:

ERROR: Your CPU does not support the CX16
instruction, which is required by this version of Julia!  This is often due to running in
side of a virtualized environment.  Please read https://docs.julialang.org/en/v1/devdocs/sysimg/ for more.

Process julia exited abnormally with code 1

The motivation here is passing additional flags, e.g. I typically start Julia in the repl with -C"native,-prefer-256-bit". Using just native however is a minimal example that should generally work on x64 CPUs.

Seems that the parsing of native is the problem, or that I'm writing the string wrong? You can reproduce this from the terminal via trying to start Julia via julia -C"fake"; the error message above is what you get whenever you specify something that doesn't exist/gets misinterpreted.

tpapp commented 1 year ago

I see nothing in julia-repl that would interfere with this, it is simply passing a string.

Why do you need the quotes though? The string is split on spaces.

Does

julia -O3 -q -tauto -Cnative

work in the command line, outside Emacs?

chriselrod commented 1 year ago

Ha, yes it does. Somehow I never realized that we don't need quotes.

This works: https://github.com/chriselrod/init.el.repo/commit/569830dc69181ce4e246e33a27c3b7cba8b2689d