intel / he-transformer

nGraph-HE: Deep learning with Homomorphic Encryption (HE) through Intel nGraph
Apache License 2.0
172 stars 35 forks source link

when building ext_seal,it occurs no type named 'index_type' #74

Closed L-coder148 closed 3 years ago

L-coder148 commented 3 years ago

Hi, I install the library on ubuntu20.04. I run cmake .. -DCMAKE_CXX_COMPILER=clang++-6.0 -DNGRAPH_HE_ABY_ENABLE=ON, then run make install,when it comes to build ext_seal, it occurs the following error, I have installed GSL into the default location(/usr/local/) . image The details are as follows

[ 14%] Performing configure step for 'ext_seal'
-- The CXX compiler identification is Clang 6.0.1
-- The C compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-6.0 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type (CMAKE_BUILD_TYPE): RelWithDebInfo
-- Microsoft SEAL debug mode: OFF
-- Library build type (SEAL_LIB_BUILD_TYPE): Static_PIC
-- Looking for C++ include x86intrin.h
-- Looking for C++ include x86intrin.h - found
-- Found MSGSL: /usr/local/include
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable exact version "1.2.11")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal-build
[ 14%] Performing build step for 'ext_seal'
Scanning dependencies of target seal
[  2%] Building CXX object CMakeFiles/seal.dir/seal/batchencoder.cpp.o
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:235:53: error: no type named 'index_type' in
      'gsl::span<const unsigned long, 18446744073709551615>'
        using index_type = decltype(values_matrix)::index_type;
                           ~~~~~~~~~~~~~~~~~~~~~~~~~^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:239:43: error: unknown type name 'index_type'
                values_matrix[static_cast<index_type>(i)];
                                          ^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:280:53: error: no type named 'index_type' in
      'gsl::span<const long, 18446744073709551615>'
        using index_type = decltype(values_matrix)::index_type;
                           ~~~~~~~~~~~~~~~~~~~~~~~~~^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:284:44: error: unknown type name 'index_type'
                (values_matrix[static_cast<index_type>(i)] < 0) ?
                                           ^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:285:76: error: unknown type name 'index_type'
                (modulus + static_cast<uint64_t>(values_matrix[static_cast<index_type>(i)])) :
                                                                           ^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:286:65: error: unknown type name 'index_type'
                static_cast<uint64_t>(values_matrix[static_cast<index_type>(i)]);
                                                                ^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:452:51: error: no type named 'index_type' in
      'gsl::span<unsigned long, 18446744073709551615>'
        using index_type = decltype(destination)::index_type;
                           ~~~~~~~~~~~~~~~~~~~~~~~^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:474:37: error: unknown type name 'index_type'
            destination[static_cast<index_type>(i)] = temp_dest[matrix_reps_index_map_[i]];
                                    ^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:497:51: error: no type named 'index_type' in
      'gsl::span<long, 18446744073709551615>'
        using index_type = decltype(destination)::index_type;
                           ~~~~~~~~~~~~~~~~~~~~~~~^
/mnt/e/GitHub/he-transformer-master/build/ext_seal/src/ext_seal/native/src/seal/batchencoder.cpp:521:37: error: unknown type name 'index_type'
            destination[static_cast<index_type>(i)] = (curr_value > plain_modulus_div_two) ?
                                    ^
10 errors generated.

Hope for your guidance!

L-coder148 commented 3 years ago

Sorry to bother you,I have another question.

  1. I took the test_aby_relu circuit out of this repo, and put them into the repo ABY ABY/src/examples/relu as the following. Y4V5S2I(Q @LVRTG2CK5W75

  2. I install the ngraph and gtestinto /usr/local/ as libngraph.so and libgtest.a.

  3. I added comments,such that aby_util.hpp and relu_aby.hp do not include hear file seal/he_seal_backend.hpp

  4. mydefine.h is for ngraph/log, the code is as following #define PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}"

  5. the CMakeList.txt in the above picture is as following

    SET(NGRAPH_PATH "${PROJECT_SOURCE_DIR}/../../Github/ngraph")
    include_directories(${NGRAPH_PATH}/src)
    Link_DIRECTORIES("/usr/local/lib")
    add_executable(test_aby_relu test_aby_relu.cpp kernel/relu_aby.hpp  kernel/aby_util.hpp kernel/logging/ngraph_he_log.cpp kernel/logging/ngraph_he_log.hpp )
    target_link_libraries(test_aby_relu ABY::aby ENCRYPTO_utils::encrypto_utils libngraph.so gtest)
  6. But when it links to the executable file,it occurs the undefined references to error. image Hope for your guidance!