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

Cannot build Intel Implicit SPMD Program Compiler: CMake Error at cmake/LLVMConfig.cmake: Failed running #10

Closed
kevinsmia1939 opened this issue Apr 18, 2021 · 6 comments

Comments

@kevinsmia1939
Copy link

Hello,

I tried to build Intel® Implicit SPMD Program Compiler (ISPC) but failed.
https://github.com/ispc/ispc

Not really sure what happen, maybe something not compatible with LLVM bundled in the Sdk?

flatpak-builder 1.0.12

-- Detected LLVM version: 11.1.0
CMake Warning at cmake/LLVMConfig.cmake:134 (message):
  LLVM was built without assertions enabled (-DLLVM_ENABLE_ASSERTIONS=OFF).
  This disables dumps, which are required for ISPC to be fully functional.
Call Stack (most recent call first):
  CMakeLists.txt:174 (include)


-- GIT_BINARY: /usr/bin/git
-- M4 macro processor: /usr/bin/m4
-- Found Python3: /usr/bin/python3.8 (found version "3.8.8") found components: Interpreter 
-- Found BISON: /usr/bin/bison (found suitable version "3.6.4", minimum required is "3.0") 
-- Found FLEX: /usr/bin/flex (found suitable version "2.6.4", minimum required is "2.6") 
llvm-config: unknown component name: arm
CMake Error at cmake/LLVMConfig.cmake:119 (message):
  Failed running
  /usr/lib/sdk/llvm11/bin/llvm-config;--libfiles;engine;ipo;bitreader;bitwriter;instrumentation;linker;option;frontendopenmp;x86;arm;aarch64
Call Stack (most recent call first):
  cmake/LLVMConfig.cmake:156 (run_llvm_config)
  CMakeLists.txt:271 (get_llvm_libfiles)


-- Configuring incomplete, errors occurred!

Minimal flatpak manifest that produce this error.

app-id: com.github.ispc.ISPC
runtime: org.freedesktop.Platform
sdk: org.freedesktop.Sdk
runtime-version: '20.08'
sdk-extensions : org.freedesktop.Sdk.Extension.llvm11
command: ISPC
finish-args:
  - --share=ipc
  - --socket=wayland
  - --socket=fallback-x11
  - --device=dri

modules:
  - name: ISPC
    buildsystem: cmake
    build-options:
      - prepend-path: "/usr/lib/sdk/llvm11/bin"
      - prepend-ld-library-path: "/usr/lib/sdk/llvm11/lib"
    config-opts:
      - -DLLVM_DIR=/usr/lib/sdk/llvm11/lib/cmake/llvm
      - -DCMAKE_BUILD_TYPE:STRING=Release
      - -DISPC_INCLUDE_EXAMPLES:BOOL=OFF
      - -DISPC_NO_DUMPS:BOOL=ON
      - -DCMAKE_INSTALL_PREFIX=/app
    sources:
      - type: git
        url: https://github.com/ispc/ispc
        tag: v1.15.0
@Erick555
Copy link
Collaborator

Erick555 commented Apr 18, 2021

llvm-config: unknown component name: arm

arm architcture isn't supported in freedesktop-sdk runtime anymore. The same thing happens with LLVM form runtime. I think you have to set:
-DARM_ENABLED:BOOL=OFF

@kevinsmia1939
Copy link
Author

-DARM_ENABLED:BOOL=OFF

Thanks, this work.

But now ISPC need glibc-32bit, which need libc-32bit.

@Erick555
Copy link
Collaborator

@kevinsmia1939 it's possible to have 64+32bit x86 environment by leveraging org.freedesktop.Sdk.Compat.i386 / org.freedesktop.Sdk.Extension.toolchain-i386 extensions albeit it needs some modifications to the manifest. See steam as example.

@kevinsmia1939
Copy link
Author

kevinsmia1939 commented Apr 18, 2021

@kevinsmia1939 it's possible to have 64+32bit x86 environment by leveraging org.freedesktop.Sdk.Compat.i386 / org.freedesktop.Sdk.Extension.toolchain-i386 extensions albeit it needs some modifications to the manifest. See steam as example.

Thanks, I follow the steam example.
I could not manually build glibc-32 bit so I build ISPC with 32 bit version instead, using the glibc-32 bit from compat sdk.

So I create separate ISPC-32bit.yaml file
I create PR here: flathub/flathub#2282

I think I create ISPC 32 bit and 64 bit(?), but it failed when ISPC was use to build openvkl.
The errors are quite cryptic.

/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/stl_vector.h:1045: std::vector::reference std::vector<llvm::Constant *, std::allocator<llvm::Constant *> >::operator[](std::vector::size_type) [_Tp = llvm::Constant *, _Alloc = std::allocator<llvm::Constant *>]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
/run/build/ISPC-32bit/src/main.cpp(385): FATAL ERROR: Unhandled signal sent to process; terminating.

@kevinsmia1939 kevinsmia1939 reopened this Apr 18, 2021
@Erick555
Copy link
Collaborator

This error comes from runtime gcc and I don't see llvm11 even used in manifest.

@kevinsmia1939
Copy link
Author

@Erick555
Right, I think I will try to use OSPRay superbuild instead, thanks.

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