Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of local conan package #154

Draft
wants to merge 75 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d2d8145
Create local package and add test_package
Jun 1, 2024
f1a8e03
Move cmaes and nlopt as seperate libraries
Jun 1, 2024
b09dce5
Add install paths
Jun 1, 2024
973f261
Start with components
Jun 1, 2024
8513912
create conan worklfow to test test_package
Jun 2, 2024
c821251
create conan workflow
Jun 2, 2024
a3f7333
remove fpic
Jun 2, 2024
6e40c11
use script
Jun 2, 2024
41ae8a6
Update conan.yml
phbasler Jun 2, 2024
fc52a67
change libnlopt to interface
Jun 2, 2024
7247f01
fix build
Jun 2, 2024
14996ee
set requirements transitive
Jun 2, 2024
0886857
turn off options for quicker compile time for testing
Jun 2, 2024
83b9938
add cxx11 flag, move os overload for modelid to models
Jun 2, 2024
6d9add0
move modelid to utility
Jun 2, 2024
e52b609
Call model
Jun 2, 2024
a122282
build all
Jun 2, 2024
d08d39d
dont build unit tests for package creation
Jun 2, 2024
b3325e5
BuildExecutables True per default and false in create script
Jun 2, 2024
223e25b
fix typo
Jun 2, 2024
df4c65f
Update Setup.py
phbasler Jun 2, 2024
b61b061
disable cmaes
phbasler Jun 2, 2024
059d6f3
enable cmaes and minimize in test_package
Jun 3, 2024
35f4f0b
build cmaes static and set component name
Jun 3, 2024
7611b30
Fix wrong lib name
Jun 3, 2024
e06d96d
add fpic and reset cmaes to shared
Jun 3, 2024
37430b7
set cmaes to static library
Jun 3, 2024
fa96851
add cmaes dependencies for static library
phbasler Jul 14, 2024
c60db12
dont use openmp on windows
phbasler Jul 14, 2024
5819b20
add misisng require component
phbasler Jul 14, 2024
2e4e0b2
fix name in requirement
phbasler Jul 14, 2024
d5ca190
link whole archiv
phbasler Jul 14, 2024
a9b1306
Comment default options
phbasler Jul 14, 2024
da3a8e4
Merge branch 'master' into feature/create-conan-package
phbasler Jul 14, 2024
cc47dbe
Automatically applied linter
Jul 14, 2024
349ee38
Automated commit of cmake-format changes.
phbasler Jul 14, 2024
abd19e2
add cmaes conan file
phbasler Jul 14, 2024
ba122c5
Automated commit of cmake-format changes.
phbasler Jul 14, 2024
b6d8c85
remove cmaes through cmake and get it through conan
phbasler Jul 14, 2024
8e82213
Merge branch 'feature/create-conan-package' of https://github.com/phb…
phbasler Jul 14, 2024
642a435
Automated commit of cmake-format changes.
phbasler Jul 14, 2024
2aecd06
runs on linux
phbasler Jul 14, 2024
0900f74
Merge branch 'feature/create-conan-package' of https://github.com/phb…
phbasler Jul 14, 2024
4426bf2
Automated commit of cmake-format changes.
phbasler Jul 14, 2024
c7c9549
adjust cmaes conan file to get openmp through compiler flags
phbasler Jul 14, 2024
85365c5
readd package to cmaes
phbasler Jul 14, 2024
ffdeaad
dont use openmp in cmaes on windows
phbasler Jul 14, 2024
fb5ab3d
appy patch for windows cmaes
phbasler Jul 14, 2024
e729af1
remove windows to check if mac works
phbasler Jul 14, 2024
eeb3ea6
enable windows again
phbasler Jul 14, 2024
c14caf9
Apply compiler options from PR
phbasler Jul 15, 2024
ea33013
Fix patchfile to include new file
phbasler Jul 15, 2024
52388eb
include eigen fix
phbasler Jul 15, 2024
06bab61
fix test_package build on windows
phbasler Jul 15, 2024
688feb9
Automated commit of cmake-format changes.
phbasler Jul 15, 2024
fec0df1
Only trigger linters on non draft and allow workflows from those commits
phbasler Jul 15, 2024
035d3ce
build cmaes if build-missing is not chosen
phbasler Jul 15, 2024
1f79267
fix cmaes_found
phbasler Jul 16, 2024
37676f7
add missing $
phbasler Jul 17, 2024
dd28538
Add clang profiles
phbasler Jul 18, 2024
e723b1f
Disable vectorization
phbasler Jul 18, 2024
542584a
fix missing arguments
phbasler Jul 18, 2024
5a96b77
disable sanitize
phbasler Jul 18, 2024
7d83690
disable fail fast
phbasler Jul 18, 2024
fbae1f8
Merge branch 'master' into feature/create-conan-package
phbasler Jul 18, 2024
7765496
Try different settings
phbasler Jul 22, 2024
a289ac1
Merge branch 'feature/create-conan-package' of https://github.com/phb…
phbasler Jul 22, 2024
5bd9e95
disable fixed abi
phbasler Jul 22, 2024
d6a19a3
Update conanfile
phbasler Jul 22, 2024
8230d54
add eigen to required packages
phbasler Jul 22, 2024
a348595
return cmaes to cmake
phbasler Aug 11, 2024
1042269
return cmaes to cmake
phbasler Aug 11, 2024
fdec2fd
Add cmaes target
phbasler Aug 11, 2024
c38bf0c
Merge branch 'master' into feature/create-conan-package
phbasler Aug 11, 2024
aa031ab
run workflow without cmaes
phbasler Aug 11, 2024
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
12 changes: 11 additions & 1 deletion .github/workflows/cmake-format-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@ name: Run cmake-format linter

on:
pull_request:
branches: [ master, develop ]
branches:
- master
- develop
types:
- opened
- reopened
- synchronize
- ready_for_review

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ssh-key: ${{secrets.DEPLOY_KEY}}

- name: Format CMake files
id: cmake-format
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run conan

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
conan:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
if: "!contains(github.event.head_commit.message, 'skip-ci')"

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install conan
run: pip install conan>2

- name: Build without cmaes
run: python3 Setup.py --create --build-missing --options UseLibCMAES=False

- run: python3 Setup.py --create --build-missing
10 changes: 9 additions & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@ name: cpp-linter

on:
pull_request:
branches: [master]
branches:
- master
types:
- opened
- reopened
- synchronize
- ready_for_review

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cpp-linter:
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
ssh-key: ${{secrets.DEPLOY_KEY}}

- name: Install clang-format
if: inputs.apply_clang_format
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ analyze*.py

CMakeUserPresets.json
__pycache__/*

test_package/build/
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles/cmake.check_cache
8 changes: 5 additions & 3 deletions Build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import subprocess
import sys


def get_preset():
preset = "conan-"
os = sys.platform
Expand All @@ -11,19 +12,20 @@ def get_preset():
preset += "linux"
elif os == "darwin":
preset += "macos"

preset += "-"
preset += Setup.get_arch()

preset += "-release"

return preset


def build(preset):
cmd=f"cmake --preset {preset} --fresh".split()
subprocess.check_call(cmd)

cmd=f"cmake --build --preset {preset}".split()
cmd = f"cmake --build --preset {preset}".split()
subprocess.check_call(cmd)


Expand All @@ -37,6 +39,6 @@ def main():
)
build(get_preset())


if __name__ == "__main__":
main()

50 changes: 12 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
# SPDX-License-Identifier: GPL-3.0-or-later

cmake_minimum_required(VERSION 3.23)
set(BSMPT_VERSION 3.0.6)
project(
BSMPT
VERSION 3.0.6
VERSION ${BSMPT_VERSION}
LANGUAGES C CXX
DESCRIPTION
"BSMPT - Beyond the Standard Model Phase Transitions : A C++ package for the computation of the EWPT in BSM models"
)

set(CMAKE_CXX_FLAGS "-g")


# -------------------------------- options --------------------------------

option(UseLibCMAES "Use libcmaes to minimize the potential" ON)
Expand All @@ -21,6 +25,7 @@ option(MakeAdditionalTesting "Build the executables used for further testing"
option(BSMPTCompileBaryo "Compile Baryogenesis" OFF)
option(EnableCoverage "Enable code coverage" OFF)
option(BSMPTUseVectorization "Disable vectorization" ON)
option(BSMPTBuildExecutables "Build the executables" ON)

set(BSMPT_IS_TOPLEVEL NO)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand Down Expand Up @@ -53,7 +58,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif(NOT CMAKE_BUILD_TYPE)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")

include(LTO)

Expand All @@ -69,6 +74,9 @@ if(NOT Boost_FOUND)
set(BSMPTCompileBaryo OFF)
endif()

# add_compile_options(-fsanitize=address)
# add_link_options(-fsanitize=address)

set(CodeCoverageExcludesFromOtherPkgs "")
if(NOT "${EIGEN3_ROOT_DIR}" STREQUAL "")
list(APPEND CodeCoverageExcludesFromOtherPkgs "${EIGEN3_ROOT_DIR}/*")
Expand Down Expand Up @@ -114,12 +122,10 @@ if(UseNLopt)

endif(UseNLopt)

if(NOT libcmaes_FOUND AND NOT NLopt_FOUND)
if(NOT cmaes_FOUND AND NOT NLopt_FOUND)
message(FATAL_ERROR "You need at least libcmaes or NLopt.")
endif()

configure_file(include/BSMPT/config.h.in include/BSMPT/config.h)

# -------------------- Coverage
# --------------------------------------------------

Expand Down Expand Up @@ -156,43 +162,11 @@ if(EnableCoverage)
GenericTests)
endif(EnableCoverage)

find_lto(CXX)
# find_lto(CXX)

add_subdirectory(src)
add_subdirectory(standalone)

# -------------------------- export as cmake package --------------------------
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
BSMPTConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion)

set(ExportList Models Minimizer ThermalFunctions Utility Spline ASCIIPlotter)

if(BSMPTCompileBaryo)
set(ExportList ${ExportList} Baryo LibWallThickness Kfactors)
endif(BSMPTCompileBaryo)

export(
TARGETS ${ExportList}
NAMESPACE BSMPT::
FILE BSMPTTargets.cmake)

if(EXPORT_CMAES)
export(
TARGETS cmaes
NAMESPACE libcmaes::
APPEND
FILE BSMPTTargets.cmake)
endif(EXPORT_CMAES)

configure_file(tools/cmake/BSMPTConfig.cmake.in BSMPTConfig.cmake @ONLY)

export(PACKAGE BSMPT)
endif()

# ------------------------ Doxygen --------------------------------------------
if(BSMPT_IS_TOPLEVEL)
find_package(Doxygen)
Expand Down
Loading
Loading