google / fully-homomorphic-encryption

An FHE compiler for C++
Apache License 2.0
3.5k stars 252 forks source link

Error while building with Docker #30

Closed entrust-albert closed 1 year ago

entrust-albert commented 1 year ago

Hello, I am trying to build the project using Docker. I am consistently getting an error during build time, which surprises me since Docker is usually very reliable for this kind of building tasks. I added the --verbose_failures and --sandbox_debug flags in the Dockerifle (line 38) for debugging purposes.

I get the following error:

bosquem@ubuntu:~/HE/homomorphic-demos/wrapperGoSEAL/pruebaTranspiler/fully-homomorphic-encryption$ docker build -t google-fhe-transpiler .
Sending build context to Docker daemon  4.306MB
Step 1/6 : FROM debian:bullseye-20220527
 ---> 4eacea30377a
Step 2/6 : RUN apt-get update && apt-get install -y     gcc     git     libtinfo5   python  python3     python3-pip     wget
 ---> Using cache
 ---> 581dcd5fd83c
Step 3/6 : RUN wget -O bazel "https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-linux-x86_64"     && test "7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901  bazel" = "$(sha256sum bazel)"    && chmod +x bazel   && mv bazel /bin/bazel
 ---> Using cache
 ---> 4fd697db0287
Step 4/6 : WORKDIR /usr/src/fhe/
 ---> Using cache
 ---> 019563bed11b
Step 5/6 : COPY . .
 ---> Using cache
 ---> 442230897327
Step 6/6 : RUN bazel build --verbose_failures --sandbox_debug ...
 ---> Running in 73c181988264
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: 1601 targets (23 packages loaded, 0 targets configured)
DEBUG: Rule 'yosys' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1662445410 +0200"
DEBUG: Repository yosys instantiated at:
  /usr/src/fhe/WORKSPACE:116:19: in <toplevel>
Repository rule new_git_repository defined at:
  /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/external/bazel_tools/tools/build_defs/repo/git.bzl:186:37: in <toplevel>
Analyzing: 1601 targets (90 packages loaded, 674 targets configured)
Analyzing: 1601 targets (93 packages loaded, 5166 targets configured)
Analyzing: 1601 targets (95 packages loaded, 5318 targets configured)
Analyzing: 1601 targets (96 packages loaded, 13176 targets configured)
Analyzing: 1601 targets (116 packages loaded, 20489 targets configured)
Analyzing: 1601 targets (117 packages loaded, 20961 targets configured)
Analyzing: 1601 targets (117 packages loaded, 20961 targets configured)
Analyzing: 1601 targets (117 packages loaded, 20961 targets configured)
Analyzing: 1601 targets (130 packages loaded, 21388 targets configured)
INFO: Analyzed 1601 targets (140 packages loaded, 27907 targets configured).
INFO: Found 1601 targets...
[0 / 130] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[102 / 328] Compiling src/google/protobuf/descriptor.cc; 8s processwrapper-sandbox ... (8 actions, 7 running)
[168 / 328] Compiling src/google/protobuf/compiler/objectivec/objectivec_message.cc; 4s processwrapper-sandbox ... (8 actions, 7 running)
INFO: From Executing genrule @z3//:gen_src/ackermannization/ackermannization_params:
INFO:root:Using /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/188/execroot/com_google_fully_homomorphic_encryption/external/z3/src/ackermannization/ackermannization_params.pyg

...

