fredrik@fredrik-desktop:~$ cat test.jl
for i = 1:3
println(i)
end
fredrik@fredrik-desktop:~$ julia --optimize=3 test.jl
1
2
3
fredrik@fredrik-desktop:~$ julia -O3 test.jl
1
2
3
I guess the problem is that the space between optimization=3 and test.jl in your command is not a “real space”, for example, if I type anything between optimization=3 and test.jl, the error message is similar to yours.
julia --optimize=3_test.jl
ERROR: julia: invalid argument to -O (3_test.jl)
I guess you are right.
but there is something that is strange. I have two machines both Linux one is mint and the other is Ubuntu. This command works on one of them and gives the error on the other one. That’s strange. I tried a new clean reinstallation but It doesn’t seem to solve the problem.
After all, Thank you for your attention and help.
and If you have advice for me I will be glad hearing that.
This problem is likely cause by the shell (or other program) that is starting up the Julia process. It is not passing the arguments in the correct way, interpreting space as part of the argument, instead of a separator between arguments.
What shell are you using? Or are you starting Julia using a function call from some programming language?
Do you have any funny environment variables set? (Some shells allow you to specify that space will not be used to separate arguments.)
Thanks for your help.
Your idea made me check that if ssh is messing with the command.
after some trial and error, I figured out that this is a bug of JuliaPro.