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

Building on RISC-V 64bit on Linux #20

Open
Cryolitia opened this issue Nov 19, 2024 · 3 comments
Open

Building on RISC-V 64bit on Linux #20

Cryolitia opened this issue Nov 19, 2024 · 3 comments

Comments

@Cryolitia
Copy link

Cryolitia commented Nov 19, 2024

Since #6 , is there any possible that openpgl could support riscv64gc.

I am building it on Arch Linux RISC-V :

  1. c++: error: unrecognized command-line option ‘-msse2’
    full log: https://archriscv.felixc.at/.status/log.htm?url=logs/openpgl/openpgl-0.6.0-1.log
  2. I add -DOPENPGL_ISA_SSE4=OFF and -DOPENPGL_ISA_AVX2=OFF then it's a fatal error Must have at least one ISA enabled.
  3. I delete the lines below

    openpgl/CMakeLists.txt

    Lines 69 to 75 in 17ddb61

    if(NOT (OPENPGL_ISA_NEON OR
    OPENPGL_ISA_NEON2X OR
    OPENPGL_ISA_SSE4 OR
    OPENPGL_ISA_AVX2 OR
    OPENPGL_ISA_AVX512))
    message(FATAL_ERROR "Must have at least one ISA enabled.")
    endif()

    And then
/build/openpgl/src/openpgl-0.6.0/openpgl/../third-party/embreeSrc/common/math/../sys/intrinsics.h:15:10: fatal error: immintrin.h: No such file or directory
   15 | #include <immintrin.h>
      |   

I would like to know whether openpgl is glad to continue to support riscv64

@Cryolitia
Copy link
Author

I have managed to port openpgl to use simde, now it could be built on Arch Linux RISC-V. I would like to hear openpgl's maintainers insights about how to port it to widely platforms.

Link: Cryolitia-Forks@77074e2

felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this issue Dec 17, 2024
@wszqkzqk
Copy link

I have managed to port openpgl to use simde, now it could be built on Arch Linux RISC-V. I would like to hear openpgl's maintainers insights about how to port it to widely platforms.

Link: Cryolitia-Forks@77074e2

I think your work is very valuable. However, it looks like a temporary fix rather than a feature that can be integrated into the project directly.

According to the README of simde's explanation about SIMDE_ENABLE_NATIVE_ALIASES:

Unfortunately, this is somewhat error-prone due to portability issues in the APIs, so it's recommended to only do this for testing.

In some cases, there will be conflicts like error: conflicting declaration ‘typedef simde__m128i __m128i’.

If you want to officially integrate simde in a project, you may not use SIMDE_ENABLE_NATIVE_ALIASES, and you may add the simde prefix to the related functions. The current method may be more suitable as a temporary fix.

This may also require more discussion.

@Cryolitia
Copy link
Author

Cryolitia commented Dec 18, 2024

I'm stuck at how to deal with the code in third-party/embreeSrc. It seems like just copied from embree. If I just modify the source code in openpgl, it could make it hard to sync with upstream. The current work is just a work around to just package it, I would like to write a more generic PR after discussing.

wszqkzqk added a commit to lcpu-club/loongarch-packages that referenced this issue Dec 18, 2024
* Apply
Cryolitia-Forks/openpgl@77074e2
to build on loong64
* Use simde to provide x86 intrinsics
  * Bug: error: conflicting declaration ‘typedef simde__m128i __m128i’
  * Temporarily switch to `SIMDE_NO_NATIVE`
  * This actually disables SIMD
* Discussion: RenderKit/openpgl#20

Signed-off-by: Zhou Qiankang <[email protected]>
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