Skip to content

Commit

Permalink
cmake_refresh (#33)
Browse files Browse the repository at this point in the history
* cmake_refresh

* removing patch

* added one CI

* typo

* fix manylinux

* hoping to fix the python executable

* fixing the site location

* daje

* py12 added 8-9 removed

* pygmo ver update

* pygmo ver update revert

* pygmo ver update revert
  • Loading branch information
darioizzo authored Jun 10, 2024
1 parent 15f0eb1 commit e28766a
Show file tree
Hide file tree
Showing 20 changed files with 250 additions and 828 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,45 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
amd64-manylinux228-py311:
runs-on: ubuntu-latest
container:
image: pagmo2/manylinux228_x86_64_with_deps:latest
env:
PPNF_BUILD_TYPE: "Python311"
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Build
run: bash tools/gha_manylinux.sh
amd64-manylinux228-py310:
amd64-manylinux228-py39:
runs-on: ubuntu-latest
container:
image: pagmo2/manylinux228_x86_64_with_deps:latest
env:
PPNF_BUILD_TYPE: "Python310"
PPNF_BUILD_TYPE: "Python39"
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Build
run: bash tools/gha_manylinux.sh
amd64-manylinux228-py39:
amd64-manylinux228-py311:
runs-on: ubuntu-latest
container:
image: pagmo2/manylinux228_x86_64_with_deps:latest
env:
PPNF_BUILD_TYPE: "Python39"
PPNF_BUILD_TYPE: "Python311"
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Build
run: bash tools/gha_manylinux.sh
amd64-manylinux228-py38:
amd64-manylinux228-py310:
runs-on: ubuntu-latest
container:
image: pagmo2/manylinux228_x86_64_with_deps:latest
env:
PPNF_BUILD_TYPE: "Python38"
PPNF_BUILD_TYPE: "Python310"
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Build
run: bash tools/gha_manylinux.sh
linux_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: bash tools/gha_pygmo_plugins_nonfree_linux.sh
51 changes: 24 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CMake version check.
cmake_minimum_required(VERSION 3.3)
# NOTE: current minimum requirement.
cmake_minimum_required(VERSION 3.18.0)

# Module path setup.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules" "${CMAKE_SOURCE_DIR}/cmake_modules/yacma")
Expand Down Expand Up @@ -69,30 +69,15 @@ if(MINGW)
list(APPEND PAGMO_PLUGINS_NONFREE_CXX_FLAGS_RELEASE "-Wa,-mbig-obj")
endif()

if(PPNF_BUILD_CPP)
# pagmo plugins non free dependencies
if(PPNF_BUILD_TESTS)
# Internal variable that will be used to tell PagmoPNFFindBoost to locate the
# Boost unit test framework, if tests are required.
set(_PAGMO_PLUGINS_NONFREE_FIND_BOOST_UNIT_TEST_FRAMEWORK TRUE)
endif()
endif()

if(PPNF_BUILD_PYTHON)
# pygmo plugins non free dependencies
include(YACMAPythonSetup)

# Python version check.
if(${PYTHON_VERSION_MAJOR} LESS 3 )
message(FATAL_ERROR "Minimum supported Python version is 3")
endif()

# Internal variable that will be used to tell PagmoFindBoost to locate Boost.Python.
set(_PAGMO_PLUGINS_NONFREE_FIND_BOOST_PYTHON TRUE)
endif()
# Setting the boost libraries needed for PPNF
# NOTE: need 1.48 as pagmo.
set(_PPNF_MIN_BOOST_VERSION "1.48")
find_package(Boost ${_PPNF_MIN_BOOST_VERSION} REQUIRED COMPONENTS system filesystem unit_test_framework)
MESSAGE(STATUS "Detected Boost version: ${Boost_VERSION}")
# Include system Boost headers.
MESSAGE(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}")
MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}")

# Boost setup (common to pagmo/pygmo . pluginsnonfree).
include(PagmoPNFFindBoost)
# Pagmo setup (common to pagmo/pygmo . pluginsnonfree).
find_package(Pagmo REQUIRED)

Expand Down Expand Up @@ -148,9 +133,22 @@ if(PPNF_BUILD_CPP)
endif()
endif()

# Build the pygmo_plugins_nonfree module
if(PPNF_BUILD_PYTHON)
# Find python
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
message(STATUS "Python3 interpreter: ${Python3_EXECUTABLE}")
message(STATUS "Python3 installation directory: ${Python3_SITEARCH}")
message(STATUS "Python3 include directories: ${Python3_INCLUDE_DIRS}")

set(PPFN_INSTALL_PATH "" CACHE STRING "ppfn module installation path")
mark_as_advanced(PPFN_INSTALL_PATH)

# pybind11.
find_package(pybind11 REQUIRED)

# Build directory
add_subdirectory("${CMAKE_SOURCE_DIR}/pygmo_plugins_nonfree")

if(MINGW OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "Creating the files for the generation of a binary wheel.")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/wheel_setup.py" "${CMAKE_CURRENT_BINARY_DIR}/wheel/setup.py" @ONLY)
Expand Down Expand Up @@ -181,7 +179,6 @@ if(PPNF_BUILD_CPP)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pagmo_plugins_nonfree-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/pagmo_plugins_nonfree-config.cmake" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pagmo_plugins_nonfree-config.cmake" DESTINATION "lib/cmake/pagmo_plugins_nonfree")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/PagmoPNFFindBoost.cmake" DESTINATION "lib/cmake/pagmo_plugins_nonfree")
install(EXPORT pagmo_plugins_nonfree_export NAMESPACE Pagmo_plugins_nonfree:: DESTINATION lib/cmake/pagmo_plugins_nonfree)
# Take care of versioning.
include(CMakePackageConfigHelpers)
Expand Down
Loading

0 comments on commit e28766a

Please sign in to comment.