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

Compilation failure on OpenBSD-current #156

Closed
ron-at-swgy opened this issue Jun 18, 2024 · 4 comments
Closed

Compilation failure on OpenBSD-current #156

ron-at-swgy opened this issue Jun 18, 2024 · 4 comments

Comments

@ron-at-swgy
Copy link
Contributor

ron-at-swgy commented Jun 18, 2024

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.

@r-devulap
Copy link
Contributor

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?

@ron-at-swgy
Copy link
Contributor Author

ron-at-swgy commented Jun 20, 2024 via email

@r-devulap
Copy link
Contributor

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

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

ron-at-swgy added a commit to ron-at-swgy/x86-simd-sort that referenced this issue Jun 20, 2024
This commit includes OpenBSD in the platform checks used to check for
size_t, uint64_t, unsigned long and unsigned long long all being 64
bits in length.

Addtionally, the checks for some `avx513*` flags are removed, as
`avx512fp16` yield an error: "invalid cpu feature string for builtin"
when compiling with clang.

This commit aims to address intel#156
ron-at-swgy added a commit to ron-at-swgy/x86-simd-sort that referenced this issue Jun 20, 2024
This commit includes OpenBSD in the platform checks used to check for
size_t, uint64_t, unsigned long and unsigned long long all being 64
bits in length.

Addtionally, the checks for some `avx513*` flags are removed, as
`avx512fp16` yield an error: "invalid cpu feature string for builtin"
when compiling with clang.

This commit aims to address intel#156
ron-at-swgy added a commit to ron-at-swgy/x86-simd-sort that referenced this issue Jun 20, 2024
This commit includes OpenBSD in the platform checks used to check for
size_t, uint64_t, unsigned long and unsigned long long all being 64
bits in length.

Addtionally, the checks for some `avx513*` flags are removed, as
`avx512fp16` yield an error: "invalid cpu feature string for builtin"
when compiling with clang.

This commit aims to address intel#156
ron-at-swgy added a commit to ron-at-swgy/x86-simd-sort that referenced this issue Jun 21, 2024
This commit includes OpenBSD in the platform checks used to check for
size_t, uint64_t, unsigned long and unsigned long long all being 64
bits in length.

Addtionally, the checks for some `avx513*` flags are removed, as
`avx512fp16` yield an error: "invalid cpu feature string for builtin"
when compiling with clang.

This commit aims to address intel#156
@r-devulap
Copy link
Contributor

Merged into numpy, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants