switched to meson, let's see if it's gonna bite me
This commit is contained in:
@@ -1,19 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
project(fedavg_mpi)
|
|
||||||
|
|
||||||
find_package(MPI REQUIRED)
|
|
||||||
find_package(Python3 COMPONENTS Development NumPy)
|
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} main.c cythoned/library.c)
|
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${Python3_INCLUDE_DIRS})
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${Python3_NumPy_INCLUDE_DIRS})
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} ${Python3_LIBRARIES})
|
|
||||||
target_link_libraries(${PROJECT_NAME} ${MPI_C_LIBRARIES})
|
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -g -std=c99)
|
|
||||||
add_compile_definitions(NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
|
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
|
||||||
17
meson.build
Normal file
17
meson.build
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
project('fedavg_mpi', 'c')
|
||||||
|
add_project_arguments(
|
||||||
|
'-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION',
|
||||||
|
language: 'c'
|
||||||
|
)
|
||||||
|
|
||||||
|
mpi = dependency('mpi')
|
||||||
|
python = dependency('python3')
|
||||||
|
numpy_header = include_directories(run_command(
|
||||||
|
'python3', '-c', 'import numpy;print(numpy.get_include())'
|
||||||
|
).stdout().strip())
|
||||||
|
|
||||||
|
executable(
|
||||||
|
'fedavg_mpi', 'main.c', 'cythoned/library.c',
|
||||||
|
dependencies: [mpi, python],
|
||||||
|
include_directories: numpy_header
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user