kamathhrishi opened a new issue #4940: Build issues 
URL: https://github.com/apache/incubator-tvm/issues/4940
 
 
   I tried to install TVM with SGX support. When building using CMake the 
versions seem fine.
   
   This was on Ubuntu 18.04. 
   
   ```(tf2) hrishikesh~/tvm/build$ cmake ..
   -- The C compiler identification is GNU 5.5.0
   -- The CXX compiler identification is GNU 7.4.0
   -- Check for working C compiler: /usr/bin/cc
   -- Check for working C compiler: /usr/bin/cc -- works
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Detecting C compile features
   -- Detecting C compile features - done
   -- Check for working CXX compiler: /usr/bin/c++
   -- Check for working CXX compiler: /usr/bin/c++ -- works
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Build with RPC support...
   -- Build with Graph runtime support...
   -- Build VTA runtime with target: sim
   -- Build with SGX support (SIM)
   -- Link with dynamic LLVM library
   -- Found LLVM_INCLUDE_DIRS=/usr/lib/llvm-6.0/include
   -- Found LLVM_DEFINITIONS=-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
   -- Found TVM_LLVM_VERSION=60
   -- Build with LLVM 6.0.0
   -- Set TVM_LLVM_VERSION=60
   -- Build with contrib.sort
   -- Build with contrib.hybriddump
   -- Performing Test SUPPORT_CXX11
   -- Performing Test SUPPORT_CXX11 - Success
   -- Build with c++11
   -- Build with thread support...
   -- Looking for pthread.h
   -- Looking for pthread.h - found
   -- Looking for pthread_create
   -- Looking for pthread_create - not found
   -- Check if compiler accepts -pthread
   -- Check if compiler accepts -pthread - yes
   -- Found Threads: TRUE  
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/hrishikesh/tvm/build ```
   
   But , when I run ```make -j4``
   
   I get these errors 
   
   ```Scanning dependencies of target tvm
   [  1%] Building C object 
CMakeFiles/tvm_t.dir/src/runtime/sgx/trusted/tvm_t.c.o
   [  1%] Building CXX object CMakeFiles/vta_fsim.dir/vta/src/device_api.cc.o
   cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but 
not for C
   [  1%] Building CXX object CMakeFiles/vta_tsim.dir/vta/src/device_api.cc.o
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:11:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /usr/include/x86_64-linux-gnu/sys/uio.h: In function ‘readv’:
   /usr/include/x86_64-linux-gnu/sys/uio.h:42:3: error: expected declaration 
specifiers before ‘__wur’
      __wur;
      ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:53:3: error: expected ‘=’, ‘,’, ‘;’, 
‘asm’ or ‘__attribute__’ before ‘__wur’
      __wur;
      ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:68:28: error: expected ‘=’, ‘,’, 
‘;’, ‘asm’ or ‘__attribute__’ before ‘__wur’
             __off_t __offset) __wur;
                               ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:80:22: error: expected ‘=’, ‘,’, 
‘;’, ‘asm’ or ‘__attribute__’ before ‘__wur’
       __off_t __offset) __wur;
                         ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:107:5: error: unknown type name 
‘__off64_t’
        __off64_t __offset) __wur;
        ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:119:6: error: unknown type name 
‘__off64_t’
         __off64_t __offset) __wur;
         ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:128:36: error: expected ‘=’, ‘,’, 
‘;’, ‘asm’ or ‘__attribute__’ before ‘__wur’
       __off_t __offset, int ___flags) __wur;
                                       ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:132:36: error: expected ‘=’, ‘,’, 
‘;’, ‘asm’ or ‘__attribute__’ before ‘__wur’
        __off_t __offset, int __flags) __wur;
                                       ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:153:20: error: unknown type name 
‘__off64_t’
          int __count, __off64_t __offset,
                       ^
   /usr/include/x86_64-linux-gnu/sys/uio.h:158:21: error: unknown type name 
‘__off64_t’
           int __count, __off64_t __offset,
                        ^
   In file included from /usr/include/x86_64-linux-gnu/sys/uio.h:168:0,
                    from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:11,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /usr/include/x86_64-linux-gnu/bits/uio-ext.h:29:34: error: unknown type name 
‘pid_t’
    extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
                                     ^
   /usr/include/x86_64-linux-gnu/bits/uio-ext.h:37:35: error: unknown type name 
‘pid_t’
    extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
                                      ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:13:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /home/hrishikesh/incubator-teaclave-sgx-sdk/edl/inc/dirent.h:21:1: warning: 
empty declaration
    struct dirent_t
    ^
   /home/hrishikesh/incubator-teaclave-sgx-sdk/edl/inc/dirent.h:30:1: warning: 
empty declaration
    struct dirent64_t
    ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:15:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:58:3: error: storage class 
specified for parameter ‘div_t’
    } div_t;
      ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:63:3: error: storage class 
specified for parameter ‘ldiv_t’
    } ldiv_t;
      ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:68:3: error: storage class 
