Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/esa/pagmo2
Browse files Browse the repository at this point in the history
  • Loading branch information
SchwarzschildX committed Dec 27, 2021
2 parents 3bff571 + 121ec57 commit a08dd68
Show file tree
Hide file tree
Showing 335 changed files with 1,709,094 additions and 2,116 deletions.
32 changes: 12 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: 2
version: 2.1

jobs:
bionic_gcc7_coverage:
focal_gcc9_coverage:
docker:
- image: circleci/buildpack-deps:bionic
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_bionic_gcc7_coverage.sh
command: bash ./tools/circleci_focal_gcc9_coverage.sh
focal_gcc9_asan:
docker:
- image: circleci/buildpack-deps:focal
Expand All @@ -25,29 +25,21 @@ jobs:
- run:
name: Build and test
command: bash ./tools/circleci_focal_gcc9_docs.sh
focal_clang9:
docker:
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_focal_clang9.sh
bionic_clang6_release:
docker:
- image: circleci/buildpack-deps:bionic
ubuntu_arm64:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_bionic_clang6_release.sh
command: bash ./tools/circleci_ubuntu_arm64.sh

workflows:
version: 2
version: 2.1
all_builds:
jobs:
- bionic_gcc7_coverage
- focal_gcc9_coverage
- focal_gcc9_asan
- focal_clang9
- bionic_clang6_release
- focal_gcc9_docs
- ubuntu_arm64
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: GitHub CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
osx_10_15:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Build
run: bash tools/gha_osx.sh
windows-2016:
runs-on: windows-2016
steps:
- uses: actions/checkout@v2
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
channels: conda-forge
channel-priority: strict
- name: Build
run: .\tools\gha_windows-2016.ps1
shell: powershell
27 changes: 4 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: cpp
sudo: required

# Do not build branches of the form "pr/*". By prefixing pull requests coming
# from branches inside the repository with pr/, this avoids building both the
Expand All @@ -8,29 +7,11 @@ branches:
except: /pr\/.*/

matrix:
include:
- env: PAGMO_BUILD="OSXDebug"
os: osx
osx_image: xcode9.4
- env: PAGMO_BUILD="OSXRelease"
os: osx
osx_image: xcode9.4

- os: linux
arch: ppc64le
dist: focal
script:
- mkdir build
- cd build
# NOTE: currently, travis does not stop automatically if one of these
# 2 scripts returns an error code. Thus, we run them together as a single
# command, so that if install_deps.sh fails the whole build fails immediately
# rather than executing install_travis.sh as well. See
# https://github.com/travis-ci/travis-ci/issues/1066
- ../tools/install_deps.sh && ../tools/install_travis.sh
- tools/travis_ubuntu_ppc64.sh

notifications:
email: false
webhooks:
urls:
- https://webhooks.gitter.im/e/4e99a1581d9b99397e5f
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
79 changes: 45 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

project(pagmo VERSION 2.16.1 LANGUAGES CXX C)
project(pagmo VERSION 2.18.0 LANGUAGES CXX C)

# Setup module path.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/yacma")
Expand Down Expand Up @@ -69,6 +69,28 @@ include(CheckCXXCompilerFlag)
# Threading setup.
include(YACMAThreadingSetup)

# NOTE: on Unix systems, the correct library installation path
# could be something other than just "lib", such as "lib64",
# "lib32", etc., depending on platform/configuration. Apparently,
# CMake provides this information via the GNUInstallDirs module.
# Let's enable this for now on all Unixes except OSX.
# NOTE: potentially, this could be applicable to Cygwin as well.
#
# https://cmake.org/cmake/help/v3.15/module/GNUInstallDirs.html
# https://cmake.org/pipermail/cmake/2013-July/055375.html
if(UNIX AND NOT APPLE)
include(GNUInstallDirs)
set(_PAGMO_INSTALL_LIBDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}")
else()
set(_PAGMO_INSTALL_LIBDIR_DEFAULT "lib")
endif()
if(NOT PAGMO_INSTALL_LIBDIR)
set(PAGMO_INSTALL_LIBDIR "${_PAGMO_INSTALL_LIBDIR_DEFAULT}" CACHE STRING
"Library installation directory." FORCE)
endif()
mark_as_advanced(PAGMO_INSTALL_LIBDIR)
message(STATUS "Library installation directory: ${PAGMO_INSTALL_LIBDIR}")

