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

#657 - Properly find libruby/libpythonengine on macOS #664

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Jan 8, 2024

Adjust location of libruby/libpythonengine to root/lib (for macOS mostly).

I have tested on mac that this works in the build dir + the install dir BUT on my same machine. I need to redo that testing with the package produced on CI to make sure it works.

Testing on linux and windows is needed too.

CMakeLists.txt Outdated Show resolved Hide resolved
@macumber
Copy link
Collaborator

macumber commented Jan 9, 2024

This should fix #657 right?

Not sure how hard it would be but it would be awesome to install the installer in the CI and then use it to run a workflow using both Ruby and Python measures. Maybe something for next release?

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 9, 2024

This should fix #657 right?

Not sure how hard it would be but it would be awesome to install the installer in the CI and then use it to run a workflow using both Ruby and Python measures. Maybe something for next release?

We can repurpose this repo I did for OS SDK: https://github.com/jmarrec/OpenStudio-Tester

Caveat is that only the ubuntu runner is a "clean" runner (via a vanilla docker container), the windows and mac are the github runners (which means lots of preinstalled dev tools + same paths)

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 9, 2024

@macumber Would we do that on each run of app_build.yml? Or a manual trigger workflow (maybe taking a run_id as an input so we locate the artifacts that were uploaded)?

@macumber
Copy link
Collaborator

macumber commented Jan 9, 2024

The test workflow could probably be manually triggered, it would be nice to work out the kinks in the automatic install scripts too, I added #665 to track it

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 9, 2024

I've start this branch: https://github.com/openstudiocoalition/OpenStudioApplication/tree/cli_test

getting some problems setting it up / some failures during testing. I'm currently investigating

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 9, 2024

I have some issues based on the testing.

On linux there is both lib/libopenstudiolib.soand bin/libopenstudiolib.so. The bin/ one should NOT exist because that's what's found by the CLI, and it assumes the librubyengine/libpythoinengine is next to it.
the libopenstudiolib has an RPATH of that checks $ORIGIN and $ORIGIN/../lib.

I'm not sure what places the libopenstudiolib.so. in bin/ but I think it's fixup_bundle which is like a black box to me

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 9, 2024

Attempted a fix on aab5fa4. I've got hope. Local testing seemed fine on linux and mac. Will wait for CI here to finish, then I'll try the cli_test workflow again.

On macos, this eliminates the duplicated libopenstudiolib.dylib (we used to have 3...) and the duplicated openstudio (exe, we used to have two)

At some point we should really fix the mac bundle... it's a gigantic mess, having stuff both in OpenStudioApp.app/ and at the root.

For now on mac, the CLI is only at OpenStudio.app/Contents/MacOS/openstudio. Which looks for libopenstudiolib in Contents/Frameworks/, which itself has symlinks to the root lib/ dir.

lrwxr-xr-x  1 julien  staff  35 Jan  9 17:45 ./OpenStudioApp.app/Contents/Frameworks/libopenstudiolib.dylib -> ../../../lib/libopenstudiolib.dylib
lrwxr-xr-x  1 julien  staff  31 Jan  9 17:45 ./OpenStudioApp.app/Contents/Frameworks/libpythonengine.so -> ../../../lib/libpythonengine.so
lrwxr-xr-x  1 julien  staff  29 Jan  9 17:45 ./OpenStudioApp.app/Contents/Frameworks/librubyengine.so -> ../../../lib/librubyengine.so

That way the CLI works, and the Python/Ruby bindings which are at root can find the ../lib/ ones too.

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jan 10, 2024

There's an issue during testing on windows: https://github.com/openstudiocoalition/OpenStudioApplication/actions/runs/7470049822/job/20328106917#step:7:68

This appears like a problem in the way I set up the path from git bash because I cannot reproduce locally in a windows 10 VM from powershell.

Unable to load library 'D:/a\OpenStudioApplication\OpenStudioApplication\cli_tester\OpenStudioApplication-1.7.0-rc1+4ad6a0fcf8-Windows\bin\pythonengine.dll', reason: 'The specified module could not be found.

@jmarrec jmarrec force-pushed the 657-Libs_reorder branch 13 times, most recently from 2b9e077 to 296d1e3 Compare January 11, 2024 14:37
@jmarrec jmarrec merged commit d624b34 into develop Jan 11, 2024
1 check passed
@jmarrec jmarrec deleted the 657-Libs_reorder branch January 11, 2024 16:38
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't run Python measure on Mac M1
2 participants