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

Fix ubuntu 20.04 build with gcc9 #128

Merged
merged 28 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b29ee6f
Add arm profiles
Apr 20, 2024
b3df298
Add check depending on arch
Apr 20, 2024
24c6ed0
Bump benchmark version
vollous Apr 22, 2024
e670224
Fix "aarch64" -> "arm64" on conan Setup.py
vollous Apr 22, 2024
289ac95
Fix RPi support
vollous Apr 22, 2024
42657d6
Merge branch 'master' into fix/conan-arm
phbasler Apr 22, 2024
37d9b21
Add ubuntu-20.04 to test.yml
phbasler Apr 24, 2024
12aee66
Update everything to c++17
Apr 24, 2024
d5e296c
change naming convention of profiles and adjust build script
Apr 25, 2024
24a6e59
Merge branch 'fix/conan-arm' into fix/ubuntu-20.04
Apr 25, 2024
0b4fb5d
Merge branch 'master' into fix/conan-arm
phbasler Apr 25, 2024
5d5e280
Rename profiles
Apr 25, 2024
ed34887
Get gcc version from command line
Apr 25, 2024
44a4405
add gcc 9 profiles
Apr 25, 2024
227f1cb
Add gcc 13 profiles
Apr 25, 2024
a9d9bfc
add build missing to workflow and build script
Apr 25, 2024
2b02ccc
run conan profile detect
Apr 25, 2024
cdaa902
use arm preset on mac
Apr 25, 2024
2802f77
Get profile through script
Apr 25, 2024
c2f0126
set github env variable in python script
Apr 25, 2024
0869dcd
try other variable name
Apr 25, 2024
a288344
Try another variable name and add output
Apr 25, 2024
203186c
show presets
Apr 25, 2024
ce51f48
use windows env syntax
Apr 25, 2024
66b639d
Use helper script in other workflows
Apr 25, 2024
3bc6c9b
Merge branch 'fix/conan-arm' into fix/ubuntu-20.04
Apr 25, 2024
f73d46c
delete test.txt
Apr 25, 2024
52ef785
Merge branch 'master' into fix/ubuntu-20.04
phbasler Apr 27, 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
tests-fullSetup:
strategy:
matrix:
setup: [ {os: ubuntu-latest}, {os: windows-latest}, {os: macos-latest}]
setup: [ {os: ubuntu-latest}, {os: windows-latest}, {os: macos-latest}, {os: ubuntu-20.04}]
runs-on: ${{matrix.setup.os}}
if: "!contains(github.event.head_commit.message, 'skip-ci')"

Expand All @@ -38,7 +38,7 @@ jobs:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- run: python3 Setup.py --options CompileBaryo=True
- run: python3 Setup.py --options CompileBaryo=True --build-missing

- name: Set cmake preset name
run: python3 .github/GetProfile.py
Expand Down
2 changes: 1 addition & 1 deletion Build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def build(preset):

def main():
Setup.setup_profiles()
Setup.conan_install_all(Setup.BuildMode.release)
Setup.conan_install_all(Setup.BuildMode.release,build_missing=True)
build(get_preset())

if __name__ == "__main__":
Expand Down
21 changes: 21 additions & 0 deletions Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ class BuildMode(ArgTypeEnum, Enum):
release = (1,)
debug = 2

def get_compiler():
compiler=""

if sys.platform != "linux":
return compiler

compiler += "-gcc-"
compiler += get_gcc_version()



return compiler

def get_profile(os: str, arch: str, build_type: BuildMode):
profile = ""
if os == "win32":
Expand All @@ -43,8 +56,16 @@ def get_profile(os: str, arch: str, build_type: BuildMode):
profile += "-"
profile += arch

profile += get_compiler()


return profile

def get_gcc_version():
version_response = subprocess.check_output('gcc --version'.split(), encoding="UTF-8").partition("\n")[0]
semver_string=version_response[version_response.rfind(' ')+1:]
major = semver_string.partition('.')[0]
return major

def get_arch():
arch = "x86_64"
Expand Down
10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-armv8-gcc-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=armv8
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux


10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-armv8-gcc-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=armv8
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux


10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-armv8-gcc-9
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=armv8
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux


10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-x86_64-gcc-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux


10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-x86_64-gcc-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux


10 changes: 10 additions & 0 deletions profiles/BSMPT/linux-debug-x86_64-gcc-9
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux


9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-armv8-gcc-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-armv8-gcc-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-armv8-gcc-9
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux

9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-x86_64-gcc-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-x86_64-gcc-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

9 changes: 9 additions & 0 deletions profiles/BSMPT/linux-release-x86_64-gcc-9
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux

22 changes: 11 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,48 @@ add_subdirectory(utility)

add_executable(BSMPT prog/BSMPT.cpp)
target_link_libraries(BSMPT Minimizer Models Utility)
target_compile_features(BSMPT PUBLIC cxx_std_14)
target_compile_features(BSMPT PUBLIC cxx_std_17)

add_executable(VEVEVO prog/VEVEVO.cpp)
target_link_libraries(VEVEVO Minimizer Models Utility)
target_compile_features(VEVEVO PUBLIC cxx_std_14)
target_compile_features(VEVEVO PUBLIC cxx_std_17)

add_executable(NLOVEV prog/NLOVEV.cpp)
target_link_libraries(NLOVEV Minimizer Models Utility)
target_compile_features(NLOVEV PUBLIC cxx_std_14)
target_compile_features(NLOVEV PUBLIC cxx_std_17)

add_executable(CalcCT prog/CalcCT.cpp)
target_link_libraries(CalcCT Models Utility)
target_compile_features(CalcCT PUBLIC cxx_std_14)
target_compile_features(CalcCT PUBLIC cxx_std_17)

add_executable(TripleHiggsCouplingsNLO prog/TripleHiggsNLO.cpp)
target_link_libraries(TripleHiggsCouplingsNLO Models Utility)
target_compile_features(TripleHiggsCouplingsNLO PUBLIC cxx_std_14)
target_compile_features(TripleHiggsCouplingsNLO PUBLIC cxx_std_17)

add_executable(Test prog/Test.cpp)
target_link_libraries(Test Minimizer Models Utility)
target_compile_features(Test PUBLIC cxx_std_14)
target_compile_features(Test PUBLIC cxx_std_17)

if(BSMPTCompileBaryo)
add_executable(CalculateEWBG prog/CalculateEWBG.cpp)
target_link_libraries(CalculateEWBG Minimizer Models Baryo Utility)
target_compile_features(CalculateEWBG PUBLIC cxx_std_14)
target_compile_features(CalculateEWBG PUBLIC cxx_std_17)
else(BSMPTCompileBaryo)
message("CalculateEWBG will not compile as Boost is missing")
endif(BSMPTCompileBaryo)

if(BSMPTCompileBaryo)
add_executable(PlotEWBG_vw prog/PlotEWBG_vw.cpp)
target_link_libraries(PlotEWBG_vw Minimizer Models Baryo Utility)
target_compile_features(PlotEWBG_vw PUBLIC cxx_std_14)
target_compile_features(PlotEWBG_vw PUBLIC cxx_std_17)
else(BSMPTCompileBaryo)
message("PlotEWBG_vw will not compile as Boost is missing")
endif(BSMPTCompileBaryo)

if(BSMPTCompileBaryo)
add_executable(PlotEWBG_nL prog/PlotEWBG_nL.cpp)
target_link_libraries(PlotEWBG_nL Minimizer Models Baryo Utility)
target_compile_features(PlotEWBG_nL PUBLIC cxx_std_14)
target_compile_features(PlotEWBG_nL PUBLIC cxx_std_17)
else(BSMPTCompileBaryo)
message("PlotEWBG_nL will not compile as Boost is missing")
endif(BSMPTCompileBaryo)
Expand All @@ -74,15 +74,15 @@ if(MakeAdditionalTesting)
if(BSMPTCompileBaryo)
add_executable(CreateMuGrid prog/CreateMuGrid.cpp)
target_link_libraries(CreateMuGrid Minimizer Models Baryo Utility)
target_compile_features(CreateMuGrid PUBLIC cxx_std_14)
target_compile_features(CreateMuGrid PUBLIC cxx_std_17)
else(BSMPTCompileBaryo)
message("CreateMuGrid will not compile as Boost is missing")
endif(BSMPTCompileBaryo)