external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:517:10: note: 'M' was declared here
  517 |   Value *M, *N, *Ptr, *Stride, *Tile;
      |          ^
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp: In member function 'virtual bool {anonymous}::X86LowerAMXIntrinsicsLegacyPass::runOnFunction(llvm::Function&)':
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:531:45: warning: 'Stride' may be used uninitialized in this function [-Wmaybe-uninitialized]
  531 |   Value *StrideDWord = PreBuilder.CreateLShr(Stride, PreBuilder.getInt64(2));
      |                        ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:517:24: note: 'Stride' was declared here
  517 |   Value *M, *N, *Ptr, *Stride, *Tile;
      |                        ^~~~~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:190:30: warning: 'Ptr' may be used uninitialized in this function [-Wmaybe-uninitialized]
  190 |   Value *EltPtr = B.CreateGEP(EltTy, EltBasePtr, Offset);
      |                   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:517:18: note: 'Ptr' was declared here
  517 |   Value *M, *N, *Ptr, *Stride, *Tile;
      |                  ^~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:530:40: warning: 'N' may be used uninitialized in this function [-Wmaybe-uninitialized]
  530 |   Value *NDWord = PreBuilder.CreateLShr(N, PreBuilder.getInt16(2));
      |                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:517:14: note: 'N' was declared here
  517 |   Value *M, *N, *Ptr, *Stride, *Tile;
      |              ^
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:165:35: warning: 'M' may be used uninitialized in this function [-Wmaybe-uninitialized]
  165 |   BasicBlock *RowBody = createLoop(Start, End, Row, B.getInt16(1),
      |                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166 |                                    IntrinName + ".scalarize.rows", B, RowLoop);
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/llvm-project/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:517:10: note: 'M' was declared here
  517 |   Value *M, *N, *Ptr, *Stride, *Tile;
      |          ^
INFO: From Compiling clang/lib/Format/Format.cpp:
external/llvm-project/clang/lib/Format/Format.cpp: In function 'void clang::format::sortCppIncludes(const clang::format::FormatStyle&, const llvm::SmallVectorImpl<clang::format::{anonymous}::IncludeDirective>&, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, llvm::StringRef, clang::tooling::Replacements&, unsigned int*)':
external/llvm-project/clang/lib/Format/Format.cpp:2732:53: warning: 'CursorToEOLOffset' may be used uninitialized in this function [-Wmaybe-uninitialized]
 2732 |       *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
external/llvm-project/clang/lib/Format/Format.cpp:2731:16: warning: 'CursorIndex' may be used uninitialized in this function [-Wmaybe-uninitialized]
 2731 |     if (Cursor && CursorIndex == Index)
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
INFO: From Action transpiler/examples/calculator/calculator_cleartext.ir:
Parsing file 'transpiler/examples/calculator/calculator.cc' with clang...
Generating IR...
INFO: From Action transpiler/data/primitives.ir:
Parsing file 'transpiler/data/primitives.cc' with clang...
Generating IR...
INFO: From Action transpiler/examples/rock_paper_scissor/rock_paper_scissor_interpreted_openfhe.ir:
Parsing file 'transpiler/examples/rock_paper_scissor/rock_paper_scissor.cc' with clang...
Generating IR...
ERROR: /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/external/openfhe/BUILD.bazel:55:6: Foreign Cc - CMake: Building binfhe failed: (Exit 1): process-wrapper failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption && \
  exec env - \
    BAZEL_CXXOPTS='-std=c++17' \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PYTHON_BIN_PATH=/usr/bin/python3 \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/1a4a2fac02d50c77031d44c0d91b8920/process-wrapper '--timeout=0' '--kill_delay=15' /bin/bash -c bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/wrapper_build_script.sh) process-wrapper failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption && \
  exec env - \
    BAZEL_CXXOPTS='-std=c++17' \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PYTHON_BIN_PATH=/usr/bin/python3 \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/1a4a2fac02d50c77031d44c0d91b8920/process-wrapper '--timeout=0' '--kill_delay=15' /bin/bash -c bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/wrapper_build_script.sh)
