Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build main with skcms in msys2/clang64 #3591

Closed
eddiezato opened this issue May 17, 2024 · 9 comments
Closed

Failed to build main with skcms in msys2/clang64 #3591

eddiezato opened this issue May 17, 2024 · 9 comments
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone

Comments

@eddiezato
Copy link

Describe the bug
Errors occur during the build process.

To Reproduce

my script
#!/bin/bash
while getopts 'c' flag ; do
    case "${flag}" in
        c) CLNFL=1 ;;   # clean build
    esac
done

set -e
export CC=clang CXX=clang++
CFL='-flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe'
LFL='-flto=thin -Wl,--gc-sections'

if [[ ! -d libjxl || $CLNFL == 1 ]]; then
    rm -rf libjxl
    git clone --depth 1 https://github.com/libjxl/libjxl.git
fi
cd libjxl/third_party
if [[ -z "$(ls -A skcms)" ]]; then git clone --single-branch https://skia.googlesource.com/skcms; cd skcms; git checkout '42030a7'; cd ..; fi
#if [[ -z "$(ls -A skcms)" ]]; then git clone --single-branch https://skia.googlesource.com/skcms; fi
if [[ -z "$(ls -A sjpeg)" ]]; then git clone --depth 1 https://github.com/webmproject/sjpeg.git; fi
if [[ -z "$(ls -A libjpeg-turbo)" ]]; then git clone --branch "3.0.2" --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git; fi
cd ..
rm -rf build
cmake -B build -G Ninja -S ./ \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTING=OFF \
    -DJPEGXL_ENABLE_JPEGLI=ON \
    -DJPEGXL_ENABLE_DOXYGEN=OFF \
    -DJPEGXL_ENABLE_MANPAGES=OFF \
    -DJPEGXL_ENABLE_BENCHMARK=OFF \
    -DJPEGXL_ENABLE_EXAMPLES=OFF \
    -DJPEGXL_BUNDLE_LIBPNG=OFF \
    -DJPEGXL_ENABLE_JNI=OFF \
    -DJPEGXL_ENABLE_OPENEXR=OFF \
    -DJPEGXL_STATIC=ON \
    -DJPEGXL_WARNINGS_AS_ERRORS=OFF \
    -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
    -DJPEGXL_FORCE_SYSTEM_LCMS2=ON \
    -DJPEGXL_FORCE_SYSTEM_HWY=ON \
    -Wno-dev \
    -DCMAKE_C_FLAGS="$CFL" -DCMAKE_CXX_FLAGS="$CFL" -DCMAKE_EXE_LINKER_FLAGS="$LFL"
