Skip to content
This repository was archived by the owner on May 11, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: local
hooks:
- id: clang-format
name: clang-format
entry: clang-format
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx|js|proto)$
args: ["-i"]
- id: cpplint
name: cpplint
entry: cpplint
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
args:
- --filter=-runtime/references,-readability/nolint,-build/c++11
- id: yapf
name: yapf
entry: yapf
language: system
files: \.py$
args: [-i]
1 change: 0 additions & 1 deletion CONTRIB.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ merge conflicts.
syntax level). The script has an exit code of `0` when code
meets the standard and non-zero otherwise. This script does
*not* modify the source code.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The [examples](https://github.com/NervanaSystems/he-transformer/tree/master/exam
## Building HE Transformer

### Dependencies
- Operating system: Ubuntu 16.04, Ubuntu 18.04.
- Operating system: Ubuntu 18.04.
- CMake >= 3.12
- Compiler: g++ version >= 6.0, clang >= 5.0
- OpenMP is strongly suggested, though not strictly necessary. You may experience slow runtimes without OpenMP
Expand Down
61 changes: 0 additions & 61 deletions contrib/docker/Dockerfile.he_transformer.centos74

This file was deleted.

55 changes: 0 additions & 55 deletions contrib/docker/Dockerfile.he_transformer.fedora28

This file was deleted.

78 changes: 0 additions & 78 deletions contrib/docker/Dockerfile.he_transformer.ubuntu1604

This file was deleted.

8 changes: 6 additions & 2 deletions contrib/docker/Dockerfile.he_transformer.ubuntu1804
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

FROM ubuntu:18.04


RUN apt-get update && apt-get install -y \
python3-pip virtualenv \
python3-numpy python3-dev python3-wheel \
Expand All @@ -34,8 +35,11 @@ RUN apt-get update && apt-get install -y \
git \
wget patch diffutils libtinfo-dev \
autoconf libtool \
doxygen graphviz \
yapf3 python3-yapf
doxygen graphviz

# Install recent version of yapf3
RUN add-apt-repository "deb http://ubuntu.osuosl.org/ubuntu/ eoan main universe"
RUN apt-get update && apt-get install -y yapf3=0.28.0-1

# Install clang-9
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
Expand Down
15 changes: 0 additions & 15 deletions contrib/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,11 @@ endif
DBUILD_DIR = ${DIR}/contrib/docker/.build-${DBUILD_VERSION}_${OS_ID}

# Configuration for specific reference OS_ID in Dockerfiles
ifeq ("$(shell echo ${OS_ID} | grep centos)","centos74")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/he-transformer-test/contrib/docker/run_as_centOS_ID_user.sh
DOCKERFILE=Dockerfile.he_transformer.centOS_ID74
endif

ifeq ("$(shell echo ${OS_ID} | grep fedora)","fedora28")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/he-transformer-test/contrib/docker/run_as_fedora_user.sh
DOCKERFILE=Dockerfile.he_transformer.fedora28
endif

ifeq ("$(shell echo ${OS_ID} | grep ubuntu)","ubuntu1804")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/he-transformer-test/contrib/docker/run_as_ubuntu_user.sh
DOCKERFILE=Dockerfile.he_transformer.ubuntu1804
endif

ifeq ("$(shell echo ${OS_ID} | grep ubuntu)","ubuntu1604")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/he-transformer-test/contrib/docker/run_as_ubuntu_user.sh
DOCKERFILE=Dockerfile.he_transformer.ubuntu1604
endif

DOCKER_CMD_MESG=Building for CPU support only.
DOCKER_CMD=docker

Expand Down
38 changes: 2 additions & 36 deletions contrib/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,13 @@ Note that all operations performed inside the docker image are run as a regular

## Examples/Hints

* To build an Ubuntu 16.04 docker container, compile with gcc 7.4, and run unit tests:

```
cd contrib/docker
make check_gcc
```

* To build an Ubuntu 16.04 docker container, compile with clang 6.0 , and run unit tests:

```
cd contrib/docker
make check_clang
```

* To build a Ubuntu 18.04 docker container, compile with gcc 7, and run unit tests:
* To build a Ubuntu 18.04 docker container, compile with gcc 7.4, and run unit tests:

```
cd contrib/docker
make check_gcc OS=ubuntu1804
```

* To build an Ubuntu 16.04 docker container with persistent builds, compile with gcc 7.4, and run unit tests:

```
cd contrib/docker
make build_gcc RM_CONTAINER=false
```

To launch the shell with the persistent docker image, run
```bash
make shell
Expand Down Expand Up @@ -100,11 +79,7 @@ A helper script to run as a normal user within the docker container. This is do

#### `run_as_ubuntu_user.sh`

Same as `run_as_user.sh`, specifically called for _make_ targets with Ubuntu 16.04 docker containers.

#### `run_as_centos_user.sh`

A helper script to run as a normal user within a CentOS 7.4 docker container.
Same as `run_as_user.sh`, specifically called for _make_ targets with Ubuntu 18.04 docker containers.

## Notes

Expand All @@ -114,15 +89,6 @@ A helper script to run as a normal user within a CentOS 7.4 docker container.

* The _make_ targets have been tested with the following docker containers on an Ubuntu 16.04 host OS with docker installed and the docker daemon properly configured. Some adjustments may be needed to run these on other OSes.

#### Ubuntu 16.04 (default)

```
Dockerfile: Dockerfile.he-transformer.ubuntu1604
Reference-OS: Ubuntu 16.04
BUILD-GCC: gcc 7.4.0
BUILD-CLANG: clang 6.0.1
```

#### Ubuntu 18.04

```
Expand Down
14 changes: 2 additions & 12 deletions contrib/docker/build-he-transformer-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o pipefail
# Enable job control to allow scl enable command
set -m

# Debugging to verify builds on Centos 7.4 and Ubuntu 16.04
# Debugging to verify build OS
if [ -f "/etc/centos-release" ]; then
cat /etc/centos-release
fi
Expand Down Expand Up @@ -73,17 +73,7 @@ cd $HE_TRANSFORMER_REPO

export CMAKE_OPTIONS_COMMON="-DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS_EXTRA}"
export CMAKE_OPTIONS_GCC="${CMAKE_OPTIONS_COMMON}"
# Centos 7.4 doesn't have clang6.0 yet
# https://www.centos.org/forums/viewtopic.php?t=70149
if [ "${OS_ID}" == "centos74" ]; then
#
set +e
source scl_source enable devtoolset-7 llvm-toolset-7
set -e
export CMAKE_OPTIONS_CLANG="$CMAKE_OPTIONS_COMMON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -Werror"
else
export CMAKE_OPTIONS_CLANG="$CMAKE_OPTIONS_COMMON -DCMAKE_CXX_COMPILER=clang++-6.0 -DCMAKE_C_COMPILER=clang-6.0 -Werror"
fi
export CMAKE_OPTIONS_CLANG="$CMAKE_OPTIONS_COMMON -DCMAKE_CXX_COMPILER=clang++-6.0 -DCMAKE_C_COMPILER=clang-6.0 -Werror"

echo "CMD_TO_RUN=${CMD_TO_RUN}"

Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/make_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ -z $DOCKER_IMAGE_NAME ]; then
DOCKER_IMAGE_NAME=${DOCKER_TAG}
fi

# Debugging to verify builds on CentOS 7.4 and Ubuntu 16.04
# Debugging to verify build OS
if [ -f "/etc/centos-release" ]; then
cat /etc/centos-release
fi
Expand Down
Loading