Skip to content

Commit 4cdab5e

Browse files
cgouertjimouris
andcommitted
Update Dockerfile and add instructions
Co-authored-by: Dimitris Mouris <[email protected]>
1 parent 7b80bbd commit 4cdab5e

File tree

2 files changed

+25
-45
lines changed

2 files changed

+25
-45
lines changed

Dockerfile

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,29 @@
11
FROM cimg/openjdk:11.0
22

3+
USER root
4+
35
# Install dependencies to build HE libraries
4-
RUN apt update
5-
RUN apt install cmake make build-essential g++ clang autoconf javacc patchelf m4 tar lzip libfftw3-dev
6+
RUN apt-get update
7+
RUN apt-get install cmake make build-essential g++ clang autoconf javacc patchelf m4 tar lzip libfftw3-dev
68
RUN wget -c https://go.dev/dl/go1.17.6.linux-amd64.tar.gz
7-
RUN sudo tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz
9+
RUN tar -C /usr/local -xzf go1.17.6.linux-amd64.tar.gz
810
RUN export PATH=$PATH:/usr/local/go/bin
911

12+
# Copy files to docker container
13+
COPY . .
14+
1015
# Resolve all maven project dependencies
1116
RUN mvn dependency:go-offline
1217

1318
# Build T2 compiler and run tests
14-
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package
19+
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
20+
RUN mvn package
1521

1622
# Clone HE libraries
1723
RUN .circleci/clone_libs.sh
1824

1925
# Build HE libraries
2026
RUN .circleci/build_libs.sh
2127

22-
# Install HElib v2.2.2
23-
# RUN cd HElib
24-
WORKDIR HElib
25-
RUN make install
26-
RUN ln -sf /usr/local/lib/libntl.so.44 /usr/lib/libntl.so.44
27-
28-
# Install PALISADE v1.11.9
29-
WORKDIR palisade-release/build
30-
RUN make install
31-
RUN ln -sf /usr/local/lib/libPALISADEcore.so.1 /usr/lib/libPALISADEcore.so.1
32-
33-
# Install SEAL 4.1.1
34-
WORKDIR SEAL
35-
RUN cmake --install build
36-
37-
# Install TFHE 1.0.1
38-
WORKDIR tfhe
39-
RUN make install
40-
RUN ln -sf /usr/local/lib/libtfhe-nayuki-avx.so /usr/lib/libtfhe-nayuki-avx.so
41-
RUN ln -sf /usr/local/lib/libtfhe-nayuki-portable.so /usr/lib/libtfhe-nayuki-portable.so
42-
RUN ln -sf /usr/local/lib/libtfhe-spqlios-avx.so /usr/lib/libtfhe-spqlios-avx.so
43-
RUN ln -sf /usr/local/lib/libtfhe-spqlios-fma.so /usr/lib/libtfhe-spqlios-fma.so
44-
4528
# Run T2 tests
4629
RUN mvn test
47-
48-
# # Run HElib tests
49-
# RUN .circleci/test_HElib.sh
50-
51-
# # Run Lattigo tests
52-
# RUN .circleci/test_Lattigo.sh
53-
54-
# # Run SEAL tests
55-
# RUN .circleci/test_SEAL.sh
56-
57-
# # Run TFHE tests
58-
# RUN .circleci/test_TFHE.sh
59-
60-
# # Run PALISADE tests
61-
# RUN .circleci/test_PALISADE.sh

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,19 @@ You can cite these articles as follows:
9090

9191

9292
## Build and Run Instructions
93-
### Dependencies
93+
94+
### Building with Docker
95+
* Build the Docker image:
96+
```powershell
97+
docker build -t t2 .
98+
```
99+
* Run the Docker container:
100+
```powershell
101+
docker run --rm -i -t t2 bash
102+
```
103+
104+
### Building from Scratch
105+
#### Dependencies
94106
*
95107
```powershell
96108
apt install cmake make build-essential g++ clang autoconf javacc patchelf openjdk-8-jdk maven m4 tar lzip libfftw3-dev
@@ -99,7 +111,7 @@ You can cite these articles as follows:
99111
* Follow and modify [clone_libs.sh](./.circleci/clone_libs.sh) and
100112
[build_libs.sh](./.circleci/build_libs.sh) scripts to install the FHE libraries in your custom destinations.
101113

102-
### Compile the T2 compiler
114+
#### Compile the T2 compiler
103115
```powershell
104116
mvn initialize package
105117
```
@@ -109,7 +121,7 @@ To skip running the test when compiling the T2 compiler run:
109121
mvn package -Dmaven.test.skip
110122
```
111123

112-
### Compile T2 programs
124+
## Compile T2 programs
113125
To compile a T2 program type:
114126
```powershell
115127
java -jar target/terminator-compiler-1.0.jar <path_to_t2_file> [--debug] <LIB> [--w word_size]

0 commit comments

Comments
 (0)