# Assemble the flags.
set(PAGMO_CXX_FLAGS_DEBUG ${YACMA_CXX_FLAGS} ${YACMA_CXX_FLAGS_DEBUG} ${YACMA_THREADING_CXX_FLAGS})
set(PAGMO_CXX_FLAGS_RELEASE ${YACMA_CXX_FLAGS} ${YACMA_THREADING_CXX_FLAGS})
Expand All @@ -80,8 +102,8 @@ endif()
if(YACMA_COMPILER_IS_MSVC)
# Disable the idiotic minmax macros on MSVC, some annoying warnings,
# enable the bigobj option and the WIN32_LEAN_AND_MEAN definition.
list(APPEND PAGMO_CXX_FLAGS_DEBUG "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
list(APPEND PAGMO_CXX_FLAGS_RELEASE "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
list(APPEND PAGMO_CXX_FLAGS_DEBUG "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/wd4701" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
list(APPEND PAGMO_CXX_FLAGS_RELEASE "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/wd4701" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
# Enable strict conformance mode, if supported.
set(CMAKE_REQUIRED_QUIET TRUE)
check_cxx_compiler_flag("/permissive-" _PAGMO_MSVC_SUPPORTS_STRICT_CONFORMANCE)
Expand Down Expand Up @@ -114,8 +136,18 @@ if(YACMA_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8")
unset(_PAGMO_GCC_SUPPORTS_NO_OVERRIDE)
endif()

# TBB.
find_package(TBB REQUIRED)
# TBB. Try to find it first in config mode (supported
# since version 2021 after the oneTBB rename), and, if this
# fails, fall back to our own FindTBB.cmake. This is of course
# not an ideal solution, but it should work until oneTBB
# becomes widely deployed.
find_package(TBB QUIET CONFIG)
if(NOT TBB_FOUND)
message(STATUS "TBB not found using config mode, retrying in module mode.")
find_package(TBB REQUIRED MODULE)
else()
message(STATUS "TBB found using config mode.")
endif()

# Eigen3
if(PAGMO_WITH_EIGEN3)
Expand All @@ -141,27 +173,6 @@ endif()
# Boost setup.
include(PagmoFindBoost)

# Explanation: on MSVC, when building static libraries, it is good practice to link
# to the static runtime. CMake, however, is hard-coded to link to the dynamic runtime.
# Hence we hackishly replace the /MD flag with /MT. This is the approach suggested
# in the CMake FAQ:
#
# https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
#
# Note that at one point CMake added the possiblity to set this as a target property,
# so in the future we should definitely migrate to that approach:
#
# https://cmake.org/cmake/help/git-master/prop_tgt/MSVC_RUNTIME_LIBRARY.html
if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach()
endif()

# List of source files.
set(PAGMO_SRC_FILES
# Core classes.
Expand Down Expand Up @@ -300,8 +311,8 @@ if(PAGMO_BUILD_STATIC_LIBRARY)
add_library(pagmo STATIC "${PAGMO_SRC_FILES}")
else()
add_library(pagmo SHARED "${PAGMO_SRC_FILES}")
set_property(TARGET pagmo PROPERTY VERSION "6.0")
set_property(TARGET pagmo PROPERTY SOVERSION 6)
set_property(TARGET pagmo PROPERTY VERSION "8.0")
set_property(TARGET pagmo PROPERTY SOVERSION 8)
set_target_properties(pagmo PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(pagmo PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
endif()
Expand Down Expand Up @@ -424,8 +435,8 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/pagmo/config.hpp" DESTINATION
# Installation of the library.
install(TARGETS pagmo
EXPORT pagmo_export
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION "${PAGMO_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${PAGMO_INSTALL_LIBDIR}"
RUNTIME DESTINATION bin
)

Expand All @@ -442,10 +453,10 @@ if(PAGMO_WITH_IPOPT)
endif()

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pagmo-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config.cmake" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config.cmake" DESTINATION "lib/cmake/pagmo")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config.cmake" DESTINATION "${PAGMO_INSTALL_LIBDIR}/cmake/pagmo")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findpagmo_IPOPT.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/PagmoFindBoost.cmake"
DESTINATION "lib/cmake/pagmo")
install(EXPORT pagmo_export NAMESPACE Pagmo:: DESTINATION lib/cmake/pagmo)
DESTINATION "${PAGMO_INSTALL_LIBDIR}/cmake/pagmo")
install(EXPORT pagmo_export NAMESPACE Pagmo:: DESTINATION "${PAGMO_INSTALL_LIBDIR}/cmake/pagmo")
# Take care of versioning.
include(CMakePackageConfigHelpers)
# NOTE: SameMinorVersion available only
Expand All @@ -457,7 +468,7 @@ else()
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/pagmo-config-version.cmake" VERSION ${pagmo_VERSION}
COMPATIBILITY SameMinorVersion)
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config-version.cmake" DESTINATION "lib/cmake/pagmo")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config-version.cmake" DESTINATION "${PAGMO_INSTALL_LIBDIR}/cmake/pagmo")

# Uninstall target
if(NOT TARGET uninstall)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pagmo
=====

[![Build Status](https://img.shields.io/circleci/project/github/esa/pagmo2/master.svg?style=for-the-badge)](https://circleci.com/gh/esa/pagmo2)
[![Build Status](https://img.shields.io/travis/esa/pagmo2/master.svg?logo=travis&style=for-the-badge)](https://travis-ci.org/esa/pagmo2)
[![Build Status](https://img.shields.io/appveyor/ci/ci4esa/pagmo2/master.svg?logo=appveyor&style=for-the-badge)](https://ci.appveyor.com/project/ci4esa/pagmo2)
[![Build Status](https://img.shields.io/github/workflow/status/esa/pagmo2/GitHub%20CI?style=for-the-badge)](https://github.com/esa/pagmo2/actions?query=workflow%3A%22GitHub+CI%22)
[![Build Status](https://img.shields.io/travis/com/esa/pagmo2?style=for-the-badge)](https://travis-ci.com/esa/pagmo2)
[![Code Coverage](https://img.shields.io/codecov/c/github/esa/pagmo2.svg?style=for-the-badge)](https://codecov.io/github/esa/pagmo2?branch=master)

[![Anaconda-Server Badge](https://img.shields.io/conda/vn/conda-forge/pagmo.svg?style=for-the-badge)](https://anaconda.org/conda-forge/pagmo)
Expand Down
31 changes: 0 additions & 31 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion cmake_modules/yacma/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2020 Francesco Biscani
Copyright (c) 2016-2021 Francesco Biscani

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion config.hpp.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2017-2020 PaGMO development team
/* Copyright 2017-2021 PaGMO development team

This file is part of the PaGMO library.

Expand Down
Loading

0 comments on commit a08dd68

Please sign in to comment.