DGL compile from source error

Hi I tried to compile dgl for mixed precision work with

git clone --recurse-submodules https://github.com/dmlc/dgl.git
cd dgl
mkdir build
cd build
cmake -DUSE_CUDA=ON -DUSE_FP16=ON ..
make -j 8

If I compile with make -j it return error message as follows

In file included from /home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.h(23),
                 from /home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/context_impl.cc(11):
/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/socket.h(252): warning #1292: unknown attribute "nodiscard"
    [[nodiscard]] Error recvPayloadAndFds(T& t1, T& t2, Fds&... fds) {
      ^

compilation aborted for /home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/shm/connection_impl.cc (code 2)
make[2]: *** [third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/build.make:608: third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/transport/shm/connection_impl.cc.o] Error 2
/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(144): error: unexpected designator
        result[0] = {.ptr = data_ + start, .len = size};
                      ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(144): error: unexpected designator
        result[0] = {.ptr = data_ + start, .len = size};
                                            ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(148): error: unexpected designator
            .ptr = data_ + start, .len = header_.kDataPoolByteSize - start};
             ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(148): error: unexpected designator
            .ptr = data_ + start, .len = header_.kDataPoolByteSize - start};
                                   ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(149): error: unexpected designator
        result[1] = {.ptr = data_, .len = end};
                      ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h(149): error: unexpected designator
        result[1] = {.ptr = data_, .len = end};
                                    ^
          detected during:
            instantiation of "ssize_t={__ssize_t={long}} tensorpipe::RingBufferRole<NumRoles, RoleIdx>::readInTx<AllowPartial>(void *, size_t={unsigned long}) [with NumRoles=2, RoleIdx=0, AllowPartial=false]" at line 152 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_read_write_ops.h"
            instantiation of "size_t={unsigned long} tensorpipe::RingbufferReadOperation::handleRead(tensorpipe::RingBufferRole<NumRoles, RoleIdx> &) [with NumRoles=2, RoleIdx=0]" at line 355 of "/home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc"

