[Openmp-commits] [openmp] [OpenMP][RISCV] Add riscv32 support (PR #99494)

Pengcheng Wang via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 19 01:01:29 PDT 2024


wangpc-pp wrote:

> @wangpc-pp could you provide instructions on how to test this patch?
> 
> I can use the setup I have to test libc to test your patch.

Thanks!
The process can be:
1. Build a rv32 Clang/LLVM toolchian.
2. Build openmp and install it to the above toolchain:
```
cmake -DCMAKE_INSTALL_PREFIX=${TOOLCHAIN_PATH} \
    -DCMAKE_C_COMPILER=${TOOLCHAIN_PATH}/bin/clang \
    -DCMAKE_CXX_COMPILER=${TOOLCHAIN_PATH}/bin/clang++ \
    -DOPENMP_ENABLE_LIBOMPTARGET=Off \
    -DCMAKE_C_FLAGS="-march=rv32gc" \
    -DCMAKE_CXX_FLAGS="-march=rv32gc" \
    -DCMAKE_BUILD_TYPE=Release \
    -DLIBOMP_ARCH=riscv32 \
    -DLIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG=On \
    -DLIBOMP_HAVE_AS_NEEDED_FLAG=On \
    -DLIBOMP_HAVE_VERSION_SCRIPT_FLAG=On \
    -DLIBOMP_HAVE_STATIC_LIBGCC_FLAG=On \
    -DLIBOMP_HAVE_Z_NOEXECSTACK_FLAG=On \
    -DDISABLE_OMPD_GDB_PLUGIN=On \
    -DLIBOMP_OMPD_GDB_SUPPORT=Off \
    -DLIBOMP_ENABLE_SHARED=ON \
    ../openmp
```
You may set `LIBOMP_ENABLE_SHARED` to `OFF` to build static libraries.
3. Compile and run tests under `openmp/runtime/src`.

https://github.com/llvm/llvm-project/pull/99494


More information about the Openmp-commits mailing list