support c++17 compilation
dagitses opened this issue · 0 comments
dagitses commented
In PyTorch CI, the deploy job will fail if someone uses certain features of C++17, e.g. std::optional.
An example failure: https://github.com/pytorch/pytorch/actions/runs/4495562071/jobs/7910071118?pr=97175
Relevant portion for posterity:
In file included from /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/c10/core/StorageImpl.h:7:0,
from /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/c10/core/Storage.h:3,
from /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/ATen/core/TensorBody.h:19,
from /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/ATen/core/ivalue.h:4,
from /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/torch/csrc/jit/python/pybind_utils.h:3,
from /var/lib/jenkins/multipy/multipy/runtime/interpreter/plugin_torch.cpp:1:
/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/include/c10/core/impl/copy_on_write_state.h:43:8: error: ‘optional’ in namespace ‘std’ does not name a template type
std::optional<CopyOnWriteSimulatorImpl> default_simulator_;
I'd be open to contributing this since this seems like the last bastion of C++17 non-support remaining. I don't fully understand the compilation model used by deploy, do we think this is merely a matter of adding -std=c++17
?