[Openmp-commits] [llvm] [openmp] [flang-rt][CMake] Avoid 'use, intrinsic ::' (PR #205634)

Kelvin Li via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 25 11:55:01 PDT 2026


kkwli wrote:

I still hit an issue when doing a build. It is a scratch build. It fails in the first time. If I do `ninja -j140` again, the build is successful.
```
$ ninja -j140
[8155/8197] Performing configure step for 'runtimes'
Not searching for unused variables given on the command line.
loading initial cache file /scratch/kli/wrk/f/build-flang-local/projects/runtimes/tmp/runtimes-cache-Release.cmake
-- Performing bootstrapping runtimes build.
-- The C compiler identification is Clang 23.0.0
-- The CXX compiler identification is Clang 23.0.0
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /scratch/kli/wrk/f/build-flang-local/./bin/clang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /scratch/kli/wrk/f/build-flang-local/./bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /scratch/kli/wrk/f/build-flang-local/./bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")  
-- Found zstd: /usr/lib64/libzstd.so  
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.7") 
-- Performing Test CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG
-- Performing Test CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG - Success
-- Performing Test C_SUPPORTS_START_NO_UNUSED_ARGUMENTS
-- Performing Test C_SUPPORTS_START_NO_UNUSED_ARGUMENTS - Success
-- Performing Test CXX_SUPPORTS_NOSTDLIBXX_FLAG
-- Performing Test CXX_SUPPORTS_NOSTDLIBXX_FLAG - Success
-- Performing Test CXX_SUPPORTS_NOSTDINCXX_FLAG
-- Performing Test CXX_SUPPORTS_NOSTDINCXX_FLAG - Success
-- Linker detection: GNU ld
...
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- Looking for sinf128 in m
-- Looking for sinf128 in m - found
-- Configuring done (19.1s)
-- Generating done (0.1s)
-- Build files have been written to: /scratch/kli/wrk/f/build-flang-local/runtimes/runtimes-bins
[8194/8197] Performing build step for 'runtimes'
[103/197] Building CXX object openmp/runti.../CMakeFiles/obj.omp.dir/z_Linux_util.cpp.o
/scratch/kli/llvm-project/openmp/runtime/src/z_Linux_util.cpp:443:7: warning: unused variable 'status' [-Wunused-variable]
  443 |   int status;
      |       ^~~~~~
/scratch/kli/llvm-project/openmp/runtime/src/z_Linux_util.cpp:528:7: warning: unused variable 'status' [-Wunused-variable]
  528 |   int status, old_type, old_state;
      |       ^~~~~~
/scratch/kli/llvm-project/openmp/runtime/src/z_Linux_util.cpp:528:15: warning: unused variable 'old_type' [-Wunused-variable]
  528 |   int status, old_type, old_state;
      |               ^~~~~~~~
/scratch/kli/llvm-project/openmp/runtime/src/z_Linux_util.cpp:528:25: warning: unused variable 'old_state' [-Wunused-variable]
  528 |   int status, old_type, old_state;
      |                         ^~~~~~~~~
4 warnings generated.
[126/197] Building Fortran object flang-rt...akeFiles/flang-rt-mod.dir/cudadevice.f90.o
FAILED: flang-rt/lib/runtime/CMakeFiles/flang-rt-mod.dir/cudadevice.f90.o /scratch/kli/wrk/f/build-flang-local/lib/clang/23/finclude/flang/powerpc64le-unknown-linux-gnu/cudadevice.mod 
/scratch/kli/wrk/f/build-flang-local/./bin/flang --target=powerpc64le-unknown-linux-gnu -I/scratch/kli/llvm-project/flang-rt/lib/runtime -I/scratch/kli/llvm-project/flang-rt/include -I/scratch/kli/llvm-project/flang-rt/../flang/include -I/scratch/kli/wrk/f/build-flang-local/runtimes/runtimes-bins/flang-rt -I/scratch/kli/llvm-project/cmake/Modules/../../libc -O3 -module-dir/scratch/kli/wrk/f/build-flang-local/lib/clang/23/finclude/flang/powerpc64le-unknown-linux-gnu -fPIC -cpp -mmlir -ignore-missing-type-desc -fno-lto -fintrinsic-modules-path=/scratch/kli/wrk/f/build-flang-local/lib/clang/23/finclude/flang/powerpc64le-unknown-linux-gnu -Xflang -fno-reformat --offload-host-only -xcuda -ffixed-line-length-72 -c flang-rt/lib/runtime/CMakeFiles/flang-rt-mod.dir/cudadevice.f90-pp.f90 -o flang-rt/lib/runtime/CMakeFiles/flang-rt-mod.dir/cudadevice.f90.o
error: Semantic errors in flang-rt/lib/runtime/CMakeFiles/flang-rt-mod.dir/cudadevice.f90-pp.f90
error: Cannot read required CUDA intrinsic module '__cuda_builtins'; check -fintrinsic-modules-path or rebuild the Fortran intrinsic modules
[184/197] Building CXX object flang-rt/lib...ng_rt.runtime.dir/extrema-maxloc-dim.cpp.o
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /scratch/kli/wrk/f/build-flang-local/runtimes/runtimes-stamps/runtimes-build 
cd /scratch/kli/wrk/f/build-flang-local/runtimes/runtimes-bins && /compgpfs/build/xlcmpbld/bld_env/LoP/cmake-3.28.2/bin/cmake --build .
ninja: build stopped: subcommand failed.


$ ninja -j140
[0/3] Performing build step for 'runtimes'
[14/14] Building Fortran object flang-rt/l.../flang-rt-mod.dir/cooperative_groups.f90.o
[1/3] No install step for 'runtimes'
[3/3] Completed 'runtimes'

```

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


More information about the Openmp-commits mailing list