How to building OpenStudio 2.0 on Mac, and get the Python 3 bindings to work
There is a specific README file: Building_OS2.0_on_Mac
(Still building ./openstudiocore/
)
After enabling BUILD_PYTHON_BINDINGS=ON
then configuring ([c]
), enabling advanced mode ([t]
).
I've pointed the python variables to my Python 3.5 virtual environment:
//Path to a program.
PYTHON_EXECUTABLE:FILEPATH=/Users/julien/Virtualenvs/py35/bin/python
//Path to a file.
PYTHON_INCLUDE_DIR:PATH=/Users/julien/Virtualenvs/py35/include/python3.5m
//Path to a library.
PYTHON_LIBRARY:FILEPATH=/Users/julien/Virtualenvs/py35/lib/python3.5/config-3.5m/libpython3.5.dylib
//Path to a library.
PYTHON_LIBRARY_DEBUG:FILEPATH=PYTHON_LIBRARY_DEBUG-NOTFOUND
or for my py36:
PYTHON_EXECUTABLE /Users/julien/Virtualenvs/py36/bin/python
PYTHON_INCLUDE_DIR /Users/julien/Virtualenvs/py36/include/python3.6m
PYTHON_LIBRARY /Users/julien/Virtualenvs/py36/lib/python3.6/config-3.6m-darwin/libpython3.6.dylib
PYTHON_LIBRARY_DEBUG /Users/julien/Virtualenvs/py36/lib/python3.6/config-3.6m-darwin/libpython3.6.dylib
Configure, then generate ([g]
).
make -j XX
where XX = number of cores. This will generate the bindings.
There's a problem with the relative imports not working anymore in python 3, and I also provide an __init__.py
file that should most ressemble the Ruby (official) bindings.
Please refer to the openstudio/README.md for more information.