Skip to content

Commit 65955e0

Browse files
committed
update compilation
1 parent 6073866 commit 65955e0

8 files changed

Lines changed: 115 additions & 62 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: check-merge-conflict
66
- id: end-of-file-fixer
77
- id: mixed-line-ending
8-
- id: check-yaml
8+
# - id: check-yaml
99
- id: check-toml
1010
- id: detect-private-key
1111
- id: check-json

CMakeLists.txt

Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1+
# --------------------- CMake configuration --------------------
12
cmake_minimum_required(VERSION 3.20)
23
set(CMAKE_OSX_DEPLOYMENT_TARGET "15.0" CACHE STRING "Minimum OS X deployment version")
3-
project(SuPyMode VERSION "${SUPYMODE_VERSION}" LANGUAGES CXX)
4+
project(SuPyMode LANGUAGES CXX)
45

56
# CMake settings
67
set(CMAKE_VERBOSE_MAKEFILE ON)
7-
set(CMAKE_CXX_STANDARD 17)
8+
set(CMAKE_CXX_STANDARD 20)
89
set(CMAKE_CXX_STANDARD_REQUIRED ON)
910
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1011
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Type of build")
12+
# --------------------- CMake configuration --------------------
1113

12-
# Set the output directory for libraries
14+
15+
# --------------------- Set the output directory for libraries --------------------
1316
set(LOCAL_CXX_DIR "${PROJECT_NAME}/cpp")
1417
set(LOCAL_BIN_DIR "${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/binary")
18+
include_directories(${NAME} ${LOCAL_CXX_DIR})
19+
# --------------------- Set the output directory for libraries --------------------
1520

16-
# Find dependencies
21+
# --------------------- Platform-specific compiler and linker options --------------------
1722
if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
1823
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp" CACHE STRING "")
1924
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "")
@@ -23,10 +28,6 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
2328
endif()
2429
endif()
2530

26-
find_package(OpenMP REQUIRED)
27-
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
28-
find_package(pybind11 CONFIG REQUIRED)
29-
3031
# Platform-specific settings for static linking
3132
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
3233
message("MinGW detected on Windows")
@@ -35,17 +36,74 @@ if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
3536
add_link_options(-static -fopenmp -Wl,--whole-archive -lgomp -Wl,--no-whole-archive)
3637
endif()
3738