specified for parameter ‘lldiv_t’
    } lldiv_t;
      ^
   In file included from 
/opt/intel/sgxsdk/sgxsdk/include/tlibc/sys/stdint.h:22:0,
                    from /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdint.h:22,
                    from 
/home/hrishikesh/tvm/3rdparty/dlpack/include/dlpack/dlpack.h:29,
                    from 
/home/hrishikesh/tvm/include/tvm/runtime/c_runtime_api.h:68,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:4,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/sys/cdefs.h:94:28: error: expected 
declaration specifiers before ‘__attribute__’
    #define _TLIBC_NORETURN_   __attribute__ ((__noreturn__))
                               ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:88:1: note: in expansion of 
macro ‘_TLIBC_NORETURN_’
    _TLIBC_NORETURN_ void _TLIBC_CDECL_ abort(void);
    ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.h:15:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:1:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:96:1: error: expected 
declaration specifiers before ‘div_t’
    div_t   _TLIBC_CDECL_ div(int, int);
    ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:99:1: error: expected 
declaration specifiers before ‘ldiv_t’
    ldiv_t  _TLIBC_CDECL_ ldiv(long, long);
    ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:112:1: error: expected 
declaration specifiers before ‘lldiv_t’
    lldiv_t
    ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:133:89: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(int     _TLIBC_CDECL_, atexit, void 
(_TLIBC_CDECL_ *)(void));
                                                                                
            ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:134:63: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(int     _TLIBC_CDECL_, rand, void);
                                                                  ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:135:68: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(void    _TLIBC_CDECL_, srand, unsigned);
                                                                       ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:136:62: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(void    _TLIBC_CDECL_, exit, int);
                                                                 ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:137:63: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(void    _TLIBC_CDECL_, _Exit, int);
                                                                  ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:138:73: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(char *  _TLIBC_CDECL_, getenv, const char *);
                                                                            ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdlib.h:139:73: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(int     _TLIBC_CDECL_, system, const char *);
                                                                            ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:3:0:
   /opt/intel/sgxsdk/sgxsdk/include/sgx_trts.h:71:12: error: section attribute 
not allowed for ‘sgx_is_enclave_crashed’
    int SGXAPI sgx_is_enclave_crashed(void) __attribute__((section(".nipx")));
               ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:4:0:
   /opt/intel/sgxsdk/sgxsdk/include/sgx_lfence.h:41:13: error: storage class 
specified for parameter ‘__builtin_ia32_lfence’
    extern void __builtin_ia32_lfence(void);
                ^
   In file included from 
/opt/intel/sgxsdk/sgxsdk/include/tlibc/mbusafecrt.h:23:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:7:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:48:13: error: storage class 
specified for parameter ‘errno_t’
    typedef int errno_t;
                ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:82:1: error: expected 
declaration specifiers before ‘errno_t’
    errno_t _TLIBC_CDECL_ memset_s(void *s, size_t smax, int c, size_t n);
    ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:87:80: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(char * _TLIBC_CDECL_, strcat, char *, const 
char *);
                                                                                
   ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:88:80: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(char * _TLIBC_CDECL_, strcpy, char *, const 
char *);
                                                                                
   ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:120:72: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(char * _TLIBC_CDECL_, strdup, const char *);
                                                                           ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/string.h:121:87: error: expected 
declaration specifiers before ‘;’ token
    _TLIBC_DEPRECATED_FUNCTION_(char * _TLIBC_CDECL_, stpcpy, char *dest, const 
char *src);
                                                                                
          ^
   In file included from 
/opt/intel/sgxsdk/sgxsdk/include/tlibc/mbusafecrt.h:24:0,
                    from /home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:7:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/stdarg.h:41:21: error: storage class 
specified for parameter ‘va_list’
    typedef __va_list   va_list;
                        ^
   In file included from 
/home/hrishikesh/tvm/src/runtime/sgx/trusted/tvm_t.c:7:0:
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/mbusafecrt.h:26:17: error: storage 
class specified for parameter ‘WCHAR’
    typedef wchar_t WCHAR;
                    ^
   /opt/intel/sgxsdk/sgxsdk/include/tlibc/mbusafecrt.h:32:16: error: expected 
‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strcat_s’
    extern errno_t strcat_s( char* ioDest, size_t inDestBufferSize, const char* 
inSrc );
                   ^
   ``` 
   
   Further 
   
   ```CMakeFiles/tvm_t.dir/build.make:62: recipe for target 
'CMakeFiles/tvm_t.dir/src/runtime/sgx/trusted/tvm_t.c.o' failed
   make[2]: *** [CMakeFiles/tvm_t.dir/src/runtime/sgx/trusted/tvm_t.c.o] Error 1
   CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/tvm_t.dir/all' failed
   make[1]: *** [CMakeFiles/tvm_t.dir/all] Error 2
   make[1]: *** Waiting for unfinished jobs....
   ```
   
   Any idea how to resolve it? 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to