|
1 | | -<<<<<<< Conflict 1 of 1 |
2 | | -+++++++ Contents of side #1 |
3 | | -%%%%%%% Changes from base to side #2 |
4 | | - # Copyright 2019 United Kingdom Research and Innovation |
5 | | - # Copyright 2019 The University of Manchester |
6 | | - # |
7 | | - # Licensed under the Apache License, Version 2.0 (the "License"); |
8 | | - # you may not use this file except in compliance with the License. |
9 | | - # You may obtain a copy of the License at |
10 | | - # |
11 | | - # http://www.apache.org/licenses/LICENSE-2.0 |
12 | | - # |
13 | | - # Unless required by applicable law or agreed to in writing, software |
14 | | - # distributed under the License is distributed on an "AS IS" BASIS, |
15 | | - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | | - # See the License for the specific language governing permissions and |
17 | | - # limitations under the License. |
18 | | - # |
19 | | - # Authors: |
20 | | - # CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt |
21 | | - set (CMAKE_CXX_STANDARD 11) |
22 | | - set (CMAKE_CXX_STANDARD_REQUIRED ON) |
23 | | - if(NOT DEFINED CMAKE_BUILD_TYPE) |
24 | | - set(CMAKE_BUILD_TYPE RelWithDebInfo) |
25 | | - endif() |
26 | | - |
27 | | - message ("OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}") |
28 | | - find_package(OpenMP REQUIRED) |
29 | | - add_definitions(${OpenMP_CXX_FLAGS}) |
30 | | - |
31 | | - if (WIN32) |
32 | | - add_definitions("/Ddll_EXPORTS") |
33 | | - endif() |
34 | | -+find_package(IPP REQUIRED CONFIG) |
35 | | -+find_package(OpenMP REQUIRED) |
36 | | - |
37 | | - if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNUCC") |
38 | | - # appends some flags |
39 | | - add_compile_options(-ftree-vectorize -fopt-info-vec-optimized -fopt-info-vec) |
40 | | - # add_compile_options(-march=native -mavx ) |
41 | | - endif() |
42 | | - |
43 | | - message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") |
44 | | - message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}") |
45 | | - message("CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}") |
46 | | - message("CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS}") |
47 | | - |
48 | | - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0") |
49 | | - set (OpenMP_EXE_LINKER_FLAGS OpenMP::OpenMP_CXX) |
50 | | - else() |
51 | | - message(WARNING "Your CMake version is old. OpenMP linking flags might be incorrect.") |
52 | | - # need to explicitly set this. Definitely for gcc, hopefully also for other systems. |
53 | | - # See https://gitlab.kitware.com/cmake/cmake/issues/15392 |
54 | | - set (OpenMP_EXE_LINKER_FLAGS ${OpenMP_C_FLAGS}) |
55 | | - endif() |
56 | | - |
57 | | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
58 | | - find_package(IPP) |
59 | | - |
60 | | - list(APPEND cilacc_SOURCES utilities.cpp axpby.cpp FiniteDifferenceLibrary.cpp) |
61 | | - list(APPEND cilacc_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include) |
62 | | - list(APPEND cilacc_LIBRARIES ${OpenMP_EXE_LINKER_FLAGS}) |
63 | | - |
64 | | - if(IPP_FOUND) |
65 | | - list(APPEND cilacc_SOURCES FBP_filtering.cpp Binning.cpp) |
66 | | - list(APPEND cilacc_INCLUDES ${IPP_INCLUDE_DIRS}) |
67 | | - list(APPEND cilacc_LIBRARIES ${IPP_LIBRARIES}) |
68 | | - else() |
69 | | - message(WARNING "IPP libraries not found, FBP_filtering not in build") |
70 | | - endif() |
71 | | - |
72 | | - add_library(cilacc SHARED ${cilacc_SOURCES}) |
73 | | - target_link_libraries(cilacc ${cilacc_LIBRARIES}) |
74 | | - include_directories(cilacc PUBLIC ${cilacc_INCLUDES}) |
75 | | - |
76 | | - install(TARGETS cilacc |
77 | | - LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME}/lib |
78 | | - RUNTIME DESTINATION ${SKBUILD_PROJECT_NAME}/lib) |
79 | | - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ |
80 | | - DESTINATION ${SKBUILD_PROJECT_NAME}/include/${SKBUILD_PROJECT_NAME}) |
81 | | ->>>>>>> Conflict 1 of 1 ends |
| 1 | +# Copyright 2019 United Kingdom Research and Innovation |
| 2 | +# Copyright 2019 The University of Manchester |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +# Authors: |
| 17 | +# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt |
| 18 | +set (CMAKE_CXX_STANDARD 11) |
| 19 | +set (CMAKE_CXX_STANDARD_REQUIRED ON) |
| 20 | +if(NOT DEFINED CMAKE_BUILD_TYPE) |
| 21 | + set(CMAKE_BUILD_TYPE RelWithDebInfo) |
| 22 | +endif() |
| 23 | +find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED) |
| 24 | + |
| 25 | +find_package(nanobind CONFIG REQUIRED) |
| 26 | + |
| 27 | +find_package(IPP REQUIRED CONFIG) |
| 28 | +find_package(OpenMP REQUIRED) |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNUCC") |
| 33 | + # appends some flags |
| 34 | + add_compile_options(-ftree-vectorize -fopt-info-vec-optimized -fopt-info-vec) |
| 35 | + # add_compile_options(-march=native -mavx ) |
| 36 | +endif() |
| 37 | + |
| 38 | +message ("OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}") |
| 39 | +#add_definitions(${OpenMP_CXX_FLAGS}) |
| 40 | + |
| 41 | +message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") |
| 42 | +message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}") |
| 43 | +message("CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}") |
| 44 | +message("CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS}") |
| 45 | + |
| 46 | +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0") |
| 47 | + set (OpenMP_EXE_LINKER_FLAGS OpenMP::OpenMP_CXX) |
| 48 | +else() |
| 49 | + message(WARNING "Your CMake version is old. OpenMP linking flags might be incorrect.") |
| 50 | + # need to explicitly set this. Definitely for gcc, hopefully also for other systems. |
| 51 | + # See https://gitlab.kitware.com/cmake/cmake/issues/15392 |
| 52 | + set (OpenMP_EXE_LINKER_FLAGS ${OpenMP_C_FLAGS}) |
| 53 | +endif() |
| 54 | + |
| 55 | +list(APPEND cilacc_SOURCES utilities.cpp axpby.cpp FiniteDifferenceLibrary.cpp nanobind.cpp) |
| 56 | +list(APPEND cilacc_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 57 | +list(APPEND cilacc_LIBRARIES ${OpenMP_EXE_LINKER_FLAGS}) |
| 58 | + |
| 59 | +if(IPP_FOUND) |
| 60 | + list(APPEND cilacc_SOURCES FBP_filtering.cpp Binning.cpp) |
| 61 | + list(APPEND cilacc_INCLUDES ${IPP_INCLUDE_DIRS}) |
| 62 | + list(APPEND cilacc_LIBRARIES ${IPP_LIBRARIES}) |
| 63 | + message(STATUS "IPP Libraries Found") |
| 64 | +else() |
| 65 | + message(WARNING "IPP libraries not found, FBP_filtering not in build") |
| 66 | +endif() |
| 67 | +message(STATUS ${cilacc_INCLUDES}) |
| 68 | +message(STATUS ${IPP_LIBRARIES}) |
| 69 | + |
| 70 | +nanobind_add_module( |
| 71 | + cilacc |
| 72 | + NB_STATIC |
| 73 | + ${cilacc_SOURCES} |
| 74 | +) |
| 75 | +include_directories(cilacc PUBLIC ${cilacc_INCLUDES}) |
| 76 | +target_link_libraries(cilacc PUBLIC ${cilacc_LIBRARIES}) |
| 77 | + |
| 78 | +install(TARGETS cilacc LIBRARY DESTINATION cil) |
0 commit comments