rules_foreign_cc: Build failed!
rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
rules_foreign_cc: Printing build logs:
_____ BEGIN BUILD LOGS _____
Bazel external C/C++ Rules. Building library binfhe
Environment:______________
BUILD_SCRIPT=bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/build_script.sh
EXT_BUILD_ROOT=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption
BUILD_LOG=bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/CMake.log
PWD=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption
BUILD_WRAPPER_SCRIPT=bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/wrapper_build_script.sh
PYTHON_BIN_PATH=/usr/bin/python3
TMPDIR=/tmp
EXT_BUILD_DEPS=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe.ext_build_deps
BUILD_TMPDIR=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe.build_tmpdir
SHLVL=2
BAZEL_CXXOPTS=-std=c++17
CMAKE_BUILD_PARALLEL_LEVEL=16
INSTALLDIR=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe
PATH=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
__________________________
+ /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/external/cmake-3.22.1-linux-x86_64/bin/cmake -DBUILD_BENCHMARKS=OFF -DBUILD_UNITTESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=crosstool_bazel.cmake -DCMAKE_INSTALL_PREFIX=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe -DCMAKE_PREFIX_PATH=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe.ext_build_deps -DCMAKE_RANLIB= -DCMAKE_MAKE_PROGRAM=/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make -G 'Unix Makefiles' /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/external/openfhe
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - 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: /usr/bin/gcc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building in Release mode
-- BUILD_UNITTESTS:  OFF
-- BUILD_EXAMPLES:   ON
-- BUILD_BENCHMARKS: OFF
-- BUILD_EXTRAS:     OFF
-- BUILD_DOCS:       OFF
-- BUILD_STATIC:     OFF
-- BUILD_SHARED:     ON
-- GIT_SUBMOD_AUTO:  ON
-- WITH_BE2:         ON
-- WITH_BE4:         ON
-- WITH_NTL:         OFF
-- WITH_TCM:         OFF
-- WITH_INTEL_HEXL:  OFF
-- WITH_OPENMP:      ON
-- NATIVE_SIZE:      64
-- CKKS_M_FACTOR:    1
-- WITH_NATIVEOPT:   OFF
-- WITH_COVTEST:     OFF
-- BUILTIN_INFO_AVAILABLE is defined
***** INSTALL IS AT /root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe; to change, run cmake with -DCMAKE_INSTALL_PREFIX=/your/path
-- Architecture is x86_64
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of __int128
-- Check size of __int128 - done
-- Check size of uint64_t
-- Check size of uint64_t - done
-- NATIVEINT is set to 64
-- MATHBACKEND is set to 2
CMake Error at CMakeLists.txt:377 (message):
  Autoconf is not installed.
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found Git: /usr/bin/git (found version "2.30.2") 
-- Configuring incomplete, errors occurred!
See also "/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/3842/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt/bin/external/openfhe/binfhe.build_tmpdir/CMakeFiles/CMakeOutput.log".
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/k8-opt/bin/external/openfhe/binfhe_foreign_cc/CMake.log
INFO: Elapsed time: 3222.532s, Critical Path: 223.31s
INFO: 4095 processes: 208 internal, 3887 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfull
j2kun commented 1 year ago

The key part of the error message appears to be

CMake Error at CMakeLists.txt:377 (message): Autoconf is not installed.

Could you try adding autoconf to the apt-get install command in the Dockerfile and see if that works?

Just looking at that list of installed packages, though, I suspect there may be some other packages missing. I can take a look as well.

entrust-albert commented 1 year ago

Hi, thanks for the response. I tried installing autoconf as you mentioned, but now I seem to have another issue regarding a file that is not found:

./src/misc/util/utilDouble.h:182:10: warning: unused variable 'ten100' [-Wunused-variable]
  182 |     xdbl ten100 = Xdbl_FromDouble( 1e100 );
      |          ^~~~~~
`` Compiling: /src/base/exor/exorUtil.c
src/base/main/mainUtils.c: At top level:
src/base/main/mainUtils.c:25:10: fatal error: readline/readline.h: No such file or directory
   25 | #include <readline/readline.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:176: src/base/main/mainUtils.o] Error 1
make: *** Waiting for unfinished jobs....
`` Compiling: /src/base/ver/verCore.c
src/base/exor/exorUtil.c: In function 'WriteResultIntoFile':
src/base/exor/exorUtil.c:192:9: warning: argument 4 null where non-null expected [-Wnonnull]
  192 |         fprintf( pFile, "\n\nCannot open the output file\n" );
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/base/exor/exorUtil.c:192:9: note: in a call to built-in function '__builtin_fwrite'
src/base/abci/abc.c: In function 'Abc_CommandAbc9Cone':
src/base/abci/abc.c:43683:34: warning: '%0*d' directive writing between 1 and 2147483647 bytes into a region of size 999 [-Wformat-overflow=]
43683 |             sprintf( Buffer, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i );
      |                                  ^~~~
