Closed jmarrec closed 1 month ago
M1 Max, on Sequioa 15.1, works plenty fine here.
otool -L /Applications/OpenStudio-3.8.0/EnergyPlus/python_standard_lib/lib-dynload/_sqlite3.cpython-38-darwin.so
/Applications/OpenStudio-3.8.0/EnergyPlus/python_standard_lib/lib-dynload/_sqlite3.cpython-38-darwin.so:
/usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 344.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
I don't have /usr/lib/libsqlite3.dylib. But I do have a brew one
$ locate libsqlite3.dylib
/opt/homebrew/Cellar/sqlite/3.46.1/lib/libsqlite3.dylib
Try running through pytest directly with your system python.
pip install openstudio==3.8.0
cd src/utilities/bcl/templates/ModelMeasure/test
python -m pytest
Thanks for creating this issue. Yeah, it works through the system python! That's what I ended up doing. So, this is no longer a blocker, but it would be nice to get this working through the CLI as well.
@rajee wait, were you also having issues on the docker NREL/3.8.0 (that's an ubuntu docker)?
Works fine, either through the CLI on the pytest file or via openstudio measure -r .
, which will run pytest too. Maybe try that as well on your system?
$ cd src/utilities/bcl/templates
$ docker run -it --rm --platform linux/amd64 -v $(pwd):/var/simdata/openstudio/templates nrel/openstudio:3.8.0
Inside docker
cd templates/ModelMeasure
openstudio measure -r .
cd tests
openstudio test_model_measure.py
@jmarrec Oh, maybe not. It didn't work for me locally, so I just put whatever worked locally to CI. But yeah, maybe it would have worked through the openstudio CLI on the CI on ubuntu docker.
Can you try openstudio measure --run_tests .
locally please?
Also, can you post the output of these commands
otool -L /Applications/OpenStudio-3.8.0/EnergyPlus/python_standard_lib/lib-dynload/_sqlite3.cpython-38-darwin.so
locate libsqlite3.dylib
# if you have homebrew installed
brew info sqlite3
brew --prefix sqlite3
Sure.
openstudio measure --run_tests . ─╯
otool -L /Applications/OpenStudio-3.8.0/EnergyPlus/python_standard_lib/lib-dynload/_sqlite3.cpython-38-darwin.so ─╯
locate libsqlite3.dylib brew info sqlite3 brew --prefix sqlite3
I find the otool suspicious. /usr/local/opt/sqlite/lib/libsqlite3.0.dylib
... Are you 100% sure you installed the arm64 mac installer and not the x86_64 one? Can you do
$ file /Applications/OpenStudio-3.8.0/bin/openstudio
/Applications/OpenStudio-3.8.0/bin/openstudio: Mach-O 64-bit executable arm64
and
$ which openstudio
/usr/local/bin/openstudio
ls -la $(which openstudio)
lrwxr-xr-x@ 1 root wheel 45 May 22 14:31 /usr/local/bin/openstudio -> /Applications/OpenStudio-3.8.0/bin/openstudio
$ /Applications/OpenStudio-3.8.0/bin/openstudio --version
3.8.0+f953b6fcaf
Huh, looks like I mistakenly installed the x86_64 version.
file /Applications/OpenStudio-3.8.0/bin/openstudio ─╯ /Applications/OpenStudio-3.8.0/bin/openstudio: Mach-O 64-bit executable x86_64
Openstudio seems fine.
$ which openstudio
/usr/local/bin/openstudio
ls -la $(which openstudio)
lrwxr-xr-x@ 1 root admin 45 Jul 1 09:15 /usr/local/bin/openstudio -> /Applications/OpenStudio-3.8.0/bin/openstudio
$ /Applications/OpenStudio-3.8.0/bin/openstudio --version
3.8.0+f953b6fcaf
I will try the arm64 version and report back. Pretty interesting that x86_64 version has been carrying me this far though!
On a separate note, I remember seeing something about Mac installer being code signed. I thought it would prevent this:
Nope, only E+ is signed currently, and OSApp 1.8.0. For OS SDK, I filed
Happy to report it's working now. Sorry about the operator-error!
─ openstudio measure --run_tests . ─╯
┌────────────────────────────────────────────────────────────────────────────────┐
│ Starting Python Tests │
└────────────────────────────────────────────────────────────────────────────────┘
runPytestCmd=
import pytest
pytest.main([
"--junit-xml=/Users/radhikar/Documents/largee/resstock/test_results/pytest/junit.xml",
"--cov=/Users/radhikar/Documents/largee/resstock",
"--cov-report=term-missing",
"--cov-report=json:/Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.json",
"--cov-report=lcov:/Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.lcov",
"--cov-report=html:/Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage_html",
"--cov-report=xml:/Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.xml",
"-o", "junit_family=legacy",
"/Users/radhikar/Documents/largee/resstock",
])
================================================================= test session starts ==================================================================
platform darwin -- Python 3.8.12, pytest-8.1.1, pluggy-1.5.0
rootdir: /Users/radhikar/Documents/largee/resstock
plugins: cov-5.0.0
collected 12 items
measures/LoadFlexibility/tests/test_load_flexibility.py . [ 8%]
measures/LoadFlexibility/tests/test_setpoint.py ........... [100%]
----------------------------- generated xml file: /Users/radhikar/Documents/largee/resstock/test_results/pytest/junit.xml ------------------------------
---------- coverage: platform darwin, python 3.8.12-final-0 ----------
Name Stmts Miss Cover Missing
---------------------------------------------------------------------------------------
measures/LoadFlexibility/measure.py 97 58 40% 20-23, 46, 54, 64, 83-86, 89-93, 96-106, 115-167
measures/LoadFlexibility/resources/__init__.py 0 0 100%
measures/LoadFlexibility/resources/input_helper.py 90 4 96% 51-54, 66
measures/LoadFlexibility/resources/setpoint.py 168 47 72% 48, 88, 92-95, 131-132, 137, 163-164, 169, 192-193, 198, 213-225, 228-233, 239-266
measures/LoadFlexibility/resources/xml_helper.py 20 15 25% 6-10, 13-16, 19-25
measures/LoadFlexibility/tests/test_load_flexibility.py 31 4 87% 137-141
measures/LoadFlexibility/tests/test_setpoint.py 151 40 74% 103-114, 134-145, 164-175, 194-198
package_info.py 16 16 0% 1-22
---------------------------------------------------------------------------------------
TOTAL 573 184 68%
Coverage HTML written to dir /Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage_html
Coverage XML written to file /Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.xml
Coverage JSON written to file /Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.json
Coverage LCOV written to file /Users/radhikar/Documents/largee/resstock/test_results/pytest/python_coverage.lcov
================================================================= 12 passed in 15.77s ==================================================================
┌────────────────────────────────────────────────────────────────────────────────┐
│ Starting ruby tests │
└────────────────────────────────────────────────────────────────────────────────
Glad this is resolved, thanks for the quick feedback when I was asking for diagnostics :)
Looks like this should have been fixed through https://github.com/NREL/OpenStudio/pull/5008 but I am still getting errors on Openstudio version: 3.8.0+f953b6fcaf, M1 Pro Mac, Ventura 13.7
Traceback
``` Traceback (most recent call last): File "Originally posted by @rajeee in https://github.com/NREL/OpenStudio/issues/4992#issuecomment-2400681604