When building on binpackage server (Haswell) for Sandybridge G530 (no AVX) Clang (Gcc also) builds with error: tesseract/src/arch/dotproductavx.cpp:20:6: error: Implementation only for AVX capable architectures Reproducible: Always Steps to Reproduce: 1. build with flags: "-march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer" 2. emerge emerge -av1 app-text/ghostscript-gpl Actual Results: clang++ -Itesseract/include -Itesseract/src/api -Itesseract/src/arch -Itesseract/src/ccmain -Itesseract/src/ccstruct -Itesseract/src/ccutil -Itesseract/src/classify -Itesseract/src/cutil -Itesseract/src/dict -Itesseract/src/lstm -Itesseract/src/opencl -Itesseract/src/textord -Itesseract/src/training -Itesseract/src/viewer -Itesseract/src/wordrec -Ileptonica/src -I./base -I./soobj -march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer -std=c++17 -DHAVE_SSE4_1 -DHAVE_MKSTEMP -DHAVE_FILE64 -DHAVE_FSEEKO -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_SSE2 -DHAVE_DBUS -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1 -DHAVE_SNPRINTF -DBUILD_PDF=1 -I./pdf -march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer -DHAVE_RESTRICT=1 -DUSE_LIBPAPER -fno-strict-aliasing -DHAVE_POPEN_PROTO=1 -DTESSERACT_IMAGEDATA_AS_PIX -DTESSERACT_DISABLE_DEBUG_FONTS -DGRAPHICS_DISABLED -UCLUSTER -DDISABLED_LEGACY_ENGINE -o ./soobj/tesseract_arch_dotproductavx.o -c tesseract/src/arch/dotproductavx.cpp tesseract/src/arch/dotproductavx.cpp:20:6: error: Implementation only for AVX capable architectures 20 | # error Implementation only for AVX capable architectures | ^ 1 error generated. make[2]: *** [base/tesseract.mak:903: soobj/tesseract_arch_dotproductavx.o] Error 1 Expected Results: successful build
Created attachment 901673 [details] emerge --info
Created attachment 901674 [details] build.log (XZ)
``` if HAVE_AVX libtesseract_avx_la_CXXFLAGS = -mavx libtesseract_avx_la_CXXFLAGS += -I$(top_srcdir)/src/ccutil libtesseract_avx_la_SOURCES = src/arch/dotproductavx.cpp libtesseract_la_LIBADD += libtesseract_avx.la noinst_LTLIBRARIES += libtesseract_avx.la endif ``` https://github.com/tesseract-ocr/tesseract/blob/027ad18a8ddeb622b43e83dcc5a326124799cd85/configure.ac#L125
This is nasty. In both tesseract and the bundled copy in ghostscript, it's not easy to override and has no cache variable.