First time here? Check out the Help page!

Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

how to change openstudio version in CLI on mac

asked 3 years ago

xchen's avatar

I have multiple version openstudio installed and when I check in terminal on mac, it returns version 2.6. How can I change it to version 3.1.0 so that I can run 3.1.0 models?

openstudio openstudio_version

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 3 years ago

That's more of a Unix question than a specific OpenStudio one. But anyways, when you type openstudio (or any program without a full path), it will look for this executable, in order of preference

  • In the current folder
  • In your PATH variable

which openstudio will tell you where it found it. It's likely going to be at /usr/local/bin/openstudio and that is a symbolic link (or symlink). ls -la $(which openstudio) will tell you where it points to. Here are the result of the commands on my Ubuntu machine

$ openstudio --version
3.1.0+e16509062
$ which openstudio
/usr/local/bin/openstudio
$ ls -la $(which openstudio)
lrwxrwxrwx 1 root root 53 juin   1 08:55 /usr/local/bin/openstudio -> /usr/local/openstudio-3.1.0/bin/openstudio

If you want to temporarily use another version, then specify the full path to the openstudio CLI. On mac it's going to be something like /Applications/openstudio-3.2.0/bin/openstudio

$ /usr/local/openstudio-3.1.0/bin/openstudio --version
3.1.0+e165090621
$ /usr/local/openstudio-3.2.0/bin/openstudio --version
3.2.0+e11f0a08b2

If you want to permanently change it, you just need to redo the symlink via sudo ln -sf <path/to/installed/openstudio> <destination>

$ sudo ln -sf /usr/local/openstudio-3.2.0/bin/openstudio /usr/local/bin/openstudio
$ ls -la $(which openstudio)
lrwxrwxrwx 1 root root 42 juil.  5 21:50 /usr/local/bin/openstudio -> /usr/local/openstudio-3.2.0/bin/openstudio
$ openstudio --version
3.2.0+e11f0a08b2
Preview: (hide)
link

Comments

Thanks, it'll be really helpful to include this information in the OS command line interface help file.

xchen's avatar xchen  ( 3 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 222 times

Last updated: Jul 12 '21