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

how to change openstudio version in CLI on mac

asked 2021-07-04 19:42:49 -0500

xchen gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-07-05 14:52:55 -0500

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
edit flag offensive delete link more

Comments

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

xchen gravatar image xchen  ( 2021-07-12 12:49:52 -0500 )edit

Your Answer

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

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2021-07-04 19:42:49 -0500

Seen: 54 times

Last updated: Jul 12