Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlinked CLI cannot find EnergyPlus on Mac #2561

Closed
nmerket opened this issue Apr 7, 2017 · 2 comments
Closed

Symlinked CLI cannot find EnergyPlus on Mac #2561

nmerket opened this issue Apr 7, 2017 · 2 comments

Comments

@nmerket
Copy link
Member

nmerket commented Apr 7, 2017

I am trying to use the OpenStudio CLI and it complains of not being able to find EnergyPlus unless I set the ENEREYPLUS_EXE_PATH environment variable. This only happens when I use the CLI that is symlinked into /usr/local/bin/openstudio. When I use the one in /Applications/OpenStudio-2.1.0/bin/openstudio it is able to find EnergyPlus just fine.

If I run the following ruby script using the CLI (test.rb).

puts "ENERGYPLUS_EXE_PATH = '#{ENV['ENERGYPLUS_EXE_PATH']}'"
ENV['ENERGYPLUS_EXE_PATH'] = nil
puts "ENERGYPLUS_EXE_PATH = '#{ENV['ENERGYPLUS_EXE_PATH']}'"
puts OpenStudio::openStudioLongVersion
puts OpenStudio::getOpenStudioModule
puts OpenStudio::getOpenStudioModuleDirectory
puts OpenStudio::getEnergyPlusExecutable
puts OpenStudio::getEnergyPlusDirectory

From the symlinked cli openstudio execute_ruby_script test.rb

ENERGYPLUS_EXE_PATH = '/Applications/OpenStudio-2.1.0/EnergyPlus/energyplus-8.7.0'
ENERGYPLUS_EXE_PATH = ''
2.1.0.fae436fc10
/usr/local/bin/openstudio
/usr/local/bin


From the full-path cli /Applications/OpenStudio-2.1.0/bin/openstudio execute_ruby_script test.rb

ENERGYPLUS_EXE_PATH = '/Applications/OpenStudio-2.1.0/EnergyPlus/energyplus-8.7.0'
ENERGYPLUS_EXE_PATH = ''
2.1.0.fae436fc10
/Applications/OpenStudio-2.1.0/bin/openstudio
/Applications/OpenStudio-2.1.0/bin
/Applications/OpenStudio-2.1.0/bin/../EnergyPlus/energyplus
/Applications/OpenStudio-2.1.0/bin/../EnergyPlus

@macumber

@jmarrec
Copy link
Collaborator

jmarrec commented Sep 20, 2017

In the CLI Doc there is a section about "Environment Variables", reading it I have added this to my ~/.bash_profile:

export RUBYLIB=/Applications/OpenStudio-2.2.0/Ruby
export ENERGYPLUS_EXE_PATH=/Applications/OpenStudio-2.2.0/EnergyPlus/energyplus-8.7.0

Isn't that enough?

Then again, it shouldn't be to hard to check if it's a symlink and follow that. I think that the problem is moduleIsRunningFromBuildDirectory which doesn't follow the symlink.

This is perhaps related to #2616 too.

@kbenne kbenne closed this as completed in 8524738 Mar 7, 2018
kbenne added a commit that referenced this issue Mar 26, 2018
A fix was recently made to fix errors when calling the cli with a relative path.
That fix was tested and appeared to resolve the issue #2616.

Subsequently another fix was made for calling a sym linked version of cli #2561 (usually Mac)

The sym link fix had a bad interaction, and caused 2615 to reappear.
This commit attempts to reclose #2616 and not break the fix for #2561
@jmarrec
Copy link
Collaborator

jmarrec commented Sep 5, 2018

Confirmed that Kyle's fix in 8524738 works:

Ran user script with 2.6.0:

ENERGYPLUS_EXE_PATH = ''
2.6.0.8c81faf8bc
/Applications/OpenStudio-2.6.0/bin/openstudio
/Applications/OpenStudio-2.6.0/bin
/Applications/OpenStudio-2.6.0/bin/../EnergyPlus/energyplus
/Applications/OpenStudio-2.6.0/bin/../EnergyPlus

jmarrec added a commit that referenced this issue Apr 3, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue Apr 6, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue Apr 11, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue Apr 24, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue May 10, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue May 16, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
jmarrec added a commit that referenced this issue Jun 12, 2023
```
1/4 Test #2562: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago .......................   Passed    1.39 sec
2/4 Test #2563: ModelFixture.ThreeJSForwardTranslator_RefBldgOutPatientNew2004_Chicago_GeometryDiagnostics ...   Passed    1.40 sec
3/4 Test #2560: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete ...................................   Passed    3.79 sec
4/4 Test #2561: ModelFixture.ThreeJSForwardTranslator_7_7_Windows_Complete_GeometryDiagnostics ...............   Passed    3.95 sec
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants