diff --git a/.appveyor.yml b/.appveyor.yml
index d27694e6c4..02efff8357 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -20,9 +20,10 @@
branches:
only:
- master
+ # - /^v\d+\.\d+\.\d+$/
- dev
- - /^v\d+\.\d+\.\d+$/
- /^release-\d+\.\d+\.\d+$/
+ - /^hotfix-\d+\.\d+\.\d+$/
- /^feature-ci-.+$/
- /^feature_ci_.+$/
- /^feature-appveyor-.+$/
@@ -35,92 +36,60 @@ environment:
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"
- matrix:
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- CONAN_VISUAL_VERSIONS: 15
- VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
+# init:
+# - ps: Write-Host "common init script"
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- CONAN_VISUAL_VERSIONS: 14
+# - ps: |
+# if ($Env:APPVEYOR_REPO_BRANCH -ceq "master" -And [string]::IsNullOrEmpty($Env:APPVEYOR_REPO_TAG_NAME)) {
+# Write-Host "branch is master without tags, exiting"
+# Exit-AppveyorBuild
+# }
- # - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- # CONAN_VISUAL_VERSIONS: 12
-
- # - MINGW_CONFIGURATIONS: "7@x86_64@seh@posix, 6@x86_64@seh@posix, 5@x86_64@seh@posix, 4.9@x86_64@seh@posix"
-
- - MINGW_CONFIGURATIONS: "8@x86_64@seh@posix"
- - MINGW_CONFIGURATIONS: "7@x86_64@seh@posix"
- - MINGW_CONFIGURATIONS: "6@x86_64@seh@posix"
- - MINGW_CONFIGURATIONS: "5@x86_64@seh@posix"
- # - MINGW_CONFIGURATIONS: "4.9@x86_64@seh@posix"
-
-
-init:
- # - echo "*******************************************************"
- # - echo %APPVEYOR_REPO_TAG%
- # - echo %APPVEYOR_REPO_BRANCH%
- # - echo %APPVEYOR_REPO_TAG_NAME%
- # - echo %APPVEYOR_REPO_COMMIT_MESSAGE%
- # - echo "*******************************************************"
-
- - ps: |
- if ($Env:APPVEYOR_REPO_BRANCH -ceq "master" -And [string]::IsNullOrEmpty($Env:APPVEYOR_REPO_TAG_NAME)) {
- Write-Host "branch is master without tags, exiting"
- Exit-AppveyorBuild
- }
-
- # Note(fernando): It is implemented natively in Appveyor...
- # if ($Env:APPVEYOR_REPO_COMMIT_MESSAGE -like "*\[skip appveyor\]*") {
- # Write-Host "[skip appveyor] detected in commit message, exiting"
- # Exit-AppveyorBuild
- # }
+# Note(fernando): It is implemented natively in Appveyor...
+# if ($Env:APPVEYOR_REPO_COMMIT_MESSAGE -like "*\[skip appveyor\]*") {
+# Write-Host "[skip appveyor] detected in commit message, exiting"
+# Exit-AppveyorBuild
+# }
install:
- # - echo "*******************************************************"
- # - echo %APPVEYOR_REPO_TAG%
- # - echo %APPVEYOR_REPO_BRANCH%
- # - echo %APPVEYOR_REPO_TAG_NAME%
- # - echo %APPVEYOR_REPO_COMMIT_MESSAGE%
- # - echo "*******************************************************"
-
- set PATH=%PATH%;%PYTHON%/Scripts/
-
- pip.exe install conan --upgrade
# - pip.exe install conan==1.0.0b5 #Fixed Beta version...
-
- pip.exe install conan_package_tools
- pip.exe install cpuid --upgrade
-
- conan user # It creates the conan data directory
test_script:
-
- git submodule init
# - git submodule update --remote
- git submodule update
- # - dir *.*
# - git fetch --unshallow
- # - export BITPRIM_BUILD_NUMBER="$(git describe)"
- - for /f %%i in ('git describe') do set BITPRIM_BUILD_NUMBER=%%i
- - echo %BITPRIM_BUILD_NUMBER%
-
- # - echo %APPVEYOR_REPO_BRANCH%
- # - dir *.*
- # - cd
-
+ # - for /f %%i in ('git describe') do set BITPRIM_BUILD_NUMBER=%%i
+ # - echo %BITPRIM_BUILD_NUMBER%
+
- ps: |
+ $Env:BITPRIM_BRANCH = $Env:APPVEYOR_REPO_BRANCH
+
if ($Env:APPVEYOR_REPO_BRANCH -ceq "dev") {
$Env:BITPRIM_CONAN_CHANNEL = "testing"
+ $Env:BITPRIM_FULL_BUILD = 0
}
elseif ($Env:APPVEYOR_REPO_BRANCH.StartsWith("release")) {
$Env:BITPRIM_CONAN_CHANNEL = "stable"
+ $Env:BITPRIM_FULL_BUILD = 1
+ }
+ elseif ($Env:APPVEYOR_REPO_BRANCH.StartsWith("hotfix")) {
+ $Env:BITPRIM_CONAN_CHANNEL = "stable"
+ $Env:BITPRIM_FULL_BUILD = 1
}
elseif ($Env:APPVEYOR_REPO_BRANCH.StartsWith("feature")) {
$Env:BITPRIM_CONAN_CHANNEL = $Env:APPVEYOR_REPO_BRANCH
+ $Env:BITPRIM_FULL_BUILD = 0
}
else {
$Env:BITPRIM_CONAN_CHANNEL = "stable"
+ $Env:BITPRIM_FULL_BUILD = 1
}
# if ([System.IO.File]::Exists("conan_channel")) {
@@ -131,4 +100,90 @@ test_script:
# - dir *.*
# - echo %BITPRIM_CONAN_CHANNEL%
+ - python ci_utils/print_version.py
+
+ - for /f %%i in ('python ci_utils/print_version.py') do set BITPRIM_BUILD_NUMBER=%%i
+ - set BITPRIM_CONAN_VERSION=%BITPRIM_BUILD_NUMBER%
+ - echo %BITPRIM_BUILD_NUMBER%
+ - echo %BITPRIM_CONAN_VERSION%
+
+ - ps: |
+ if ([System.IO.File]::Exists("conan_version")) {
+ Write-Host "Creating conan_version file"
+ $Env:BITPRIM_BUILD_NUMBER | Out-File conan_version
+ }
+
+
- python build.py
+
+
+for:
+ -
+ environment:
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ CONAN_VISUAL_VERSIONS: 15
+ VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
+ -
+ branches:
+ only:
+ - /^(release|hotfix).+$/
+ environment:
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ CONAN_VISUAL_VERSIONS: 14
+ -
+ branches:
+ only:
+ - /^(release|hotfix).+$/
+ environment:
+ MINGW_CONFIGURATIONS: "8@x86_64@seh@posix"
+ -
+ branches:
+ only:
+ - /^(release|hotfix).+$/
+ environment:
+ MINGW_CONFIGURATIONS: "7@x86_64@seh@posix"
+ -
+ branches:
+ only:
+ - /^(release|hotfix).+$/
+ environment:
+ MINGW_CONFIGURATIONS: "6@x86_64@seh@posix"
+ -
+ branches:
+ only:
+ - /^(release|hotfix).+$/
+ environment:
+ MINGW_CONFIGURATIONS: "5@x86_64@seh@posix"
+ -
+ branches:
+ only:
+ - master
+ test_script:
+ - echo "Stable packages are published in Release branches"
+ install:
+ - echo "Stable packages are published in Release branches"
+
+
+# MINGW_CONFIGURATIONS: "4.9@x86_64@seh@posix"
+
+# matrix:
+# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+# CONAN_VISUAL_VERSIONS: 15
+# VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
+
+# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+# CONAN_VISUAL_VERSIONS: 14
+
+# - MINGW_CONFIGURATIONS: "8@x86_64@seh@posix"
+# - MINGW_CONFIGURATIONS: "7@x86_64@seh@posix"
+# - MINGW_CONFIGURATIONS: "6@x86_64@seh@posix"
+# - MINGW_CONFIGURATIONS: "5@x86_64@seh@posix"
+# # - MINGW_CONFIGURATIONS: "4.9@x86_64@seh@posix"
+
+# # - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+# # CONAN_VISUAL_VERSIONS: 12
+# # - MINGW_CONFIGURATIONS: "7@x86_64@seh@posix, 6@x86_64@seh@posix, 5@x86_64@seh@posix, 4.9@x86_64@seh@posix"
+
+# matrix:
+# fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
+
diff --git a/.travis.yml b/.travis.yml
index 12e8e02a27..e87d1e5779 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@
branches:
only:
- # - master
+ - master
# - /^v\d+\.\d+\.\d+$/
- dev
- /^release-\d+\.\d+\.\d+$/
@@ -58,18 +58,10 @@ install:
fi
script:
- # - python ci_utils/print_version.py
- export BITPRIM_BRANCH="${TRAVIS_BRANCH}"
- git fetch --unshallow
- # - export BITPRIM_BUILD_NUMBER="$(git describe)"
- # - export BITPRIM_BUILD_NUMBER="$(python ci_utils/print_version.py)"
- # - export BITPRIM_CONAN_VERSION="${BITPRIM_BUILD_NUMBER}"
- # - echo "${BITPRIM_BUILD_NUMBER}"
- # - echo "${BITPRIM_CONAN_VERSION}"
-
- |
- echo "${TRAVIS_BRANCH}"
if [[ "${TRAVIS_BRANCH}" = "dev" ]]; then
export BITPRIM_CONAN_CHANNEL="testing"
export BITPRIM_FULL_BUILD=0
@@ -86,8 +78,6 @@ script:
export BITPRIM_CONAN_CHANNEL="stable"
export BITPRIM_FULL_BUILD=1
fi
- # echo "${BITPRIM_CONAN_CHANNEL}"
- # echo "${BITPRIM_FULL_BUILD}"
# if [ ! -f conan_version ]; then
# echo "Creating conan_version file"
@@ -101,6 +91,7 @@ script:
./.travis/push_other_repo.sh
else
cd ${TRAVIS_BUILD_DIR}
+ ls -ltra ci_utils
chmod +x ci_utils/.travis/run.sh
./ci_utils/.travis/run.sh
fi
@@ -114,25 +105,19 @@ jobs:
# script:
# - chmod +x .travis/push_other_repo.sh
# - ./.travis/push_other_repo.sh
-
script: echo "Running checks (1)"
- # script:
- # - export BITPRIM_BRANCH="${TRAVIS_BRANCH}"
- # - git fetch --unshallow
- # # - export BITPRIM_BUILD_NUMBER="$(git describe)"
- # - export BITPRIM_BUILD_NUMBER="$(python ci_utils/print_version.py)"
- # - echo "${BITPRIM_BUILD_NUMBER}"
-
-# Unit Tests ------------------------------------------------------
- - stage: unit tests
+
+# Unit Tests and upload binaries -------------------------------
+ - stage: unit tests and upload binaries
os: linux
sudo: required
language: python
python: "3.6"
services:
- docker
- env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7 CONAN_UPLOAD=""
+ env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
BITPRIM_RUN_TESTS=true
+ # CONAN_UPLOAD=""
# Builds ------------------------------------------------------
# Linux, GCC, libstdc++ ------------------------------------------------------
@@ -146,14 +131,14 @@ jobs:
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8
if: branch =~ /^(release|hotfix).+$/
- - stage: build and upload binaries
- os: linux
- sudo: required
- language: python
- python: "3.6"
- services:
- - docker
- env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
+ # - stage: build and upload binaries
+ # os: linux
+ # sudo: required
+ # language: python
+ # python: "3.6"
+ # services:
+ # - docker
+ # env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
- stage: build and upload binaries
os: linux
@@ -231,7 +216,16 @@ jobs:
os: osx
language: generic
osx_image: xcode9
- env: CONAN_APPLE_CLANG_VERSIONS=9.0 BITPRIM_RUN_TESTS=true
+ env: CONAN_APPLE_CLANG_VERSIONS=9.0
+ BITPRIM_RUN_TESTS=true
+ if: branch =~ /^(release|hotfix).+$/
+
+ - stage: build and upload binaries
+ os: osx
+ language: generic
+ osx_image: xcode9
+ env: CONAN_APPLE_CLANG_VERSIONS=9.0
+ if: branch =~ /^(feature|dev).*$/
- stage: build and upload binaries
os: osx
@@ -247,14 +241,57 @@ jobs:
env: CONAN_APPLE_CLANG_VERSIONS=7.3
if: branch =~ /^(release|hotfix).+$/
+# Upload Aliases -----------------------------------------------------
+ - stage: upload aliases
+ os: linux
+ sudo: required
+ language: python
+ python: "3.6"
+ # install: skip
+ script:
+ - |
+ cd ${TRAVIS_BUILD_DIR}
+ export BITPRIM_BRANCH="${TRAVIS_BRANCH}"
+ git fetch --unshallow
+
+ if [[ "${TRAVIS_BRANCH}" = "dev" ]]; then
+ export BITPRIM_CONAN_CHANNEL="testing"
+ elif [[ "${TRAVIS_BRANCH}" = "release"* ]]; then
+ export BITPRIM_CONAN_CHANNEL="stable"
+ elif [[ "${TRAVIS_BRANCH}" = "hotfix"* ]]; then
+ export BITPRIM_CONAN_CHANNEL="stable"
+ elif [[ "${TRAVIS_BRANCH}" = "feature"* ]]; then
+ export BITPRIM_CONAN_CHANNEL="${TRAVIS_BRANCH}"
+ else
+ export BITPRIM_CONAN_CHANNEL="stable"
+ fi
+ export BITPRIM_CONAN_VERSION="$(python ci_utils/print_version.py)"
+
+ - echo $BITPRIM_CONAN_VERSION
+ - echo $BITPRIM_CONAN_CHANNEL
+
+ - conan remote add bitprim_temp https://api.bintray.com/conan/bitprim/bitprim
+ - conan user
+ - conan user ${CONAN_LOGIN_USERNAME} -r bitprim_temp -p ${CONAN_PASSWORD}
+ - conan user
+ - conan alias "secp256k1/0.X@bitprim/${BITPRIM_CONAN_CHANNEL}" "secp256k1/${BITPRIM_CONAN_VERSION}@bitprim/${BITPRIM_CONAN_CHANNEL}"
+ - conan upload "secp256k1/0.X@bitprim/${BITPRIM_CONAN_CHANNEL}" --all -r bitprim_temp
# Push to repos ------------------------------------------------------
- stage: push to repos
install: skip
- # script: echo "Running push to repos"
script:
- chmod +x .travis/push_other_repo.sh
- ./.travis/push_other_repo.sh
+ if: branch =~ /^(dev|feature).+$/
+
+# Dummy for master ------------------------------------------------------
+ - stage: build and upload binaries
+ install:
+ - echo "Stable packages are published in Release branches"
+ script:
+ - echo "Stable packages are published in Release branches"
+ if: branch =~ /^master$/
# # Integration Tests ------------------------------------------------------
@@ -276,7 +313,6 @@ jobs:
# install: skip
# script: 'curl http://sf-stages-production.herokuapp.com'
-
notifications:
email: false
webhooks:
diff --git a/.travis/push_other_repo.sh b/.travis/push_other_repo.sh
index 939cd03e07..2775bd73cd 100644
--- a/.travis/push_other_repo.sh
+++ b/.travis/push_other_repo.sh
@@ -31,21 +31,17 @@ body="{
\"branch\": \"${BITPRIM_PUSH_BRANCH}\"
}"
-curl -s -d "$body" -X POST -H "Authorization: Bearer ${APPVEYOR_TOKEN}" -H "Content-Type: application/json" https://ci.appveyor.com/api/builds
+curl -s -d "$body" -X POST \
+ -H "Authorization: Bearer ${APPVEYOR_TOKEN}" \
+ -H "Content-Type: application/json" \
+ https://ci.appveyor.com/api/builds
body="{
\"request\": {
- \"branch\":\"${BITPRIM_PUSH_BRANCH}\"
+ \"branch\":\"${BITPRIM_PUSH_BRANCH}\",
+ \"message\": \"Force by secp256k1 build: ${TRAVIS_BUILD_NUMBER}\"
}}"
-# curl -s -X POST \
-# -H "Content-Type: application/json" \
-# -H "Accept: application/json" \
-# -H "Travis-API-Version: 3" \
-# -H "Authorization: token ${TRAVIS_TOKEN}" \
-# -d "$body" \
-# https://api.travis-ci.org/repo/bitprim%2Fbitprim-core/requests
-
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8580ef43e..1a949fc02f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2017-2018 Bitprim developers (see AUTHORS)
+# Copyright (c) 2017-2018 Bitprim Inc.
#
# This file is part of Bitprim.
#
@@ -17,14 +17,14 @@
# along with this program. If not, see .
#
-
cmake_minimum_required(VERSION 3.4)
# secp256k1
#==============================================================================
project(secp256k1
- VERSION 0.4.0
+ VERSION 0
LANGUAGES C)
+ # VERSION 0.4.0
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -73,6 +73,8 @@ set(WITH_BIGNUM "auto" CACHE STRING "Specify Bignum Implementation (gmp|mpir|no|
set(BITPRIM_BUILD_NUMBER "-" CACHE STRING "Specify the Bitprim Build Number.")
# message(${BITPRIM_BUILD_NUMBER})
+set(BITPRIM_PROJECT_VERSION "-" CACHE STRING "Specify the Bitprim Project Version.")
+# message(${BITPRIM_PROJECT_VERSION})
set(MICROARCHITECTURE "x86_64" CACHE STRING "Specify the Cryptocurrency (x86_64|...).")
@@ -80,18 +82,6 @@ message( STATUS "Bitprim: Compiling for ${MICROARCHITECTURE}")
# add_definitions(-DBITPRIM_MICROARCHITECTURE=${MICROARCHITECTURE})
# add_definitions(-DBITPRIM_MICROARCHITECTURE_STR="${MICROARCHITECTURE}")
-
-
-# if (NOT NO_CONAN_AT_ALL)
-# if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-# include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-# conan_basic_setup()
-# else()
-# message(WARNING "The file conanbuildinfo.cmake doesn't exist, you have to run conan install first")
-# endif()
-# endif()
-
-
if(EXISTS ${CMAKE_SOURCE_DIR}/ci_utils/cmake/bitprimbuildinfo.cmake)
include(${CMAKE_SOURCE_DIR}/ci_utils/cmake/bitprimbuildinfo.cmake)
else()
@@ -288,6 +278,8 @@ elseif (${WITH_BIGNUM} STREQUAL "no")
target_compile_definitions(secp256k1 PUBLIC -DUSE_SCALAR_INV_BUILTIN=1)
endif()
+target_compile_definitions(secp256k1 PUBLIC -DBITPRIM_BUILD_NUMBER="\\"${BITPRIM_BUILD_NUMBER}\\"") #TODO(fernando): manage with Conan????
+target_compile_definitions(secp256k1 PUBLIC -DBITPRIM_PROJECT_VERSION="\\"${BITPRIM_PROJECT_VERSION}\\"") #TODO(fernando): manage with Conan????
# message(CONAN_LIBS)
# message(${CONAN_LIBS})
diff --git a/README.md b/README.md
index 332ed8b30c..ac7189d1b8 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,8 @@
-libsecp256k1 ![Gitter Chat][badge.Gitter]
-============
-Optimized C library for EC operations on curve secp256k1.
-This library is a work in progress and is being used to research best practices. Use at your own risk.
+# secp256k1 ![Version][badge.version] ![Travis status][badge.Travis] ![Appveyor Status][badge.Appveyor] ![Gitter Chat][badge.Gitter]
-| **master(linux/osx)** | **dev(linux/osx)** | **master(windows)** | **dev(windows)** |
-|:------:|:-:|:-:|:-:|
-| [](https://travis-ci.org/bitprim/secp256k1) | [](https://travis-ci.org/bitprim/secp256k1?branch=dev) | [](https://ci.appveyor.com/project/bitprim/secp256k1) | [](https://ci.appveyor.com/project/bitprim/secp256k1?branch=dev) |
+> Optimized C library for EC operations on curve secp256k1.
+This library is a work in progress and is being used to research best practices. Use at your own risk.
Features:
* secp256k1 ECDSA signing/verification and key generation.
@@ -61,4 +57,9 @@ $ cmake .. -DENABLE_MODULE_RECOVERY=ON
$ make -j2
$ sudo make install
```
+
+
+[badge.Appveyor]: https://ci.appveyor.com/api/projects/status/github/bitprim/secp256k1?svg=true&branch=master
[badge.Gitter]: https://img.shields.io/badge/gitter-join%20chat-blue.svg
+[badge.Travis]: https://travis-ci.org/bitprim/secp256k1.svg?branch=master
+[badge.version]: https://badge.fury.io/gh/bitprim%2Fsecp256k1.svg
diff --git a/_conan_channel b/_conan_channel
deleted file mode 100644
index 9a2c7732fa..0000000000
--- a/_conan_channel
+++ /dev/null
@@ -1 +0,0 @@
-testing
\ No newline at end of file
diff --git a/_conan_version b/_conan_version
deleted file mode 100644
index 60a2d3e96c..0000000000
--- a/_conan_version
+++ /dev/null
@@ -1 +0,0 @@
-0.4.0
\ No newline at end of file
diff --git a/build.py b/build.py
index f9c3732d3b..6464387c3f 100644
--- a/build.py
+++ b/build.py
@@ -1,16 +1,12 @@
-# >> sudo -E docker run -e CONAN_GCC_VERSIONS="7" -e CONAN_DOCKER_IMAGE="lasote/conangcc7" -e CONAN_LOGIN_USERNAME="[secure]" -e CONAN_PASSWORD="[secure]" -e CONAN_CHANNEL="feature_ci_test_travis_stages" -e CONAN_REMOTES="https://api.bintray.com/conan/bitprim/bitprim@True@remote0" -e CONAN_REFERENCE="secp256k1/0.4.0@bitprim/feature_ci_test_travis_stages" -e CPT_PROFILE="@@include(default)@@@@[settings]@@arch=x86_64@@build_type=Release@@compiler=gcc@@compiler.version=7@@[options]@@secp256k1:shared=False@@secp256k1:with_tests=True@@secp256k1:microarchitecture=x86_64@@[env]@@BITPRIM_BUILD_NUMBER=------------------------------------------------------@@None@@None@@None@@describe@@v0.3.0-112-g54f9eda@@0.4.0@@------------------------------------------------------@@0.4.0@@BITPRIM_BRANCH=feature_ci_test_travis_stages@@BITPRIM_CONAN_CHANNEL=feature_ci_test_travis_stages@@BITPRIM_FULL_BUILD=0@@[build_requires]@@@@" -e CONAN_USERNAME="bitprim" -e CONAN_TEMP_TEST_FOLDER="1" -e PIP_DISABLE_PIP_VERSION_CHECK="1" --name conan_runner lasote/conangcc7 /bin/sh -c "sudo -E pip install conan_package_tools==0.18.2 --upgrade --no-cache && sudo -E pip install conan==1.5.0 --no-cache"
-
-
-# BITPRIM_BUILD_NUMBER=------------------------------------------------------@@None@@None@@None@@describe@@v0.3.0-112-g54f9eda@@0.4.0@@------------------------------------------------------@@0.4.0@@BITPRIM_BRANCH=feature_ci_test_travis_stages@@BITPRIM_CONAN_CHANNEL=feature_ci_test_travis_stages@@BITPRIM_FULL_BUILD=0@@[build_requires]@@@@" -e CONAN_USERNAME="bitprim" -e CONAN_TEMP_TEST_FOLDER="1" -e PIP_DISABLE_PIP_VERSION_CHECK="1" --name conan_runner lasote/conangcc7 /bin/sh -c "sudo -E pip install conan_package_tools==0.18.2 --upgrade --no-cache && sudo -E pip install conan==1.5.0 --no-cache"
-
import os
import cpuid
-from ci_utils.utils import get_builder, handle_microarchs, copy_env_vars
+import platform
+from ci_utils import get_builder, handle_microarchs, copy_env_vars, filter_valid_exts
if __name__ == "__main__":
- # full_build_str = os.getenv('BITPRIM_FULL_BUILD', '0')
full_build = os.getenv('BITPRIM_FULL_BUILD', '0') == '1'
+ # full_build = True
builder, name = get_builder()
builder.add_common_builds(shared_option_name="%s:shared" % name, pure_c=True)
@@ -27,12 +23,17 @@
# options["%s:with_benchmark" % name] = "True"
options["%s:with_tests" % name] = "True"
# options["%s:with_openssl_tests" % name] = "True"
- marchs = ["x86_64"]
+ marchs = ["x86-64"]
else:
if full_build:
- marchs = ["x86_64", ''.join(cpuid.cpu_microarchitecture()), "haswell", "skylake", "skylake-avx512"]
+ # marchs = ["x86-64", ''.join(cpuid.cpu_microarchitecture()), "haswell", "skylake", "skylake-avx512"]
+ # marchs = [''.join(cpuid.cpu_microarchitecture()), 'znver1', 'silvermont', 'westmere', 'goldmont', 'btver1', 'icelake-client', 'btver2', 'skylake', 'nano', 'haswell', 'nano-1000', 'broadwell', 'bdver1', 'bdver3', 'bdver2', 'bdver4', 'core2', 'k8', 'amdfam10', 'icelake-server', 'bonnell', 'cannonlake', 'k8-sse3', 'goldmont-plus', 'nano-x4', 'nehalem', 'ivybridge', 'eden-x4', 'x86-64', 'nano-3000', 'knl', 'knm', 'penryn', 'eden-x2', 'sandybridge', 'nano-2000', 'tremont', 'skylake-avx512', 'nano-x2']
+ # marchs = marchs_compiler_list(str(platform.system()), str(settings["compiler"]), float(str(settings["compiler.version"])))
+ # marchs.append(''.join(cpuid.cpu_microarchitecture()))
+
+ marchs = filter_valid_exts(str(platform.system()), str(settings["compiler"]), float(str(settings["compiler.version"])), [''.join(cpuid.cpu_microarchitecture()), 'x86-64', 'sandybridge', 'ivybridge', 'haswell', 'skylake', 'skylake-avx512'])
else:
- marchs = ["x86_64"]
+ marchs = ["x86-64"]
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, options, env_vars, build_requires)
# filtered_builds.append([settings, options, env_vars, build_requires])
diff --git a/ci_utils b/ci_utils
index ee229f3f5c..7085c8ac87 160000
--- a/ci_utils
+++ b/ci_utils
@@ -1 +1 @@
-Subproject commit ee229f3f5c678152963fba8ea613232c607b3f4a
+Subproject commit 7085c8ac87fb4d174b6de9ac2901836c422d8e1b
diff --git a/conanfile.py b/conanfile.py
index 1a28b1891b..1e95675e19 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -18,18 +18,16 @@
#
import os
+# import sys
from conans import ConanFile, CMake
from conans import __version__ as conan_version
from conans.model.version import Version
-from ci_utils.utils import option_on_off, get_version, get_conan_req_version, get_cpu_microarchitecture, get_cpuid
+from ci_utils import option_on_off, get_version, get_conan_req_version, march_conan_manip, pass_march_to_compiler
class Secp256k1Conan(ConanFile):
name = "secp256k1"
version = get_version()
- # version = "0.4.0"
- # myversion = get_version()
-
license = "http://www.boost.org/users/license.html"
url = "https://github.com/bitprim/secp256k1"
description = "Optimized C library for EC operations on curve secp256k1"
@@ -53,6 +51,7 @@ class Secp256k1Conan(ConanFile):
"with_openssl_tests": [True, False],
"with_bignum_lib": [True, False],
"microarchitecture": "ANY", #["x86_64", "haswell", "ivybridge", "sandybridge", "bulldozer", ...]
+ "fix_march": [True, False],
"verbose": [True, False],
@@ -81,6 +80,7 @@ class Secp256k1Conan(ConanFile):
"with_openssl_tests=False", \
"with_bignum_lib=True", \
"microarchitecture=_DUMMY_", \
+ "fix_march=False", \
"verbose=True"
# "with_bignum=conan"
@@ -100,106 +100,6 @@ class Secp256k1Conan(ConanFile):
# with_tests = True
# with_openssl_tests = False
-
- # https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
- # echo "" | gcc -fsyntax-only -march=pepe -xc -
- # nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
- # marchs = ["x86_64", "nehalem", "sandybridge", "haswell", "skylake", "skylake-avx512"]
-
- # x86-64
- # A generic CPU with 64-bit extensions.
-
- # core2
- # Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3
-
- # nehalem
- # Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT
-
- # westmere
- # Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL
-
- # sandybridge
- # Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL
-
- # ivybridge
- # Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND, F16C
-
- # haswell
- # Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C
-
- # broadwell
- # Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW
-
- # skylake
- # Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES
-
- # bonnell
- # Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3
-
- # silvermont
- # Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PCLMUL, RDRND
-
- # knl
- # Intel Knights Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD
-
- # knm
- # Intel Knights Mill CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER, AVX512CD, AVX5124VNNIW, AVX5124FMAPS, AVX512VPOPCNTDQ
-
- # skylake-avx512
- # Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB, AVX512VL, AVX512BW, AVX512DQ, AVX512CD
-
- # cannonlake
- # Intel Cannonlake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, UMIP
-
- # icelake-client
- # zIntel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES
-
- # icelake-server
- # Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG, WBNOINVD
-
-
- # -----------------------------------
-
-
- # k8
- # opteron
- # athlon64
- # athlon-fx
- # Processors based on the AMD K8 core with x86-64 instruction set support, including the AMD Opteron, Athlon 64, and Athlon 64 FX processors. (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow! and 64-bit instruction set extensions.)
-
- # k8-sse3
- # opteron-sse3
- # athlon64-sse3
- # Improved versions of AMD K8 cores with SSE3 instruction set support.
-
- # amdfam10
- # barcelona
- # CPUs based on AMD Family 10h cores with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit instruction set extensions.)
-
- # bdver1
- # CPUs based on AMD Family 15h cores with x86-64 instruction set support. (This supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
-
- # bdver2
- # AMD Family 15h core based CPUs with x86-64 instruction set support. (This supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
-
- # bdver3
- # AMD Family 15h core based CPUs with x86-64 instruction set support. (This supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.
-
- # bdver4
- # AMD Family 15h core based CPUs with x86-64 instruction set support. (This supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.
-
- # znver1
- # AMD Family 17h core based CPUs with x86-64 instruction set support. (This supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit instruction set extensions.
-
- # btver1
- # CPUs based on AMD Family 14h cores with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit instruction set extensions.)
-
- # btver2
- # CPUs based on AMD Family 16h cores with x86-64 instruction set support. This includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM, SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
-
-
-
-
@property
def msvc_mt_build(self):
return "MT" in str(self.settings.compiler.runtime)
@@ -233,16 +133,6 @@ def bignum_lib_name(self):
def requirements(self):
- # self.output.info("********************* BITPRIM_BUILD_NUMBER: %s" % (os.getenv('BITPRIM_BUILD_NUMBER', '-'),))
- # self.output.info("********************* BITPRIM_BRANCH : %s" % (os.getenv('BITPRIM_BRANCH', '-'),))
- # self.output.info("********************* BITPRIM_CONAN_CHANNEL: %s" % (os.getenv('BITPRIM_CONAN_CHANNEL', '-'),))
- # self.output.info("********************* BITPRIM_FULL_BUILD: %s" % (os.getenv('BITPRIM_FULL_BUILD', '-'),))
- # self.output.info("********************* BITPRIM_CONAN_VERSION: %s" % (os.getenv('BITPRIM_CONAN_VERSION', '-'),))
- # self.output.info("********************* get_version(): %s" % (get_version(),))
- # self.output.info("********************* self.channel: %s" % (self.channel,))
-
- # self.requires("Say/0.1@%s/%s" % (self.user, self.channel))
-
if self.options.with_bignum_lib:
if self.settings.os == "Windows":
self.requires("mpir/3.0.0@bitprim/stable")
@@ -250,6 +140,11 @@ def requirements(self):
self.requires("gmp/6.1.2@bitprim/stable")
def config_options(self):
+ if self.settings.arch != "x86_64":
+ self.output.info("microarchitecture is disabled for architectures other than x86_64, your architecture: %s" % (self.settings.arch,))
+ self.options.remove("microarchitecture")
+ self.options.remove("fix_march")
+
if self.settings.compiler == "Visual Studio":
self.options.remove("fPIC")
if self.options.shared and self.msvc_mt_build:
@@ -258,61 +153,21 @@ def config_options(self):
def configure(self):
del self.settings.compiler.libcxx #Pure-C Library
- if self.options.microarchitecture == "_DUMMY_":
- self.options.microarchitecture = get_cpu_microarchitecture()
- if get_cpuid() == None:
- march_from = 'default'
- else:
- march_from = 'taken from cpuid'
- else:
- march_from = 'user defined'
-
- # Temporary fix for GCC march.
- # TODO(fernando): Do it better!
-
- # self.output.info("********* CLANG Version: %s" % (str(self.settings.compiler.version)))
- # if self.settings.compiler == "clang":
- # self.output.info("********* CLANG Version: %s" % (str(self.settings.compiler.version)))
- # if self.settings.compiler == "apple-clang":
- # self.output.info("********* APPLE-CLANG Version: %s" % (str(self.settings.compiler.version)))
-
- # MinGW
- if self.options.microarchitecture == 'skylake-avx512' and self.settings.os == "Windows" and self.settings.compiler == "gcc":
- self.output.info("'skylake-avx512' microarchitecture is not supported by this compiler, fall back to 'skylake'")
- self.options.microarchitecture = 'skylake'
-
- # if self.options.microarchitecture == 'skylake' and self.settings.os == "Windows" and self.settings.compiler == "gcc":
- # self.output.info("'skylake' microarchitecture is not supported by this compiler, fall back to 'haswell'")
- # self.options.microarchitecture = 'haswell'
-
- if self.options.microarchitecture == 'skylake-avx512' and self.settings.compiler == "apple-clang" and float(str(self.settings.compiler.version)) < 8:
- self.output.info("'skylake-avx512' microarchitecture is not supported by this compiler, fall back to 'skylake'")
- self.options.microarchitecture = 'skylake'
-
- if self.options.microarchitecture == 'skylake' and self.settings.compiler == "apple-clang" and float(str(self.settings.compiler.version)) < 8:
- self.output.info("'skylake' microarchitecture is not supported by this compiler, fall back to 'haswell'")
- self.options.microarchitecture = 'haswell'
-
- if self.options.microarchitecture == 'skylake-avx512' and self.settings.compiler == "gcc" and float(str(self.settings.compiler.version)) < 6:
- self.output.info("'skylake-avx512' microarchitecture is not supported by this compiler, fall back to 'skylake'")
- self.options.microarchitecture = 'skylake'
-
- if self.options.microarchitecture == 'skylake' and self.settings.compiler == "gcc" and float(str(self.settings.compiler.version)) < 6:
- self.output.info("'skylake' microarchitecture is not supported by this compiler, fall back to 'haswell'")
- self.options.microarchitecture = 'haswell'
+ if self.settings.arch == "x86_64" and self.options.microarchitecture == "_DUMMY_":
+ del self.options.fix_march
+ # self.options.remove("fix_march")
+ # raise Exception ("fix_march option is for using together with microarchitecture option.")
- # if self.options.microarchitecture == 'skylake-avx512' and self.settings.compiler == "gcc" and float(str(self.settings.compiler.version)) < 5:
- # self.options.microarchitecture = 'haswell'
-
- self.options["*"].microarchitecture = self.options.microarchitecture
- self.output.info("Compiling for microarchitecture (%s): %s" % (march_from, self.options.microarchitecture))
-
+ if self.settings.arch == "x86_64":
+ march_conan_manip(self)
+ self.options["*"].microarchitecture = self.options.microarchitecture
def package_id(self):
self.info.options.with_benchmark = "ANY"
self.info.options.with_tests = "ANY"
self.info.options.with_openssl_tests = "ANY"
self.info.options.verbose = "ANY"
+ self.info.options.fix_march = "ANY"
# if self.settings.compiler == "Visual Studio":
# self.info.options.microarchitecture = "ANY"
@@ -322,9 +177,7 @@ def build(self):
cmake.definitions["USE_CONAN"] = option_on_off(True)
cmake.definitions["NO_CONAN_AT_ALL"] = option_on_off(False)
- # cmake.definitions["CMAKE_VERBOSE_MAKEFILE"] = option_on_off(False)
cmake.verbose = self.options.verbose
-
cmake.definitions["ENABLE_SHARED"] = option_on_off(self.is_shared)
cmake.definitions["ENABLE_POSITION_INDEPENDENT_CODE"] = option_on_off(self.fPIC_enabled)
@@ -349,6 +202,12 @@ def build(self):
cmake.definitions["WITH_BIGNUM"] = self.bignum_lib_name
+ # cmake.definitions["WITH_ASM"] = option_on_off(self.options.with_asm)
+ # cmake.definitions["WITH_FIELD"] = option_on_off(self.options.with_field)
+ # cmake.definitions["WITH_SCALAR"] = option_on_off(self.options.with_scalar)
+ # cmake.definitions["WITH_BIGNUM"] = option_on_off(self.options.with_bignum)
+
+
cmake.definitions["MICROARCHITECTURE"] = self.options.microarchitecture
if self.settings.os == "Windows":
@@ -367,18 +226,7 @@ def build(self):
-
- # cmake.definitions["WITH_ASM"] = option_on_off(self.options.with_asm)
- # cmake.definitions["WITH_FIELD"] = option_on_off(self.options.with_field)
- # cmake.definitions["WITH_SCALAR"] = option_on_off(self.options.with_scalar)
- # cmake.definitions["WITH_BIGNUM"] = option_on_off(self.options.with_bignum)
-
- if self.settings.compiler != "Visual Studio":
- gcc_march = str(self.options.microarchitecture).replace('_', '-')
- cmake.definitions["CONAN_CXX_FLAGS"] = cmake.definitions.get("CONAN_CXX_FLAGS", "") + " -march=" + gcc_march
- cmake.definitions["CONAN_C_FLAGS"] = cmake.definitions.get("CONAN_C_FLAGS", "") + " -march=" + gcc_march
-
- # microarchitecture_default
+ pass_march_to_compiler(self, cmake)
cmake.definitions["BITPRIM_BUILD_NUMBER"] = os.getenv('BITPRIM_BUILD_NUMBER', '-')
cmake.configure(source_dir=self.source_folder)