ninja -C build
strip -s build/tools/*.exe

Errors

with skcms @ 42030a7
[3/256] Building CXX object lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj
FAILED: lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj
D:\msys2\clang64\bin\clang++.exe -DFJXL_ENABLE_AVX512=0 -DHWY_DISABLED_TARGETS="(HWY_SSSE3|HWY_AVX3|HWY_AVX3_SPR|HWY_AVX3_ZEN4|HWY_SVE|HWY_SVE2|HWY_SVE_256|HWY_SVE2_128|HWY_RVV)" -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -ID:/msys2/home/Gautama/libjxl -ID:/msys2/home/Gautama/libjxl/third_party/skcms -isystem D:/msys2/home/Gautama/libjxl/build/lib/include -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -fno-rtti -O3 -DNDEBUG -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -fmacro-prefix-map=D:/msys2/home/Gautama/libjxl=. -funwind-tables -Xclang -mrelax-all -Wno-builtin-macro-redefined -Wall -fmerge-all-constants -fno-builtin-fwrite -fno-builtin-fread -Wextra -Wc++11-compat -Warray-bounds -Wformat-security -Wimplicit-fallthrough -Wno-register -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wvla -Wdeprecated-increment-bool -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wliteral-conversion -Wno-c++98-compat -Wno-unused-command-line-argument -Wprivate-header -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -Wunreachable-code -Wunused-comparison -Wno-cast-align -Wno-double-promotion -Wno-float-equal -Wno-format-nonliteral -Wno-shadow -Wno-sign-conversion -Wno-zero-as-null-pointer-constant -Wno-used-but-marked-unused -Wno-unused-template -Wno-unused-member-function -Wno-shadow-field-in-constructor -Wno-language-extension-token -Wno-global-constructors -Wno-c++98-compat-pedantic -DJPEGXL_ENABLE_SKCMS=1 -DHWY_SHARED_DEFINE -Wno-psabi -MD -MT lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj -MF lib\CMakeFiles\jxl_cms.dir\__\third_party\skcms\skcms.cc.obj.d -o lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj -c D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:157:15: error: always_inline function '_mm512_cvtph_ps' requires target feature 'evex512', but would be inlined into function 'F_from_Half' that is compiled without support for 'evex512'
  157 |     return (F)_mm512_cvtph_ps((__m256i)half);
      |               ^
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:229:12: error: always_inline function '_mm512_mask_floor_ps' requires target feature 'evex512', but would be inlined into function 'floor_' that is compiled without support for 'evex512'
  229 |     return _mm512_mask_floor_ps(x, (__mmask16)-1, x);
      |            ^
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:517:18: error: '__builtin_ia32_gathersiv16si' needs target feature avx512f,evex512
  517 |     U32 v = (U32)_mm512_i32gather_epi32((__m512i)(3*ix), p4, 1);
      |                  ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7698:13: note: expanded from macro '_mm512_i32gather_epi32'
 7698 |   ((__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:517:18: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_24' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7698:51: note: expanded from macro '_mm512_i32gather_epi32'
 7698 |   ((__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \
      |                                                   ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:22: error: '__builtin_ia32_gathersiv8di' needs target feature avx512f,evex512
  573 |         __m512i lo = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 0), p8, 1),
      |                      ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:13: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:22: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_48' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:49: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |                                                 ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:45: error: '__builtin_ia32_extracti32x8_mask' needs target feature avx512dq,evex512
  573 |         __m512i lo = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 0), p8, 1),
      |                                             ^
D:/msys2/clang64/lib/clang/18/include/avx512dqintrin.h:1256:13: note: expanded from macro '_mm512_extracti32x8_epi32'
 1256 |   ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:22: error: '__builtin_ia32_gathersiv8di' needs target feature avx512f,evex512
  574 |                 hi = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 1), p8, 1);
      |                      ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:13: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:22: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_48' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:49: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |                                                 ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:45: error: '__builtin_ia32_extracti32x8_mask' needs target feature avx512dq,evex512
  574 |                 hi = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 1), p8, 1);
      |                                             ^
D:/msys2/clang64/lib/clang/18/include/avx512dqintrin.h:1256:13: note: expanded from macro '_mm512_extracti32x8_epi32'
 1256 |   ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:184:17: error: '__builtin_ia32_vcvtps2ph512_mask' needs target feature avx512f,evex512
  184 |     return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION );
      |                 ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:3800:31: note: expanded from macro '_mm512_cvtps_ph'
 3800 | #define _mm512_cvtps_ph       _mm512_cvt_roundps_ph
      |                               ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:3786:13: note: expanded from macro '_mm512_cvt_roundps_ph'
 3786 |   ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
      |             ^
11 errors generated.
[20/256] Building CXX object lib/CMakeFiles/jxl_cms.dir/jxl/cms/jxl_cms.cc.obj
ninja: build stopped: subcommand failed.
with skcms @ 9478a63
[234/256] Linking CXX executable tools\djxl.exe
FAILED: tools/djxl.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && D:\msys2\clang64\bin\clang++.exe -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -fno-rtti -O3 -DNDEBUG -flto=thin -Wl,--gc-sections -static -static-libgcc -static-libstdc++ tools/CMakeFiles/djxl.dir/djxl_main.cc.obj -o tools\djxl.exe -Wl,--out-implib,tools\libdjxl.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -Wl,-Bstatic  -lstdc++  -lpthread  -Wl,-Bdynamic  lib/libjxl.a  lib/libjxl_extras_codec.a  lib/libjxl_threads.a  tools/libjxl_tool.a  lib/libjxl.a  lib/libjxl_cms.a  D:/msys2/clang64/lib/libbrotlidec.a  D:/msys2/clang64/lib/libbrotlicommon.a  D:/msys2/clang64/lib/libbrotlienc.a  D:/msys2/clang64/lib/libgif.a  D:/msys2/clang64/lib/libjpeg.a  third_party/sjpeg/libsjpeg.a  D:/msys2/clang64/lib/libpng.a  D:/msys2/clang64/lib/libz.a  -pthread  -Wl,-Bstatic  -lstdc++  -lpthread  -Wl,-Bdynamic  D:/msys2/clang64/lib/libhwy.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
ld.lld: error: undefined symbol: skcms_private::baseline::run_program(skcms_private::Op const*, void const**, long long, char const*, char*, int, unsigned long long, unsigned long long)
>>> referenced by D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc
>>>               libjxl_cms.a(skcms.cc.obj)

ld.lld: error: undefined symbol: skcms_private::skx::run_program(skcms_private::Op const*, void const**, long long, char const*, char*, int, unsigned long long, unsigned long long)
>>> referenced by D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc
>>>               libjxl_cms.a(skcms.cc.obj)

ld.lld: error: undefined symbol: skcms_private::hsw::run_program(skcms_private::Op const*, void const**, long long, char const*, char*, int, unsigned long long, unsigned long long)
>>> referenced by D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc
>>>               libjxl_cms.a(skcms.cc.obj)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[251/256] Building CXX object lib/CMakeFiles/jxl_extras_core_nocodec-obj.dir/extras/enc/pnm.cc.obj
ninja: build stopped: subcommand failed.

Environment

  • OS: Windows 11 Pro 22631.3593
  • Environment: msys2/clang64
  • Compiler version: clang 18.1.5
  • CPU type: x86_64
@eddiezato eddiezato changed the title Failed to build with skcms in msys2/clang64 Failed to build main with skcms in msys2/clang64 May 17, 2024
@mo271
Copy link
Member

mo271 commented May 17, 2024

Thanks for the report. Just casually looking at the script: do you also need to install highway somehow?
you can also get the stuff in third_party with git submodule update --init --recursive, I suppos, or use ./deps.sh.

@eddiezato
Copy link
Author

eddiezato commented May 17, 2024

Using system hwy:
-DJPEGXL_FORCE_SYSTEM_HWY=ON
clang64/mingw-w64-clang-x86_64-highway 1.1.0-1 [installed]

UPD: with third_party/highway
[4/267] Building CXX object lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj
FAILED: lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj
D:\msys2\clang64\bin\clang++.exe -DFJXL_ENABLE_AVX512=0 -DHWY_DISABLED_TARGETS="(HWY_SSSE3|HWY_AVX3|HWY_AVX3_SPR|HWY_AVX3_ZEN4|HWY_SVE|HWY_SVE2|HWY_SVE_256|HWY_SVE2_128|HWY_RVV)" -DHWY_STATIC_DEFINE -DTOOLCHAIN_MISS_ASM_HWCAP_H -DTOOLCHAIN_MISS_SYS_AUXV_H -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -ID:/msys2/home/Gautama/libjxl -ID:/msys2/home/Gautama/libjxl/third_party/highway -ID:/msys2/home/Gautama/libjxl/third_party/skcms -isystem D:/msys2/home/Gautama/libjxl/build/lib/include -flto=thin -ffunction-sections -fdata-sections -march=native -mtune=native -O3 -pipe -fno-rtti -O3 -DNDEBUG -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -fmacro-prefix-map=D:/msys2/home/Gautama/libjxl=. -funwind-tables -Xclang -mrelax-all -Wno-builtin-macro-redefined -Wall -fmerge-all-constants -fno-builtin-fwrite -fno-builtin-fread -Wextra -Wc++11-compat -Warray-bounds -Wformat-security -Wimplicit-fallthrough -Wno-register -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wvla -Wdeprecated-increment-bool -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wliteral-conversion -Wno-c++98-compat -Wno-unused-command-line-argument -Wprivate-header -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -Wunreachable-code -Wunused-comparison -Wno-cast-align -Wno-double-promotion -Wno-float-equal -Wno-format-nonliteral -Wno-shadow -Wno-sign-conversion -Wno-zero-as-null-pointer-constant -Wno-used-but-marked-unused -Wno-unused-template -Wno-unused-member-function -Wno-shadow-field-in-constructor -Wno-language-extension-token -Wno-global-constructors -Wno-c++98-compat-pedantic -DJPEGXL_ENABLE_SKCMS=1 -Wno-psabi -MD -MT lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj -MF lib\CMakeFiles\jxl_cms.dir\__\third_party\skcms\skcms.cc.obj.d -o lib/CMakeFiles/jxl_cms.dir/__/third_party/skcms/skcms.cc.obj -c D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:157:15: error: always_inline function '_mm512_cvtph_ps' requires target feature 'evex512', but would be inlined into function 'F_from_Half' that is compiled without support for 'evex512'
  157 |     return (F)_mm512_cvtph_ps((__m256i)half);
      |               ^
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:229:12: error: always_inline function '_mm512_mask_floor_ps' requires target feature 'evex512', but would be inlined into function 'floor_' that is compiled without support for 'evex512'
  229 |     return _mm512_mask_floor_ps(x, (__mmask16)-1, x);
      |            ^
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:517:18: error: '__builtin_ia32_gathersiv16si' needs target feature avx512f,evex512
  517 |     U32 v = (U32)_mm512_i32gather_epi32((__m512i)(3*ix), p4, 1);
      |                  ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7698:13: note: expanded from macro '_mm512_i32gather_epi32'
 7698 |   ((__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:517:18: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_24' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7698:51: note: expanded from macro '_mm512_i32gather_epi32'
 7698 |   ((__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \
      |                                                   ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:22: error: '__builtin_ia32_gathersiv8di' needs target feature avx512f,evex512
  573 |         __m512i lo = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 0), p8, 1),
      |                      ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:13: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:22: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_48' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:49: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |                                                 ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:573:45: error: '__builtin_ia32_extracti32x8_mask' needs target feature avx512dq,evex512
  573 |         __m512i lo = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 0), p8, 1),
      |                                             ^
D:/msys2/clang64/lib/clang/18/include/avx512dqintrin.h:1256:13: note: expanded from macro '_mm512_extracti32x8_epi32'
 1256 |   ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:22: error: '__builtin_ia32_gathersiv8di' needs target feature avx512f,evex512
  574 |                 hi = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 1), p8, 1);
      |                      ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:13: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:22: error: always_inline function '_mm512_undefined_epi32' requires target feature 'evex512', but would be inlined into function 'gather_48' that is compiled without support for 'evex512'
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:7722:49: note: expanded from macro '_mm512_i32gather_epi64'
 7722 |   ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
      |                                                 ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:574:45: error: '__builtin_ia32_extracti32x8_mask' needs target feature avx512dq,evex512
  574 |                 hi = _mm512_i32gather_epi64(_mm512_extracti32x8_epi32((__m512i)(6*ix), 1), p8, 1);
      |                                             ^
D:/msys2/clang64/lib/clang/18/include/avx512dqintrin.h:1256:13: note: expanded from macro '_mm512_extracti32x8_epi32'
 1256 |   ((__m256i)__builtin_ia32_extracti32x8_mask((__v16si)(__m512i)(A), (int)(imm), \
      |             ^
In file included from D:/msys2/home/Gautama/libjxl/third_party/skcms/skcms.cc:2369:
D:/msys2/home/Gautama/libjxl/third_party/skcms/src/Transform_inl.h:184:17: error: '__builtin_ia32_vcvtps2ph512_mask' needs target feature avx512f,evex512
  184 |     return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION );
      |                 ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:3800:31: note: expanded from macro '_mm512_cvtps_ph'
 3800 | #define _mm512_cvtps_ph       _mm512_cvt_roundps_ph
      |                               ^
D:/msys2/clang64/lib/clang/18/include/avx512fintrin.h:3786:13: note: expanded from macro '_mm512_cvt_roundps_ph'
 3786 |   ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
      |             ^
11 errors generated.
[21/267] Building CXX object lib/CMakeFiles/jxl_cms.dir/jxl/cms/jxl_cms.cc.obj
ninja: build stopped: subcommand failed.

@eddiezato
Copy link
Author

v0.10.2 also fails to build with either system hwy or third_party/highway
The last time I built it was April 30 and it was fine.

@kmilos
Copy link

kmilos commented May 21, 2024

Note that we built the MSYS2 packages w/o problems (skcms disabled though), so could be specific to your options? The MSYS2 recipes for highway and libjxl are here:

https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-highway/PKGBUILD
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjxl/PKGBUILD

and the default options for MSYS2 CLANG64 are CFLAGS="-march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong".

However, looks like those packages might predate Clang 18?

@eddiezato
Copy link
Author

@kmilos
IIUC you build with -DJPEGXL_ENABLE_SKCMS=OFF, but I have a problem exactly when building with skcms. 🥲

@kmilos
Copy link

kmilos commented May 21, 2024

@kmilos IIUC you build with -DJPEGXL_ENABLE_SKCMS=OFF, but I have a problem exactly when building with skcms. 🥲

Sure. But Clang 18 build still works when it is off, it really is just skcms related?

@eddiezato
Copy link
Author

it really is just skcms related?

I guess. It builds fine without skcms for me too.

@mo271 mo271 added building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone labels May 27, 2024
@kmilos
Copy link

kmilos commented May 28, 2024

@eddiezato Looks like there were some avx512 related fixes in 18.1.6 that is available now, maybe helped?

@eddiezato
Copy link
Author

@kmilos thanks! It's all fixed now. 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone
Projects
None yet
Development

No branches or pull requests

3 participants