sglyon / ORCA.jl

Julia interface to Plotly's ORCA image exporter app
3 stars 5 forks source link

deps/bin/orga contains a problem on MacOS #3

Closed BoundaryValueProblems closed 6 years ago

BoundaryValueProblems commented 6 years ago

@sglyon , when I installed ORCA on my MacBook Pro (OS X 10.11.6), and ran using ORCA, it complained:

/Users/xxx/.julia/packages/ORCA/vWe2Y/deps/bin/orca: line 7: /Users/xxx/.julia/packages/ORCA/vWe2Y/deps/lib/orca_app/orca: No such file or directory
/Users/xxx/.julia/packages/ORCA/vWe2Y/deps/bin/orca: line 7: exec: /Users/xxx/.julia/packages/ORCA/vWe2Y/deps/lib/orca_app/orca: cannot execute: No such file or directory

So, I took a look at deps/bin/orga:

#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
    # Mac OSX
    exec /Users/xxx/.julia/packages/ORCA/vWe2Y/deps/lib/orca.app/Contents/MacOS/orca "$@"
else
    # Assume linux
    exec /Users/xxx/.julia/packages/ORCA/vWe2Y/deps/lib/orca_app/orca "$@"
fi

So, I thought this was correct. But, when I checked the environmental variable OSTYPE on Mac's Terminal, it said Darwin, not darwin. So, if I changed Line 2 from darwin to Darwin, then orca didn't complain anymore. I'm not sure whether the other versions of Mac OSX or macOS sets OSTYPE as darwin or Darwin though.

BoundaryValueProblems commented 6 years ago

@sglyon , the above might be my specific problem. In my MacBook Pro, I have my own ~/.bashrc that contains the line: OSTYPE = `uname`. Hence uname returns the value Darwin. That's the reason. If I don't specify OSTYPE in my .bashrc, then the value of OSTYPE is darwin15 in my case. So, the original orca script works. However, it is a bit dangerous to assume that people do not modify OSTYPE. Hence, it would be best if Line 2 of orca can handle both darwin and Darwin. Thanks!

sglyon commented 6 years ago

Thanks for digging in and reporting

It does sound like this is an issue with your particular setup, but I agree it should be fixed.

The problem actually resides in the plotly/orca repo as this is something defined over there. Would you be willing to open this issue over there?

BoundaryValueProblems commented 6 years ago

@sglyon , I mistakenly opened this issue as https://github.com/sglyon/PlotlyJS.jl/issues/228; so I'll close it. I just realized it's not PlotlyJS.jl issue, but rather plotly/orca. I just searched it and opened the question there: https://github.com/plotly/orca/issues/132.