compilation aborted for /home/dngusdnr1/lib/new_se3/dgl/third_party/tensorpipe/tensorpipe/transport/ibv/connection_impl.cc (code 2)
make[2]: *** [third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/build.make:706: third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/transport/ibv/connection_impl.cc.o] Error 2
[ 50%] Linking C static library libmetis.a
[ 50%] Built target metis
================================================================================
LIBXSMM master-1.16.1-1534 (Linux@galaxy3)
--------------------------------------------------------------------------------
Intel Compiler: icc 2021.5.0, icpc 2021.5.0, and ifort 2021.5.0
C / C++ target: -msse4.2
Fortran target: -msse4.2
--------------------------------------------------------------------------------
Environment: CC CXX FC
--------------------------------------------------------------------------------
BLAS dependency and fallback is removed!
--------------------------------------------------------------------------------
[ 50%] Built target libxsmm
make[1]: *** [CMakeFiles/Makefile2:361: third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Thanks in advance.

which platform are you using? Does it work if compile without -j8?

I tried on ubuntu18.04 with below commands and it works well.

1398  git clone --recurse-submodules https://github.com/dmlc/dgl.git dgl_test
 1399  cd dgl_test/
 1400  mkdir build
 1401  cd build/
 1402  cmake -DUSE_CUDA=ON -DUSE_FP16=ON ..
 1403  make -j8

I encounter same error without j8 option. ( warning with unknown attribute ‘nodiscard’, and error : unexpected designator with dgl/third_party/tensorpipe/tensorpipe/common/ringbuffer_role.h)

My OS system is below.

NAME=“Ubuntu”
VERSION=“20.04.4 LTS (Focal Fossa)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 20.04.4 LTS”
VERSION_ID=“20.04”
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Please let me know if there is anything more I can tell you to solve the problem.

I hope that following information can help for debugging.
Log printed for cmake -DUSE_CUDa=ON -DUSE_FP16=ON ..

-- The C compiler identification is Intel 2021.5.0.20211109
-- The CXX compiler identification is Intel 2021.5.0.20211109
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc - 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: /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Start configuring project dgl
-- Build with CUDA support
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /home/dngusdnr1/anaconda3/envs/se3 (found version "11.3") 
-- Found CUDA_TOOLKIT_ROOT_DIR=/home/dngusdnr1/anaconda3/envs/se3
-- Found CUDA_CUDART_LIBRARY=/home/dngusdnr1/anaconda3/envs/se3/lib64/libcudart.so
-- Found CUDA_CUBLAS_LIBRARY=/home/dngusdnr1/anaconda3/envs/se3/lib64/libcublas.so
-- Found CUDA_CURAND_LIBRARY=/home/dngusdnr1/anaconda3/envs/se3/lib64/libcurand.so
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Found OpenMP_C: -qopenmp (found version "5.0") 
-- Found OpenMP_CXX: -qopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "5.0")  
-- Build with OpenMP.
-- Build with LIBXSMM optimization.
-- Build with fp16 to support mixed precision training
-- -qopenmp -O2 -Wall -fPIC -std=c++14  -DUSE_AVX -DUSE_LIBXSMM -DDGL_CPU_LLC_SIZE=40000000 -DUSE_FP16 -DIDXTYPEWIDTH=64 -DREALTYPEWIDTH=32
-- Running GPU architecture autodetection
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
-- Found CUDA arch 8.6 8.6 8.6 8.6 8.6 8.6 8.6 8.6
-- CUDA flags: -Xcompiler ,-qopenmp,-O2,-Wall,-fPIC,-std=c++14,,-DUSE_AVX,-DUSE_LIBXSMM,-DDGL_CPU_LLC_SIZE=40000000,-DUSE_FP16,-DIDXTYPEWIDTH=64,-DREALTYPEWIDTH=32;--expt-relaxed-constexpr;-gencode;arch=compute_86,code=sm_86;--expt-extended-lambda;-Wno-deprecated-declarations;-std=c++14
-- Found OpenMP_C: -qopenmp (found version "5.0") 
-- Found OpenMP_CXX: -qopenmp (found version "5.0") 
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- /home/dngusdnr1/lib/dgl/third_party/dmlc-core/cmake/build_config.h.in -> include/dmlc/build_config.h
-- Performing Test SUPPORT_MSSE2
-- Performing Test SUPPORT_MSSE2 - Success
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
-- Performing Test UV_LINT_W4
-- Performing Test UV_LINT_W4 - Failed
-- Performing Test UV_LINT_NO_UNUSED_PARAMETER_MSVC
-- Performing Test UV_LINT_NO_UNUSED_PARAMETER_MSVC - Failed
-- Performing Test UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC
-- Performing Test UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC - Failed
-- Performing Test UV_LINT_NO_NONSTANDARD_MSVC
-- Performing Test UV_LINT_NO_NONSTANDARD_MSVC - Failed
-- Performing Test UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC
-- Performing Test UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC - Failed
-- Performing Test UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC
-- Performing Test UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC - Failed
-- Performing Test UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC
-- Performing Test UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC - Failed
-- Performing Test UV_LINT_NO_HIDES_LOCAL
-- Performing Test UV_LINT_NO_HIDES_LOCAL - Failed
-- Performing Test UV_LINT_NO_HIDES_PARAM
-- Performing Test UV_LINT_NO_HIDES_PARAM - Failed
-- Performing Test UV_LINT_NO_HIDES_GLOBAL
-- Performing Test UV_LINT_NO_HIDES_GLOBAL - Failed
-- Performing Test UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC
-- Performing Test UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC - Failed
-- Performing Test UV_LINT_NO_UNSAFE_MSVC
-- Performing Test UV_LINT_NO_UNSAFE_MSVC - Failed
-- Performing Test UV_LINT_WALL
-- Performing Test UV_LINT_WALL - Success
-- Performing Test UV_LINT_NO_UNUSED_PARAMETER
-- Performing Test UV_LINT_NO_UNUSED_PARAMETER - Success
-- Performing Test UV_LINT_STRICT_PROTOTYPES
-- Performing Test UV_LINT_STRICT_PROTOTYPES - Success
-- Performing Test UV_LINT_EXTRA
-- Performing Test UV_LINT_EXTRA - Success
-- Performing Test UV_LINT_UTF8_MSVC
-- Performing Test UV_LINT_UTF8_MSVC - Failed
-- Performing Test UV_F_STRICT_ALIASING
-- Performing Test UV_F_STRICT_ALIASING - Success
-- summary of build options:
    Install prefix:  /usr/local
    Target system:   Linux
    Compiler:
      C compiler:    /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc
      CFLAGS:         -qopenmp -O2 -Wall -fPIC  -DUSE_AVX -DUSE_LIBXSMM -DDGL_CPU_LLC_SIZE=40000000 -DUSE_FP16 -DIDXTYPEWIDTH=64 -DREALTYPEWIDTH=32 -DLINUX -D_FILE_OFFSET_BITS=64 -xHost -std=c99 -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3

-- Found uv: 1.38.1 (found version "1.38.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dngusdnr1/lib/dgl/build

And the output of cmake --version

cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).```

Compiler type was a problem. My default compiler was set to icc and icpc.

When I change it to gcc and g++, then everything become fine.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.