wip fix torchvision build
The build fails in a spectacular way with errors like the following:
In file included from /usr/include/glog/logging.h:77:
/usr/include/glog/log_severity.h:38:4: error: #error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
38 | # error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
| ^~~~~
[...]
/usr/include/glog/logging.h:1727:1: error: two or more data types in declaration of ‘InstallFailureSignalHandler’
1727 | GLOG_EXPORT void InstallFailureSignalHandler();
| ^~~~~~~~~~~
/usr/include/glog/logging.h:1730:1: error: two or more data types in declaration of ‘IsFailureSignalHandlerInstalled’
1730 | GLOG_EXPORT bool IsFailureSignalHandlerInstalled();
| ^~~~~~~~~~~
/usr/include/glog/logging.h:1736:1: error: two or more data types in declaration of ‘InstallFailureWriter’
1736 | GLOG_EXPORT void InstallFailureWriter(void (*writer)(const char* data,
| ^~~~~~~~~~~
/usr/include/glog/logging.h:1740:25: error: expected initializer before ‘GetStackTrace’
1740 | GLOG_EXPORT std::string GetStackTrace();
There is:
-
an upstream issue about this (https://github.com/pytorch/vision/issues/8307)
-
A suggestion on the OOD of torchvision: From hot123tea123@gmail.com on 2024-02-26: https://github.com/pytorch/vision/releases/tag/v0.17.1
if you fail to build this pkg with error logs like:
#error <glog/logging.h> was not included correctly.
you could try to define
GLOG_USE_GLOG_EXPORT
. see this PKGBUILD for example: https://github.com/archlinuxcn/repo/blob/19cea3cc03a87ddde65db8943212a7c2168a8b19/archlinuxcn/python-mmcv/PKGBUILD#L38
I've tried to get it to work, so far with no success
(╯°□°)╯︵ ┻━┻