src/base/abci/abc.c:43683:30: note: directive argument in the range [0, 2147483647]
43683 |             sprintf( Buffer, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i );
      |                              ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ./src/base/abc/abc.h:29,
                 from src/base/abci/abc.c:21:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output 7 or more bytes (assuming 2147483653) into a destination of size 1000
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: Leaving directory '/root/.cache/bazel/_bazel_root/595596dc4dacd40e54f4e8ca596c8a84/sandbox/processwrapper-sandbox/4517/execroot/com_google_fully_homomorphic_encryption/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/abc/abc.build_tmpdir'
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/k8-opt-exec-2B5CBBC6/bin/external/abc/abc_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/k8-opt-exec-2B5CBBC6/bin/external/abc/abc_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/k8-opt-exec-2B5CBBC6/bin/external/abc/abc_foreign_cc/Make.log
INFO: Elapsed time: 3094.346s, Critical Path: 209.52s
INFO: 4788 processes: 221 internal, 4567 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
The command '/bin/sh -c bazel build --verbose_failures --sandbox_debug ...' returned a non-zero code: 1
davidbrucecousins commented 1 year ago

I had a similar problem when setting up a new machine (not using Docker though).

It ends up that there is another dependency not listed in the README.md files.

if you look close you see the failure is that it cannot find readline/readline.h:

src/base/main/mainUtils.c:25:10: fatal error: readline/readline.h: No such file or directory
   25 | #include <readline/readline.h>

On my ubuntu machine I fix this with: sudo apt install libreadline-dev

@j2kun might want to update the README.md files in transpiler directory.

j2kun commented 1 year ago

Thanks for the tip, @davidbrucecousins !

j2kun commented 1 year ago

Working on this today. Also working on upgrading the docker image so that we don't need to build LLVM from scratch.

j2kun commented 1 year ago

Note to self: https://github.com/grailbio/bazel-toolchain/issues/162

j2kun commented 1 year ago

I submitted a patch for this issue but it won't be live until after it gets reviewed internally, likely early next week. The issue in https://github.com/google/fully-homomorphic-encryption/issues/30#issuecomment-1322633357 was not fixed yet, but in the mean time the docker container should still build with the way LLVM is currently configured in the workspace file.

The dockerfile you can use until that change is merged:

# To build and run:
#
#   docker build -t google-fhe-transpiler -f docker/debian-bullseye.Dockerfile .
#   docker run --rm -i -t google-fhe-transpiler bash

FROM debian:bullseye-20220527
RUN apt-get update && apt-get install -y \
  gcc \
  git \
  libtinfo5 \
  python \
  python3 \
  python3-pip \
  autoconf \
  libreadline-dev \
  flex \
  bison \
  wget

# Install deps required to install LLVM
RUN apt-get install -y \
  lsb-release \
  software-properties-common \
  gnupg

RUN wget -O llvm.sh https://apt.llvm.org/llvm.sh \
  && chmod +x llvm.sh \
  # It's critical that this version matches the version specified in
  # llvm_toolchain in the WORKSPACE file.
  && ./llvm.sh 13

# Install bazel
RUN wget -O bazel "https://github.com/bazelbuild/bazel/releases/download/5.3.2/bazel-5.3.2-linux-x86_64" \
  && test "973e213b1e9207ccdd3ea4730c0f92cbef769ec112ac2b84980583220d8db845  bazel" = "$(sha256sum bazel)" \
  && chmod +x bazel \
  && mv bazel /bin/bazel

WORKDIR /usr/src/fhe/
COPY . .
RUN bazel build ...
j2kun commented 1 year ago

Give it a try and let me know if it doesn't work!

davidbrucecousins commented 1 year ago

I was never able to get the docker configuration to work, I always built the other way.

On Mon, Nov 28, 2022, 4:01 PM Jeremy Kun @.***> wrote:

Give it a try and let me know if it doesn't work!

— Reply to this email directly, view it on GitHub https://github.com/google/fully-homomorphic-encryption/issues/30#issuecomment-1329756137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3E6YPV5F2O6CBS4MCX373WKUMUPANCNFSM6AAAAAAROYN6SQ . You are receiving this because you were mentioned.Message ID: @.***>