Skip to content
New issue

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

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

Already on GitHub? # to your account

Preliminarily fixes #8228 -- better fixup of executables on mac #8235

Merged
merged 3 commits into from
Sep 3, 2020

Conversation

Myoldmopar
Copy link
Member

Pull request overview

  • Fixes #ISSUENUMBERHERE (IF THIS IS A DEFECT)
  • DESCRIBE PURPOSE OF THIS PULL REQUEST

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@Myoldmopar Myoldmopar added the Defect Includes code to repair a defect in EnergyPlus label Aug 26, 2020
@Myoldmopar
Copy link
Member Author

@jmarrec i made these changes while working offline and now I’m making this PR from my phone. So I am definitely not confident these changes are final, but in my machine the prerequisites of all the binaries looked good in my Mac package. Feel free to test it out and I’ll jump back into it in the morning.

@Myoldmopar
Copy link
Member Author

I've verified now on multiple machines that the latest commit results in a set of binaries that do not look for system Python at all. I will kick off another package build to verify, but I think this will be good to go in now.

@Myoldmopar
Copy link
Member Author

@jmarrec can you check out the latest install packages? I think I got all the fixups ...erm... fixed up.

https://github.com/NREL/EnergyPlus/releases/tag/TestBuildMacFixups2

@jmarrec
Copy link
Contributor

jmarrec commented Aug 28, 2020

@Myoldmopar This appears to work, though I am getting some warnings when running simulations.

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Testing energyplus --help

curl -L -O https://github.com/NREL/EnergyPlus/releases/download/TestBuildMacFixups2/EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64.tar.gz
tar xfz EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64.tar.gz
cd EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64
./energyplus --help
EnergyPlus, Version 9.4.0-406cf3caa5
PythonLinkage: Linked to Python Version: "3.8.3 (default, Jul  8 2020, 14:27:55) 
[Clang 11.0.3 (clang-1103.0.32.62)]"
Usage: energyplus [options] [input-file]
Options:
  -a, --annual                 Force annual simulation
[...]

Running a couple of files

cd ExampleFiles
../energyplus -w ../WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw PythonPluginCustomSchedule.idf 
EnergyPlus Starting
EnergyPlus, Version 9.4.0-406cf3caa5, YMD=2020.08.28 03:19
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Initializing Response Factors
[...]
EnergyPlus Completed Successfully.
$ ../energyplus -w ../WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw 1ZoneUncontrolled.idf
EnergyPlus Starting
EnergyPlus, Version 9.4.0-406cf3caa5, YMD=2020.08.28 03:21
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Adjusting Air System Sizing
[...]
EnergyPlus Completed Successfully.

@jmarrec
Copy link
Contributor

jmarrec commented Aug 28, 2020

jenkins@EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64$ otool -L energyplus
energyplus:
	@executable_path/libenergyplusapi.9.4.0.dylib (compatibility version 0.0.0, current version 9.4.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)


jenkins@EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64$ otool -L libenergyplusapi.dylib
libenergyplusapi.dylib:
	@executable_path/libenergyplusapi.9.4.0.dylib (compatibility version 0.0.0, current version 9.4.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.10.126)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1348.12.4)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1069.11.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1673.126.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)


jenkins@EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64$ otool -L ./libpythonwrapper.dylib 
./libpythonwrapper.dylib:
	@executable_path/libpythonwrapper.dylib (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/Python (compatibility version 3.8.0, current version 3.8.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)

jenkins@EnergyPlus-9.4.0-406cf3caa5-Darwin-x86_64$ otool -L ./Python
./Python:
	@executable_path/Python (compatibility version 3.8.0, current version 3.8.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

@Myoldmopar
Copy link
Member Author

Great! I'm glad they are working. I know, those errors pop up on Mac, and I'm even setting python home by API call prior to initializing. I need to dig a little more into the actual CPython code where that gets emitted and see if there is another way to get rid of the warning.

@mjwitte mjwitte added this to the EnergyPlus 9.4.0 milestone Aug 28, 2020
@Myoldmopar
Copy link
Member Author

OK, so the actual issue of insufficient fixing up is addressed here. There is the side issue noted about PYTHONHOME, but it's unrelated. I'm going to merge this.

@Myoldmopar Myoldmopar merged commit b737b54 into develop Sep 3, 2020
@Myoldmopar Myoldmopar deleted the Fix8228_MacFixups branch September 3, 2020 18:21
@mitchute mitchute mentioned this pull request Sep 10, 2020
11 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants