[llvm-bugs] [Bug 40223] New: Cannot build OpenMP: "cmake" breaks with "Configuring incomplete, errors occurred!".

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 4 05:23:43 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40223

            Bug ID: 40223
           Summary: Cannot build OpenMP: "cmake" breaks with "Configuring
                    incomplete, errors occurred!".
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: siegmar.gross at informatik.hs-fulda.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 21292
  --> https://bugs.llvm.org/attachment.cgi?id=21292&action=edit
CMakeOutput

Hi,

yesterday I've tried to install llvm-7.0.1 and llvm-trunk on my "SUSE Linux
Enterprise Server 12.3 (x86_64)" with the following commands (gcc-7.3.0
is necessary for CUDA-10.0). I was able to build the compiler, but failed to
build libomptarget. I used the following commands.

set LLVM_VERSION=llvm-trunk
set LLVM_COMPILER=llvm-7.0.0
set DIRPREFIX_PROG=/usr/local
set GCCDIR=gcc-7.3.0
rm -r build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/${LLVM_VERSION} \
  -DCMAKE_BUILD_TYPE:STRING="Release" \
  -DCMAKE_C_COMPILER:STRING="${DIRPREFIX_PROG}/${GCCDIR}/bin/gcc" \
  -DCMAKE_C_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
  -DCMAKE_C_STANDARD_LIBRARIES="-lpthread" \
  -DCMAKE_CXX_COMPILER:STRING="${DIRPREFIX_PROG}/${GCCDIR}/bin/g++" \
  -DCMAKE_CXX_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
  -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
  -DCMAKE_EXE_LINKER_FLAGS:STRING="-m64" \
  -DLLVM_PARALLEL_COMPILE_JOBS:STRING="6" \
  -DLLVM_PARALLEL_LINK_JOBS:STRING="6" \
  -DLLVM_LIBDIR_SUFFIX:STRING="64" \
  -DBUILD_SHARED_LIBS:BOOL=ON \
  -DLLVM_POLLY_LINK_INTO_TOOLS:BOOL=ON \
  -DLLVM_TARGETS_TO_BUILD:STRING="NVPTX;X86" \
  -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_50 \
  -GNinja \
  ../llvm \
  |& tee log.cmake

ninja |& tee log.ninja-build
ninja check |& tee log.ninja-check

rm -rf /usr/local/${LLVM_VERSION}.old
mv /usr/local/${LLVM_VERSION} /usr/local/${LLVM_VERSION}.old
ninja install |& tee log.ninja-install

build OpenMP with "clang".
==========================

cd /usr/local/${LLVM_VERSION}
ln -s lib64 lib
cd /export2/src/${LLVM_VERSION}
rm -r build_openmp_clang
mkdir build_openmp_clang
cd build_openmp_clang
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/${LLVM_VERSION} \
  -DCMAKE_BUILD_TYPE:STRING="Release" \
  -DCMAKE_C_COMPILER:STRING="${DIRPREFIX_PROG}/${LLVM_COMPILER}/bin/clang" \
  -DCMAKE_C_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
  -DCMAKE_C_STANDARD_LIBRARIES="-lpthread" \
  -DCMAKE_CXX_COMPILER:STRING="${DIRPREFIX_PROG}/${LLVM_COMPILER}/bin/clang++"
\
  -DCMAKE_CXX_FLAGS:STRING="-m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses" \
  -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
  -DCUDA_INCLUDE_DIRS:STRING="/usr/local/cuda/include" \
  -DCUDA_LIBRARIES:STRING="/usr/local/cuda/lib64/libcudart.so" \
  -DBUILD_SHARED_LIBS:BOOL=ON \
  -DOPENMP_ENABLE_LIBOMPTARGET:BOOL=ON \
  -DOPENMP_LLVM_LIT_EXECUTABLE:PATH=../llvm/utils/lit \
  -DOPENMP_FILECHECK_EXECUTABLE:PATH=../llvm/utils/FileCheck \
  -DLIBOMP_ENABLE_SHARED:BOOL=ON \
  -DLIBOMP_USE_HWLOC:BOOL=ON \
  -DLIBOMP_HWLOC_INSTALL_DIR:STRING="/usr/local/hwloc-2.0.1" \
 
-DLIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR:STRING="/usr/local/elfutils-0.169/include"
\
 
-DLIBOMPTARGET_DEP_LIBELF_LIBRARIES:STRING="/usr/local/elfutils-0.169/lib64/libelf.so"
\
  -DLIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR:STRING="/usr/include" \
  -DLIBOMPTARGET_DEP_LIBFFI_LIBRARIES:STRING="/usr/lib64/libffi.so" \
  -DLIBOMPTARGET_NVPTX_ENABLE_BCLIB:BOOL=ON \
  -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES:STRING="50,60,70" \
  -DLIBOMPTARGET_DEBUG:BOOL=ON \
  -GNinja \
  ../openmp \
  |& tee log.cmake

"cmake" breaks with "Configuring incomplete, errors occurred!".

loki build_openmp_clang 584 tail -30 log.cmake 
-- LIBOMP: Use TSAN-support     -- FALSE
-- LIBOMP: Use Hwloc library    -- ON
-- Looking for sqrt in m
-- Looking for sqrt in m - found
-- Looking for __atomic_load_1
-- Looking for __atomic_load_1 - not found
-- Looking for __atomic_load_1 in atomic
-- Looking for __atomic_load_1 in atomic - found
-- Found LIBOMPTARGET_DEP_LIBELF: /usr/local/elfutils-0.169/lib64/libelf.so  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Found LIBOMPTARGET_DEP_LIBFFI: /usr/lib64/libffi.so  
-- Found LIBOMPTARGET_DEP_CUDA_DRIVER: /usr/lib64/libcuda.so  
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in
the system.
-- LIBOMPTARGET: Building CUDA offloading plugin.
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the
system.
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in
the system.
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Building CUDA offloading device RTL.
-- Performing Test LIBOMPTARGET_NVPTX_CUDA_COMPILER_SUPPORTS_FLAGS_REQUIRED
-- Performing Test LIBOMPTARGET_NVPTX_CUDA_COMPILER_SUPPORTS_FLAGS_REQUIRED -
Failed
CMake Error at libomptarget/cmake/Modules/LibomptargetUtils.cmake:27 (message):
  LIBOMPTARGET: Cannot build CUDA LLVM bitcode offloading device RTL!
Call Stack (most recent call first):
  libomptarget/deviceRTLs/nvptx/CMakeLists.txt:116 (libomptarget_error_say)


-- Configuring incomplete, errors occurred!
See also
"/export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeOutput.log".
See also
"/export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeError.log".
loki build_openmp_clang 585 




loki CMakeFiles 586 cat CMakeError.log 
Performing C SOURCE FILE Test LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG failed with
the following output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_7216c"
[1/2] Building C object CMakeFiles/cmTC_7216c.dir/src.c.o
warning: unknown warning option '-Wstringop-overflow=0'; did you mean
'-Wshift-overflow'? [-Wunknown-warning-option]
1 warning generated.
[2/2] Linking C executable cmTC_7216c

Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test LIBOMP_HAVE_MMIC_FLAG failed with the following
output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_7b7c8"
[1/2] Building C object CMakeFiles/cmTC_7b7c8.dir/src.c.o
FAILED: CMakeFiles/cmTC_7b7c8.dir/src.c.o 
/usr/local/llvm-7.0.0/bin/clang    -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -DLIBOMP_HAVE_MMIC_FLAG -mmic   -mmic -o
CMakeFiles/cmTC_7b7c8.dir/src.c.o   -c src.c
clang-7: error: unknown argument: '-mmic'
clang-7: error: unknown argument: '-mmic'
ninja: build stopped: subcommand failed.

Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test LIBOMP_HAVE_M32_FLAG failed with the following
output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_ff758"
[1/2] Building C object CMakeFiles/cmTC_ff758.dir/src.c.o
[2/2] Linking C executable cmTC_ff758
FAILED: cmTC_ff758 
: && /usr/local/llvm-7.0.0/bin/clang  -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -DLIBOMP_HAVE_M32_FLAG -m32  
CMakeFiles/cmTC_ff758.dir/src.c.o  -o cmTC_ff758  -rdynamic && :
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../libc.so
when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
i386:x86-64 architecture of input file
`/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../crt1.o' is incompatible with
i386 output
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
i386:x86-64 architecture of input file
`/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../crti.o' is incompatible with
i386 output
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
i386:x86-64 architecture of input file
`/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../crtn.o' is incompatible with
i386 output
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../crt1.o: file class ELFCLASS64
incompatible with ELFCLASS32
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
final link failed: file in wrong format
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.

Source file was:
int main(void) { return 0; }
Determining if the pthread_create exist failed with the following output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_c3725"
[1/2] Building C object CMakeFiles/cmTC_c3725.dir/CheckSymbolExists.c.o
[2/2] Linking C executable cmTC_c3725
FAILED: cmTC_c3725 
: && /usr/local/llvm-7.0.0/bin/clang  -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses   CMakeFiles/cmTC_c3725.dir/CheckSymbolExists.c.o  -o
cmTC_c3725  -rdynamic && :
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
CMakeFiles/cmTC_c3725.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text+0x19): undefined reference to `pthread_create'
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.

File
/export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with
the following output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_2dc58"
[1/2] Building C object CMakeFiles/cmTC_2dc58.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_2dc58
FAILED: cmTC_2dc58 
: && /usr/local/llvm-7.0.0/bin/clang  -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -DCHECK_FUNCTION_EXISTS=pthread_create  
CMakeFiles/cmTC_2dc58.dir/CheckFunctionExists.c.o  -o cmTC_2dc58  -rdynamic
-lpthreads && :
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
cannot find -lpthreads
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.


Determining if files windows.h;psapi.h exist failed with the following output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_0c11e"
[1/2] Building C object CMakeFiles/cmTC_0c11e.dir/CheckIncludeFiles.c.o
FAILED: CMakeFiles/cmTC_0c11e.dir/CheckIncludeFiles.c.o 
/usr/local/llvm-7.0.0/bin/clang    -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -o CMakeFiles/cmTC_0c11e.dir/CheckIncludeFiles.c.o   -c
CheckIncludeFiles.c
CheckIncludeFiles.c:2:10: fatal error: 'windows.h' file not found
#include <windows.h>
         ^~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

Source:
/* */
#include <windows.h>
#include <psapi.h>


int main(void){return 0;}

Determining if the function EnumProcessModules exists in the psapi failed with
the following output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_0bf2b"
[1/2] Building C object CMakeFiles/cmTC_0bf2b.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_0bf2b
FAILED: cmTC_0bf2b 
: && /usr/local/llvm-7.0.0/bin/clang  -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -DCHECK_FUNCTION_EXISTS=EnumProcessModules  
CMakeFiles/cmTC_0bf2b.dir/CheckFunctionExists.c.o  -o cmTC_0bf2b  -rdynamic
-lpsapi && :
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
cannot find -lpsapi
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.


Determining if the function __atomic_load_1 exists failed with the following
output:
Change Dir: /export2/src/llvm-trunk/build_openmp_clang/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/ninja" "cmTC_7eb7c"
[1/2] Building C object CMakeFiles/cmTC_7eb7c.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_7eb7c
FAILED: cmTC_7eb7c 
: && /usr/local/llvm-7.0.0/bin/clang  -m64 -I/usr/local/valgrind/include
-I/usr/include/ncurses -DCHECK_FUNCTION_EXISTS=__atomic_load_1  
CMakeFiles/cmTC_7eb7c.dir/CheckFunctionExists.c.o  -o cmTC_7eb7c  -rdynamic &&
:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
CMakeFiles/cmTC_7eb7c.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text+0x19): undefined reference to `__atomic_load_1'
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.

loki CMakeFiles 587 



Hopefully somebody can fix the problem. Do you need anything else to locate the
error? Thank you very much for any help in advance.


Kind regards

Siegmar

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190104/4d0995fe/attachment-0001.html>


More information about the llvm-bugs mailing list