intel/x86-simd-sort

Compilation failure on OpenBSD-current

Closed this issue · 4 comments

Summary

When attempting to build the v5.0 tag, I encounter compilation errors for implicit instantiation of undefined template zmm_vector<unsigned long>. I first encountered this issue while trying to pip install numpy for numpy >= 2.0.0. The trail has led me here :)

Environment information

    (.venv) host$ uname -a
    OpenBSD host 7.5 GENERIC.MP#95 amd64
    (.venv) host$ for suff in vendor id feature; do sysctl machdep.cpu${suff} ; done
    machdep.cpuvendor=GenuineIntel
    machdep.cpuid=0x306c3
    machdep.cpufeature=0xbffbfbff
    (.venv) host$ meson --version
    1.4.1
    (.venv) host$ which cc
    /usr/bin/cc
    (.venv) host$ cc --version
    OpenBSD clang version 16.0.6
    Target: amd64-unknown-openbsd7.5
    Thread model: posix
    InstalledDir: /usr/bin

Steps to reproduce

  $ git clone --depth=1 --branch v5.0 https://github.com/intel/x86-simd-sort.git
  $ cd x86-simd-sort/
  
  $  meson setup --buildtype release builddir && cd builddir
  The Meson build system
  Version: 1.4.1
  Source dir: /home/user/x86-simd-sort
  Build dir: /home/user/x86-simd-sort/builddir
  Build type: native build
  Project name: x86-simd-sort
  Project version: 4.0.0
  C++ compiler for the host machine: c++ (clang 16.0.6 "OpenBSD clang version 16.0.6")
  C++ linker for the host machine: c++ ld.lld 16.0.6
  Host machine cpu family: x86_64
  Host machine cpu: x86_64
  Compiler for C++ supports arguments -march=haswell: YES 
  Compiler for C++ supports arguments -march=skylake-avx512: YES 
  Compiler for C++ supports arguments -march=icelake-client: YES 
  Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
  Build targets in project: 5
  
  x86-simd-sort 4.0.0
  
    Configuration
      Can compile AVX-512 FP16 ISA: YES
      Build test content          : NO
      Build benchmarks            : NO
  
    User defined options
      buildtype                   : release

    $ meson compile 2>&1 | tee /tmp/x86-simd-sort-build.log
    # ... snip
    ../src/xss-common-argsort.h:336:28: error: implicit instantiation of undefined template 'zmm_vector<unsigned long>'
            argvec_right[ii] = argtype::loadu(
                               ^
    ../src/xss-common-includes.h:96:8: note: template is declared here
    struct zmm_vector;
           ^
    In file included from ../lib/x86simdsort-skx.cpp:4:
    In file included from ../src/avx512-64bit-argsort.hpp:11:
    ../src/xss-common-argsort.h:360:27: error: implicit instantiation of undefined template 'zmm_vector<unsigned long>'
                            = argtype::loadu(arg + right + ii * vtype::numlanes);
                              ^
    ../src/xss-common-includes.h:96:8: note: template is declared here
    struct zmm_vector;
           ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    ninja: build stopped: subcommand failed.
    INFO: autodetecting backend as ninja
    INFO: calculating backend command to run: /usr/local/bin/ninja

Additional information

The complete build log can be found here.

Thanks for reporting this @ron-at-swgy. I don't see this build error when building with clang++-16 locally on ubuntu though. Is there a specific docker container for openBSD I can use to reproduce this? Also, could you try this on main branch and let me know if you see the same error?

that's my suspicion too. It might need a fix like this:

struct avx2_vector<size_t> : public avx2_vector<uint64_t> {

Merged into numpy, closing this.