Skip to content

Commit

Permalink
Merge pull request #60 from clearmatics/develop
Browse files Browse the repository at this point in the history
v0.1 release
  • Loading branch information
AntoineRondelet authored Aug 24, 2021
2 parents 9c469b9 + c23718c commit f37bdf3
Show file tree
Hide file tree
Showing 168 changed files with 20,453 additions and 7,974 deletions.
43 changes: 43 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
# Based on https://github.com/clearmatics/zeth/.clang-format

# .clang-format in root of repository. To run on single file:
#
# $ clang-format -style=file -i <file path>
#
# To run on whole repo:
#
# $ scripts/format

BasedOnStyle: llvm,

Standard: C++11,
IndentWidth: 4,
AccessModifierOffset: -4,
UseTab: Never,
FixNamespaceComments: "true",
IncludeBlocks: Regroup,
MaxEmptyLinesToKeep: 1,
BreakBeforeTernaryOperators: "true",
SpaceBeforeCpp11BracedList: "false",
Cpp11BracedListStyle: "true",
KeepEmptyLinesAtTheStartOfBlocks: "true",
AllowShortIfStatementsOnASingleLine: "false",
SpaceAfterTemplateKeyword: "false",
AlwaysBreakAfterReturnType: None,
PenaltyReturnTypeOnItsOwnLine: 10000000,
SpaceAfterCStyleCast: "false",
SpaceBeforeAssignmentOperators: "true",

AlignAfterOpenBracket: AlwaysBreak,
AllowAllParametersOfDeclarationOnNextLine: "true",
BinPackArguments: "false",
BinPackParameters: "false",

AlwaysBreakTemplateDeclarations: MultiLine,
BreakBeforeBraces: Linux,
BreakConstructorInitializers: BeforeComma,
BreakInheritanceList: BeforeComma,
ConstructorInitializerAllOnOneLineOrOnePerLine: "true",
# AllowAllConstructorInitializersOnNextLine: "false",
}
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Clearmatics libff library

on:
push:
pull_request:

jobs:
build-ubuntu:

runs-on: ubuntu-20.04

strategy:
matrix:
compiler: [g++]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: format-check
run: |
scripts/format
git diff --no-ext-diff > format_errs
head -n 20 format_errs
[ "0" == `cat format_errs | wc -l` ]
- name: install-dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential git libboost-all-dev cmake libgmp3-dev libssl-dev libprocps-dev pkg-config
- name: configure
env:
CXX: ${{ matrix.compiler }}
run: mkdir build && cd build && cmake ..
- name: build
run: cd build && make all profile
- name: test
run: cd build && CTEST_OUTPUT_ON_FAILURE=1 make check
35 changes: 35 additions & 0 deletions .github/workflows/dev-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: libff-ci-dev-docs

on:
push:
branches: [ develop ]

jobs:
build-documentation:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository and install submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y build-essential git libboost-all-dev cmake libgmp3-dev libssl-dev libprocps-dev pkg-config
sudo apt install -y doxygen graphviz
- name: Generate documentation
run: |
mkdir -p build
pushd build
cmake -DGEN_DOC=ON ..
make build_docs
popd
- name: GH Pages Deployment
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
publish_branch: doxy-gh-pages
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/build/
/.idea/
/.idea/
*.pyc
*.sage.py
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "depends/xbyak"]
path = depends/xbyak
url = https://github.com/herumi/xbyak.git
[submodule "depends/gtest"]
path = depends/gtest
url = git://github.com/google/googletest.git
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

Empty file modified AUTHORS
100755 → 100644
Empty file.
51 changes: 31 additions & 20 deletions CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
cmake_minimum_required(VERSION 2.8)

# Change the compiler BEFORE the first `project()` command to avoid an infinite loop.
# See: https://public.kitware.com/pipermail/cmake/2009-November/033133.html
if(APPLE)
# If custom llvm compilers are available, use them (for openmp
# support), otherwise disable multicore.
if(EXISTS "/usr/local/opt/llvm/bin/clang")
set(CMAKE_C_COMPILER "/usr/local/opt/llvm/bin/clang")
set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++")
endif()
endif()

project (libff)

# Versionning of the project
set(LIBFF_VERSION_MAJOR 0)
set(LIBFF_VERSION_MINOR 1)

# Default to RelWithDebInfo configuration if no configuration is explicitly specified.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type on single-configuration generators" FORCE)
Expand All @@ -12,7 +27,7 @@ set(
"BN128"
CACHE
STRING
"Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6, BLS12_377"
"Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6, BLS12_377, BW6_761"
)

option(
Expand All @@ -28,7 +43,7 @@ option(
option(
MULTICORE
"Enable parallelized execution, using OpenMP"
OFF
ON
)
option(
BINARY_OUTPUT
Expand Down Expand Up @@ -86,6 +101,12 @@ option(
ON
)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(APPLE)
set(WITH_PROCPS OFF)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Common compilation flags and warning configuration
set(
Expand Down Expand Up @@ -196,25 +217,14 @@ endif()
# Configure CCache if available
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)

if ("${IS_LIBFF_PARENT}")
find_program(
MARKDOWN

markdown_py
DOC "Path to markdown_py binary"
)
if(MARKDOWN-NOTFOUND)
else()
add_custom_target(
doc
${MARKDOWN} -f ${CMAKE_CURRENT_BINARY_DIR}/README.html -x toc -x extra --noisy ${CMAKE_CURRENT_SOURCE_DIR}/README.md
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Translating from markdown to HTML" VERBATIM
)
# If the option -DGEN_DOC is used, add the `docs` target
if("${GEN_DOC}")
include(cmake/documentation.cmake)
endif()

# Add a `make check` target that builds and tests
Expand All @@ -223,10 +233,11 @@ if ("${IS_LIBFF_PARENT}")
# Add a `make profile` target that builds and profiles
add_custom_target(
profile
COMMAND ${CMAKE_COMMAND}
-E echo 'Built target finished'
COMMAND ${CMAKE_COMMAND} -E echo 'Built target finished'
)

add_subdirectory(depends)
add_subdirectory(ffi)
endif()

add_subdirectory(libff)
Loading

0 comments on commit f37bdf3

Please sign in to comment.