Skip to content

Can't install OPAE-SDK #3164

@DatNguyen97-VN

Description

@DatNguyen97-VN

Hi Admin,
I'm learning OPAE framework i have faced some issues as mentioned below.

Setup info

Ubuntu 20.04

Action

S1: Downloaded opae with latest release at https://github.com/OFS/opae-sdk/releases.
S2: tar xfvz opae-sdk-2.14.0-2.tar.gz
S3: cd opae-sdk-2.14.0-2
S4: mkdir mybuild
S5: cd mybuild
S6: cmake .. -DBUILD_ASE=1
S7: make

Unexpected Behaviour

Scanning dependencies of target mmlink
[ 81%] Building CXX object binaries/mmlink/CMakeFiles/mmlink.dir/main.cpp.o
[ 81%] Linking CXX executable ../../bin/mmlink
[ 81%] Built target mmlink
Scanning dependencies of target opae.io
[ 81%] Building CXX object binaries/opae.io/CMakeFiles/opae.io.dir/main.cpp.o
In file included from /home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.cpp:39:
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h: In member function ‘int vfio_device::set_vf_token(const char*)’:
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:232:55: error: invalid application of ‘sizeof’ to incomplete type ‘vfio_device::set_vf_token(const char*)::vfio_device_feature’
          new uint8_t[sizeof(struct vfio_device_feature) + VFIO_VF_TOKEN_LEN];
                                                       ^
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:234:7: error: invalid use of incomplete type ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     df->argsz = sizeof(df) + VFIO_VF_TOKEN_LEN;
       ^~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:228:12: note: forward declaration of ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     struct vfio_device_feature *df;
            ^~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:235:7: error: invalid use of incomplete type ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     df->flags = VFIO_DEVICE_FEATURE_SET | VFIO_DEVICE_FEATURE_PCI_VF_TOKEN;
       ^~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:228:12: note: forward declaration of ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     struct vfio_device_feature *df;
            ^~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:235:17: error: ‘VFIO_DEVICE_FEATURE_SET’ was not declared in this scope
     df->flags = VFIO_DEVICE_FEATURE_SET | VFIO_DEVICE_FEATURE_PCI_VF_TOKEN;
                 ^~~~~~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:235:17: note: suggested alternative: ‘VFIO_DEVICE_FLAGS_RESET’
     df->flags = VFIO_DEVICE_FEATURE_SET | VFIO_DEVICE_FEATURE_PCI_VF_TOKEN;
                 ^~~~~~~~~~~~~~~~~~~~~~~
                 VFIO_DEVICE_FLAGS_RESET
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:235:43: error: ‘VFIO_DEVICE_FEATURE_PCI_VF_TOKEN’ was not declared in this scope
     df->flags = VFIO_DEVICE_FEATURE_SET | VFIO_DEVICE_FEATURE_PCI_VF_TOKEN;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:235:43: note: suggested alternative: ‘VFIO_DEVICE_API_PCI_STRING’
     df->flags = VFIO_DEVICE_FEATURE_SET | VFIO_DEVICE_FEATURE_PCI_VF_TOKEN;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           VFIO_DEVICE_API_PCI_STRING
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:236:14: error: invalid use of incomplete type ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     memcpy(df->data, vf_token, VFIO_VF_TOKEN_LEN);
              ^~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:228:12: note: forward declaration of ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     struct vfio_device_feature *df;
            ^~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:238:39: error: ‘VFIO_DEVICE_FEATURE’ was not declared in this scope
     ret = ioctl(v_->device.device_fd, VFIO_DEVICE_FEATURE, df);
                                       ^~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:238:39: note: suggested alternative: ‘VFIO_DEVICE_FLAGS_AP’
     ret = ioctl(v_->device.device_fd, VFIO_DEVICE_FEATURE, df);
                                       ^~~~~~~~~~~~~~~~~~~
                                       VFIO_DEVICE_FLAGS_AP
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:239:14: error: possible problem detected in invocation of delete [] operator: [-Werror=delete-incomplete]
     delete[] df;
              ^~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:228:33: error: ‘df’ has incomplete type [-Werror]
     struct vfio_device_feature *df;
                                 ^~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:228:12: note: forward declaration of ‘struct vfio_device::set_vf_token(const char*)::vfio_device_feature’
     struct vfio_device_feature *df;
            ^~~~~~~~~~~~~~~~~~~
/home/tools/opae-sdk-2.14.0-2/binaries/opae.io/main.h:239:14: note: neither the destructor nor the class-specific operator delete [] will be called, even if they are declared when the class is defined
     delete[] df;
              ^~
cc1plus: all warnings being treated as errors
make[2]: *** [binaries/opae.io/CMakeFiles/opae.io.dir/build.make:63: binaries/opae.io/CMakeFiles/opae.io.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3181: binaries/opae.io/CMakeFiles/opae.io.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Please let me know how to fix these errors.
Thank you,
Dat Nguyen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions