From 5256d5aef5fe9a093449c44adbb6bd2ad8cb43d1 Mon Sep 17 00:00:00 2001 From: Nick Papior Date: Thu, 21 Sep 2023 08:37:01 +0200 Subject: [PATCH] trying to fix osx problems Signed-off-by: Nick Papior --- CMakeLists.txt | 42 +++++++++++++++++++++++++++--------------- pyproject.toml | 3 +++ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27ef0aebe..948c7d33a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,10 +7,24 @@ if(SKBUILD) endif() +# We need to check for fortran first since the project initialization sets +# specific variables depending on what languages are present. +# Therefore project(... LANGUAGES C) + enable_language(Fortran) +# is different from project(... LANGUAGES C Fortran) +# This is a bit surprising... :( +option(WITH_FORTRAN + "Whether to compile and ship fortran sources (default True)" TRUE) + +set(_languages C CXX) +if( WITH_FORTRAN ) + list(APPEND _languages Fortran) +endif() + + project(sisl DESCRIPTION "Cythonized or fortran codes" HOMEPAGE_URL "https://github.com/zerothi/sisl" - LANGUAGES C CXX + LANGUAGES ${_languages} # cmake requires a version of X.Y.Z or some other form, it does not accept setuptools_scm dirty tags # VERSION "${SKBUILD_PROJECT_VERSION}" ) @@ -40,17 +54,15 @@ set(CMAKE_SHARED_MODULE_PREFIX "") # Define all options for the user - -set(F2PY_REPORT_ON_ARRAY_COPY 10 - CACHE STRING - "The minimum size of arrays before warning about copies") -option(WITH_F2PY_REPORT_COPY - "Add instructions to track f2py-copies on routine calls use -DF2PY_REPORT_ON_ARRAY_COPY= as well" FALSE)# -option(WITH_F2PY_REPORT_EXIT - "Report timings on routine exits" FALSE) -option(WITH_FORTRAN - "Whether to compile and ship fortran sources (default True)" TRUE) - +if( WITH_FORTRAN ) + set(F2PY_REPORT_ON_ARRAY_COPY 10 + CACHE STRING + "The minimum (element) size of arrays before warning about copies") + option(WITH_F2PY_REPORT_COPY + "Add instructions to track f2py-copies on routine calls use -DF2PY_REPORT_ON_ARRAY_COPY= as well" FALSE)# + option(WITH_F2PY_REPORT_EXIT + "Report timings on routine exits" FALSE) +endif() #option(WITH_COVERAGE # "Add instructions for coverage in Cython files" FALSE) @@ -87,6 +99,9 @@ if(WITH_FORTRAN) endif() set(ARCHFLAGS $ENV{ARCHFLAGS}) cmake_print_variables(ARCHFLAGS) +if( APPLE ) + cmake_print_variables(CMAKE_OSX_ARCHITECTURES) +endif() list(POP_BACK CMAKE_MESSAGE_INDENT) @@ -106,9 +121,6 @@ endif() # Decide for fortran stuff if(WITH_FORTRAN) - # add the language - enable_language(Fortran) - # Retrieve header information # Define f2py executable set(F2PY_EXECUTABLE "${PYTHON_EXECUTABLE}" -m numpy.f2py) diff --git a/pyproject.toml b/pyproject.toml index 10b671aad..5a3689555 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -313,6 +313,9 @@ archs = [ "x86_64", # "aarch64", ] +skip = [ + "*musllinux*", +] [tool.cibuildwheel.windows] archs = [