if(BSMPTCompileBaryo)
add_executable(Kfactor_grid prog/Kfactor_grid.cpp)
target_link_libraries(Kfactor_grid Minimizer Models Kfactors Utility)
target_compile_features(Kfactor_grid PUBLIC cxx_std_14)
target_compile_features(Kfactor_grid PUBLIC cxx_std_17)
else(BSMPTCompileBaryo)
message("Kfactor_grid will not compile as Boost is missing")
endif(BSMPTCompileBaryo)
Expand Down
2 changes: 1 addition & 1 deletion src/Kfactors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ if(OpenMP_FOUND)
target_link_libraries(Kfactors PUBLIC OpenMP::OpenMP_CXX)
endif()
target_include_directories(Kfactors PUBLIC ${BSMPT_SOURCE_DIR}/include)
target_compile_features(Kfactors PUBLIC cxx_std_14)
target_compile_features(Kfactors PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion src/ThermalFunctions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ add_library(ThermalFunctions ${header} ${src})

target_link_libraries(ThermalFunctions PUBLIC GSL::gsl)
target_include_directories(ThermalFunctions PUBLIC ${BSMPT_SOURCE_DIR}/include)
target_compile_features(ThermalFunctions PUBLIC cxx_std_14)
target_compile_features(ThermalFunctions PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion src/WallThickness/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_link_libraries(
LibWallThickness PUBLIC Eigen3::Eigen GSL::gsl Minimizer Utility Boost::boost
Threads::Threads)
target_include_directories(LibWallThickness PUBLIC ${BSMPT_SOURCE_DIR}/include)
target_compile_features(LibWallThickness PUBLIC cxx_std_14)
target_compile_features(LibWallThickness PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion src/baryo_calculation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ target_link_libraries(
Boost::boost)
# target_compile_options(Baryo PUBLIC ${OpenMP_CXX_FLAGS})
target_include_directories(Baryo PUBLIC ${BSMPT_SOURCE_DIR}/include)
target_compile_features(Baryo PUBLIC cxx_std_14)
target_compile_features(Baryo PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion src/minimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ endif()
target_include_directories(Minimizer PUBLIC ${BSMPT_SOURCE_DIR}/include
${BSMPT_BINARY_DIR}/include)
target_include_directories(Minimizer PUBLIC ${BSMPT_SOURCE_DIR}/include)
target_compile_features(Minimizer PUBLIC cxx_std_14)
target_compile_features(Minimizer PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion src/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_compile_features(Utility PUBLIC cxx_std_17)
if(nlohmann_json_FOUND)
target_link_libraries(Utility PRIVATE nlohmann_json::nlohmann_json)
endif()
target_compile_features(Utility PUBLIC cxx_std_14)
target_compile_features(Utility PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion tests/GenerateTestCompares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ set(header C2HDM.h R2HDM.h RN2HDM.h CPINTHEDARK.h CXSM.h)
set(src C2HDM.cpp R2HDM.cpp RN2HDM.cpp CPINTHEDARK.cpp CXSM.cpp)

add_library(TestCompares ${header} ${src})
target_compile_features(TestCompares PUBLIC cxx_std_14)
target_compile_features(TestCompares PUBLIC cxx_std_17)
target_link_libraries(TestCompares PRIVATE Minimizer)
target_include_directories(TestCompares PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
2 changes: 1 addition & 1 deletion tests/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(benchmark_FOUND)
target_link_libraries(benchmarks Minimizer Models Utility TestCompares
ThermalFunctions)
target_link_libraries(benchmarks benchmark::benchmark)
target_compile_features(benchmarks PUBLIC cxx_std_14)
target_compile_features(benchmarks PUBLIC cxx_std_17)

if(BSMPTCompileBaryo)
target_link_libraries(benchmarks Baryo)
Expand Down
2 changes: 1 addition & 1 deletion tests/catcheventlistener/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ add_library(CatchEventListener catcheventlistener.cpp)
target_link_libraries(CatchEventListener PRIVATE Utility Catch2::Catch2WithMain)
target_include_directories(CatchEventListener
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_features(CatchEventListener PUBLIC cxx_std_14)
target_compile_features(CatchEventListener PUBLIC cxx_std_17)
2 changes: 1 addition & 1 deletion tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_link_libraries(
Utility
TestCompares
ThermalFunctions)
target_compile_features(GenericTests PUBLIC cxx_std_14)
target_compile_features(GenericTests PUBLIC cxx_std_17)

include(Catch)
catch_discover_tests(GenericTests)
Expand Down