Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github ci #33

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Unset CC and CXX
run: |
test -n $CC && unset CC
test -n $CXX && unset CXX

- name: Install deps
run: |
sudo apt-get update
sudo apt-get install cmake mpich liblapack-dev libboost-filesystem-dev libboost-system-dev python3 clang
sudo pip install numpy pyamg
- name: build Cedar setup
run: |
mkdir build
cd build
cmake -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ ..
- name: make and test Cedar
run: |
cd build
make && make test
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.19)
project(cedar VERSION 0.1.0 LANGUAGES CXX C Fortran)

set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(MPI_LANGUAGE C Fortran)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -57,7 +58,7 @@ FIND_PACKAGE(Boost 1.44 REQUIRED COMPONENTS system filesystem)
FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(LAPACK REQUIRED)

find_package(MPI REQUIRED)
find_package(MPI COMPONENTS C Fortran REQUIRED)

if (ENABLE_PLANE_AGG)
find_package(Argobots REQUIRED)
Expand All @@ -82,9 +83,8 @@ target_link_libraries(cedar PUBLIC
${Boost_LIBRARIES}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
${MPI_C_LIBRARIES}
${MPI_CXX_LIBRARIES}
${MPI_Fortran_LIBRARIES})
PUBLIC MPI::MPI_C
MPI::MPI_Fortran)
include_directories(${json_location})
include_directories(${tausch_location})
target_compile_definitions(cedar PUBLIC WITH_TAUSCH)
Expand Down Expand Up @@ -136,8 +136,7 @@ if(ENABLE_EXAMPLES)
endif()

if(ENABLE_UNIT_TESTS)
find_package(PythonLibs REQUIRED)
find_package(NumPy REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development NumPy)
message(STATUS ${PYTHON_INCLUDE_DIR})
list(APPEND cedar-deps ${PYTHON_LIBRARY})
include_directories(${PYTHON_INCLUDE_DIR} ${PYTHON_NUMPY_INCLUDE_DIR})
Expand Down