38-
# Compiler and linker options
39-
add_compile_options(-Wall -Wextra -pedantic-errors)
39+
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
40+
add_compile_options(/W4 /permissive- /Zc:preprocessor)
41+
else()
42+
add_compile_options(-Wall -Wextra -pedantic-errors -Wno-unused-parameter)
43+
endif()
44+
# --------------------- Platform-specific compiler and linker options --------------------
45+
46+
# --------------------- Find dependencies and compile options --------------------
47+
find_package(OpenMP REQUIRED)
48+
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
49+
find_package(pybind11 CONFIG REQUIRED)
50+
# --------------------- Find dependencies and compile options --------------------
51+
52+
# ----------------- logging build configuration --------------------
53+
message(STATUS "")
54+
message(STATUS "==================== Build configuration ====================")
55+
56+
message(STATUS "Compiler information")
57+
message(STATUS " C compiler : ${CMAKE_C_COMPILER}")
58+
message(STATUS " C compiler ID : ${CMAKE_C_COMPILER_ID}")
59+
message(STATUS " C compiler version : ${CMAKE_C_COMPILER_VERSION}")
60+
61+
message(STATUS " CXX compiler : ${CMAKE_CXX_COMPILER}")
62+
message(STATUS " CXX compiler ID : ${CMAKE_CXX_COMPILER_ID}")
63+
message(STATUS " CXX compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
64+
65+
message(STATUS " Fortran compiler : ${CMAKE_Fortran_COMPILER}")
66+
message(STATUS " Fortran ID : ${CMAKE_Fortran_COMPILER_ID}")
67+
message(STATUS " Fortran version : ${CMAKE_Fortran_COMPILER_VERSION}")
68+
69+
message(STATUS "")
70+
message(STATUS "OpenMP configuration")
71+
message(STATUS " OpenMP flags : ${OpenMP_CXX_FLAGS}")
72+
message(STATUS " OpenMP detected : ${OpenMP_FOUND}")
73+
message(STATUS " OpenMP version : ${OpenMP_CXX_VERSION}")
4074

41-
# Print some messages
42-
message(STATUS "OPENMP flags: ${OpenMP_CXX_FLAGS}")
43-
message(STATUS "SuPyMode version is: ${SUPYMODE_VERSION}")
44-
message(STATUS "SuPyMode includes directory is: ${SUPYMODE_CXX_DIR}")
45-
message(STATUS "Python version to be compiled against: ${PYBIND11_PYTHON_VERSION}")
46-
message(STATUS "Binary will be installed in location: ${LOCAL_BIN_DIR}")
75+
message(STATUS "")
76+
message(STATUS "Python configuration")
77+
message(STATUS " Python executable : ${Python_EXECUTABLE}")
78+
message(STATUS " Python version : ${PYBIND11_PYTHON_VERSION}")
79+
message(STATUS " Python include dir : ${Python_INCLUDE_DIRS}")
80+
message(STATUS " Python site packages : ${Python_SITELIB}")
4781

82+
message(STATUS "")
83+
message(STATUS "SuPyMode integration")
84+
message(STATUS " SuPyMode version : ${SUPYMODE_VERSION}")
85+
message(STATUS " SuPyMode include dir : ${LOCAL_CXX_DIR}")
86+
87+
message(STATUS "")
88+
message(STATUS "Install destination")
89+
message(STATUS " Binary output path : ${LOCAL_BIN_DIR}")
90+
91+
message(STATUS "==============================================================")
92+
message(STATUS "")
93+
# ----------------- logging build configuration --------------------
94+
95+
# ----------------- collect subdirectories --------------------
4896
add_subdirectory(SuPyMode/cpp/mesh) # mesh
4997
add_subdirectory(SuPyMode/cpp/model_parameters) # model_parameters
5098
add_subdirectory(SuPyMode/cpp/supermode) # supermode
5199
add_subdirectory(SuPyMode/cpp/eigensolver) # eigen_solver
100+
# ----------------- collect subdirectories --------------------
101+
102+
get_property(SUPYMODE_TARGETS GLOBAL PROPERTY SUPYMODE_TARGETS)
103+
104+
install(
105+
TARGETS ${SUPYMODE_TARGETS}
106+
LIBRARY DESTINATION ${LOCAL_BIN_DIR}
107+
ARCHIVE DESTINATION ${LOCAL_BIN_DIR}
108+
RUNTIME DESTINATION ${LOCAL_BIN_DIR}
109+
)

SuPyMode/_version.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1-
# file generated by setuptools_scm
1+
# file generated by setuptools-scm
22
# don't change, don't track in version control
3+
4+
__all__ = [
5+
"__version__",
6+
"__version_tuple__",
7+
"version",
8+
"version_tuple",
9+
"__commit_id__",
10+
"commit_id",
11+
]
12+
313
TYPE_CHECKING = False
414
if TYPE_CHECKING:
5-
from typing import Tuple, Union
15+
from typing import Tuple
16+
from typing import Union
17+
618
VERSION_TUPLE = Tuple[Union[int, str], ...]
19+
COMMIT_ID = Union[str, None]
720
else:
821
VERSION_TUPLE = object
22+
COMMIT_ID = object
923

1024
version: str
1125
__version__: str
1226
__version_tuple__: VERSION_TUPLE
1327
version_tuple: VERSION_TUPLE
28+
commit_id: COMMIT_ID
29+
__commit_id__: COMMIT_ID
30+
31+
__version__ = version = "2.1.6"
32+
__version_tuple__ = version_tuple = (2, 1, 6)
1433

15-
__version__ = version = '2.0.4'
16-
__version_tuple__ = version_tuple = (2, 0, 4)
34+
__commit_id__ = commit_id = "g60738663d"

SuPyMode/cpp/eigensolver/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,4 @@ pybind11_add_module("interface_${NAME}" MODULE interface.cpp)
1414
set_target_properties("interface_${NAME}" PROPERTIES OUTPUT_NAME "interface_${NAME}")
1515
target_link_libraries("interface_${NAME}" PRIVATE "${NAME}")
1616

17-
18-
install(
19-
TARGETS ${NAME} interface_${NAME}
20-
LIBRARY DESTINATION ${LOCAL_BIN_DIR}
21-
ARCHIVE DESTINATION ${LOCAL_BIN_DIR}
22-
RUNTIME DESTINATION ${LOCAL_BIN_DIR}
23-
)
17+
set_property(GLOBAL APPEND PROPERTY SUPYMODE_TARGETS "${NAME}" "interface_${NAME}")

SuPyMode/cpp/mesh/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,4 @@ pybind11_add_module("interface_${NAME}" MODULE interface.cpp)
1414
set_target_properties("interface_${NAME}" PROPERTIES OUTPUT_NAME "interface_${NAME}")
1515
target_link_libraries("interface_${NAME}" PRIVATE "${NAME}")
1616

17-
18-
install(
19-
TARGETS ${NAME} interface_${NAME}
20-
LIBRARY DESTINATION ${LOCAL_BIN_DIR}
21-
ARCHIVE DESTINATION ${LOCAL_BIN_DIR}
22-
RUNTIME DESTINATION ${LOCAL_BIN_DIR}
23-
)
17+
set_property(GLOBAL APPEND PROPERTY SUPYMODE_TARGETS "${NAME}" "interface_${NAME}")

SuPyMode/cpp/model_parameters/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,4 @@ pybind11_add_module("interface_${NAME}" MODULE interface.cpp)
1313
set_target_properties("interface_${NAME}" PROPERTIES OUTPUT_NAME "interface_${NAME}")
1414
target_link_libraries("interface_${NAME}" PRIVATE "${NAME}")
1515

16-
17-
install(
18-
TARGETS ${NAME} interface_${NAME}
19-
LIBRARY DESTINATION ${LOCAL_BIN_DIR}
20-
ARCHIVE DESTINATION ${LOCAL_BIN_DIR}
21-
RUNTIME DESTINATION ${LOCAL_BIN_DIR}
22-
)
16+
set_property(GLOBAL APPEND PROPERTY SUPYMODE_TARGETS "${NAME}" "interface_${NAME}")

SuPyMode/cpp/supermode/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,4 @@ pybind11_add_module("interface_${NAME}" MODULE interface.cpp)
1414
set_target_properties("interface_${NAME}" PROPERTIES OUTPUT_NAME "interface_${NAME}")
1515
target_link_libraries("interface_${NAME}" PRIVATE "${NAME}")
1616

17-
18-
install(
19-
TARGETS ${NAME} interface_${NAME}
20-
LIBRARY DESTINATION ${LOCAL_BIN_DIR}
21-
ARCHIVE DESTINATION ${LOCAL_BIN_DIR}
22-
RUNTIME DESTINATION ${LOCAL_BIN_DIR}
23-
)
17+
set_property(GLOBAL APPEND PROPERTY SUPYMODE_TARGETS "${NAME}" "interface_${NAME}")

meta.yaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ source:
66
git_url: https://github.com/MartinPdeS/SuPyMode.git
77

88
build:
9-
script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
109
number: 0
10+
script:
11+
- export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" # [osx]
12+
- {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
1113

1214
requirements:
13-
host:
14-
- {{ compiler('c') }}
15+
build:
1516
- {{ compiler('cxx') }}
17+
- llvm-openmp # [osx]
18+
host:
1619
- python {{ PY_VER }}*
20+
- python_abi 3.13.* *_cp313 # [py==313]
1721
- scikit-build-core ~=0.3
1822
- pybind11 ~=2.13
1923
- python-build ~=1.2
2024
- setuptools_scm[toml] ~=8.0
21-
- llvm-openmp
25+
- numpy >=2.0,<3
2226
run:
23-
- python {{PY_VER}}*
2427
- martinpdes::pyoptik
2528
- martinpdes::mpsplots
2629
- martinpdes::fiberfusing
2730
- martinpdes::pyfibermodes
2831
- martinpdes::pyfinitdiff
29-
- numpy >=2.2
32+
- numpy >=2.0,<3
3033
- pyvista
3134
- scipy
3235
- pydantic
3336
- tabulate
3437
- pathvalidate
35-
- llvm-openmp
36-
37-
3838

3939
about:
4040
home: https://github.com/MartinPdeS/SuPyMode
@@ -61,16 +61,17 @@ test:
6161
imports:
6262
- SuPyMode
6363
requires:
64-
- python {{PY_VER}}*
64+
- python {{ PY_VER }}*
65+
- python_abi 3.13.* *_cp313 # [py==313]
6566
- pytest >=0.6
6667
- pytest-cov >=2.0
67-
- pytest-json-report ~=1.5.0
68-
- coverage ~=7.6.1
68+
- pytest-json-report ==1.5
69+
- coverage ==7.6
6970
commands:
7071
- python -m pytest
7172
source_files:
7273
- tests
7374

7475
extra:
7576
recipe-maintainers:
76-
- MartinPdeS
77+
- MartinPdeS

0 commit comments

Comments
 (0)