acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 46 forks source link

python-torch-sparse and python-torch-scatter build error from google-glog #269

Open 4rozenwolves opened 6 months ago

4rozenwolves commented 6 months ago

Both libraries have build error from google-glog.

building 'torch_scatter._version_cpu' extension
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/csrc
gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIC -DWITH_PYTHON -Icsrc -I/usr/lib/python3.12/site-packages/torch/include -I/usr/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3.12/site-packages/torch/include/TH -I/usr/lib/python3.12/site-packages/torch/include/THC -I/usr/include/python3.12 -c csrc/version.cpp -o build/temp.linux-x86_64-cpython-312/csrc/version.o -O3 -Wno-sign-compare -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1018\" -DTORCH_EXTENSION_NAME=_version_cpu -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
In file included from /usr/include/c10/util/logging_is_google_glog.h:50,
                 from /usr/include/c10/util/Logging.h:26,
                 from /usr/include/ATen/core/ivalue_inl.h:25,
                 from /usr/include/ATen/core/ivalue.h:1555,
                 from /usr/include/ATen/core/List_inl.h:4,
                 from /usr/include/ATen/core/List.h:490,
                 from /usr/include/ATen/core/IListRef_inl.h:3,
                 from /usr/include/ATen/core/IListRef.h:631,
                 from /usr/include/ATen/DeviceGuard.h:3,
                 from /usr/include/ATen/ATen.h:9,
                 from /usr/include/torch/csrc/api/include/torch/types.h:3,
                 from /usr/include/torch/script.h:3,
                 from csrc/version.cpp:5:
/usr/include/glog/logging.h:60:4: error: #error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
   60 | #  error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
      |    ^~~~~
zauster commented 4 months ago

Hey, the solution can be found here: https://github.com/rusty1s/pytorch_scatter/issues/443 or https://github.com/zauster/pytorch_sparse/commit/97964df4a50f19ab1a8d84e55a25db6c871cbf42

I tested it and can confirm that the package builds with this flags enabled.

zauster commented 4 months ago

See also PR #270

4rozenwolves commented 4 months ago

Thank you, the new PR is working.