From dacc71882f184072344c2b56390cb24b81c023b7 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 10:30:40 -0500 Subject: [PATCH 01/10] touch github ci --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c68a5ac --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +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: Report + run: echo running... From d132013d9e838644810364d97001bba49f1f1997 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:06:58 -0500 Subject: [PATCH 02/10] add build/test --- .github/workflows/ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c68a5ac..ea84b71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,5 +14,20 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Report - run: echo running... + - 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 cmake3 mpich2 liblapack-dev libboost-filesystem-dev libboost-system-dev python-numpy clang + sudo pip install 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: make && make test From b7057b2f3541df904a3d74ca9d7c2367f88a2991 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:12:34 -0500 Subject: [PATCH 03/10] fix apt install --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea84b71..bb9481f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install cmake3 mpich2 liblapack-dev libboost-filesystem-dev libboost-system-dev python-numpy clang - sudo pip install pyamg + sudo apt-get install cmake mpich liblapack-dev libboost-filesystem-dev libboost-system-dev python clang + sudo pip install numpy pyamg - name: build Cedar setup run: | mkdir build From f4086c8c9ec72a84d51b496e02a94d0bddd77b97 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:13:57 -0500 Subject: [PATCH 04/10] force python3 in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb9481f..a131a77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install cmake mpich liblapack-dev libboost-filesystem-dev libboost-system-dev python clang + 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: | From f17bd6c1270e1307727da7879f950d151c10aff6 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:25:56 -0500 Subject: [PATCH 05/10] add debug --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a131a77..7e73516 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,6 @@ jobs: run: | mkdir build cd build - cmake -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. + cmake --debug-find -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. - name: make and test Cedar run: make && make test From e970d2689540ac001e21c7155b3c65d637b8e542 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:47:06 -0500 Subject: [PATCH 06/10] debug MPI find --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e73516..9652e9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,9 @@ jobs: sudo pip install numpy pyamg - name: build Cedar setup run: | + mpirun -version mkdir build cd build - cmake --debug-find -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. + cmake -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. - name: make and test Cedar run: make && make test From 984475446afa39b0a48687215a2483e2d725a04c Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 12:58:05 -0500 Subject: [PATCH 07/10] update MPI targets --- .github/workflows/ci.yml | 1 - CMakeLists.txt | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9652e9c..a131a77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: sudo pip install numpy pyamg - name: build Cedar setup run: | - mpirun -version mkdir build cd build cmake -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2a39e..9a548b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ 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) @@ -59,6 +60,8 @@ FIND_PACKAGE(LAPACK REQUIRED) find_package(MPI REQUIRED) +find_package(MPI COMPONENTS C Fortran REQUIRED) + if (ENABLE_PLANE_AGG) find_package(Argobots REQUIRED) endif() @@ -82,9 +85,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) From 6bb022d9a36e2539d1ac07a3d2b84f0610ff9dbc Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 13:01:54 -0500 Subject: [PATCH 08/10] remove general find_package --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a548b5..476c219 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,6 @@ 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) From 45518b192f5efca3f36590bf29b04c0d8f6f40f9 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 21:49:50 -0500 Subject: [PATCH 09/10] add find Python3 --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 476c219..208812a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -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) @@ -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}) From 1a922b081e5358989e8bfe9e997dd3805693dcf6 Mon Sep 17 00:00:00 2001 From: Luke Olson Date: Tue, 3 Oct 2023 22:11:43 -0500 Subject: [PATCH 10/10] change dir to build --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a131a77..7111081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,4 +30,6 @@ jobs: cd build cmake -DENABLE_UNIT_TESTS=yes -DCMAKE_CXX_COMPILER=clang++ .. - name: make and test Cedar - run: make && make test + run: | + cd build + make && make test