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

Gh actions upgrade #16

Merged
merged 10 commits into from
Nov 21, 2023
Merged
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

env:
CTEST_NO_TEST_ACTION: error
HOMEBREW_NO_INSTALL_CLEANUP: 1

on:
push:

jobs:
core:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install cmake mpich libmpich-dev liblapack-dev
- name: Install MacOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew update
brew install mpich2 lapack cmake
- name: Checkout code
uses: actions/checkout@v3
- name: Configure code
run: cmake -Bbuild
- name: Build code
run: cmake --build build --parallel
- name: Test code
run: ctest --test-dir build -V
37 changes: 3 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.12...3.20)
project(raptor)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)


enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Release)
Expand Down Expand Up @@ -47,7 +46,7 @@ if (WITH_MPI)
SET(MPIRUN mpirun)
endif (WITH_MPI)

include_directories("external")
#include_directories("external")
set(raptor_INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/raptor)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

Expand All @@ -67,7 +66,6 @@ if (CRAYXE)
set(CMAKE_AR "gcc-ar-4.7")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH true)

elseif (BGQ)
find_library(LAPACK_LIB NAMES liblapack lapack HINTS
"/soft/libraries/alcf/current/xl/LAPACK/lib")
Expand All @@ -85,7 +83,6 @@ elseif (BGQ)
"/soft/compilers/ibmcmp-may2016/xlf/bg/14.1/bglib64")
find_library(XLSMP_LIB NAMES libxlomp_ser.a xlomp_ser HINTS
"/soft/compilers/ibmcmp-may2016/xlsmp/bg/3.1/bglib64")

set(EXTERNAL_LIBS ${LAPACK_LIB} ${BLAS_LIB} ${ESSL_LIB} ${XLF_LIB}
${XLOPT_LIB} ${XLFMATH_LIB} ${XL_LIB} ${XLSMP_LIB})
else()
Expand All @@ -96,10 +93,9 @@ endif()

if (WITH_HOSTFILE)
find_file (FILE_OF_HOST, ${HOSTFILE})
set(HOST "--hostfile ${HOSTFILE}")
set(HOST "--hostfile" "${HOSTFILE}")
endif()


if (WITH_PTSCOTCH)
add_definitions ( -DUSING_PTSCOTCH )
find_package(Ptscotch)
Expand All @@ -122,7 +118,6 @@ if (WITH_PARMETIS)
endif(PARMETIS_FOUND)
endif(WITH_PARMETIS)


if(WITH_HYPRE)
add_definitions ( -DUSING_HYPRE )
find_package(Hypre)
Expand Down Expand Up @@ -190,32 +185,6 @@ if (WITH_AMPI)
add_definitions(-DUSE_AMPI)
endif(WITH_AMPI)

#/////////////////////////// star information of google test ///////////////////////////////
set(GOOGLETEST_ROOT external/googletest CACHE STRING "Google Test source root")
#MESSAGE( STATUS "GOOGLETEST_ROOT: " ${GOOGLETEST_ROOT} )

include_directories(
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/include
)

#MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )

set(GOOGLETEST_SOURCES
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest-all.cc
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest_main.cc
)


foreach(_source ${GOOGLETEST_SOURCES})
set_source_files_properties(${_source} PROPERTIES GENERATED 1)
#MESSAGE( STATUS "_source: " ${_source} )
endforeach()


add_library(googletest STATIC ${GOOGLETEST_SOURCES})
#///////////////////////////// end information of google test //////////////////////////////

add_subdirectory(raptor)

if (BUILD_EXAMPLES)
Expand Down
45 changes: 23 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,41 @@ RAPtor is a general, high performance algebraic multigrid solver.

# Build Instructions

1. Create a build directory
1. Configure the build

```bash
mkdir build
cmake -Bbuild [OPTIONS]
```
2. Configure the build

2. Build the RAPtor library
```bash
cd build
cmake [OPTIONS] ..
cmake --build build --parallel
```

3. Test RAPtor
```bash
make -j 4
ctest --test-dir build -V
```

Note: to test with a hostfile, `hostfile.txt`, use
```
cmake -Bbuild -DWITH_HOSTFILE=ON -DHOSTFILE=<full path to>/hostfile.txt
cmake --build build --parallel
ctest --test-dir build -V
```
Note: `make VERBOSE=1` if you want to see what flags are being used.

# Options
## Options

- `WITH_HYPRE`:
Includes hypre_wrapper in the build. Hypre must be installed before
building with this option. If not installed to /usr/local, set the
HYPRE_DIR option.
Includes `hypre_wrapper` in the build. Hypre must be installed before
building with this option. If not installed to `/usr/local`, set the
`HYPRE_DIR` option.

- `WITH_MFEM`:
Includes mfem_wrapper, mfem files, and hypre_wrapper in the build.
Includes `mfem_wrapper`, mfem files, and `hypre_wrapper` in the build.
Mfem, Metis, and Hypre must be installed before building with this
option. For any packages not installed to /usr/local, set the
directory option (<package>_DIR).
option. For any packages not installed to `/usr/local`, set the
directory option (`<package>_DIR`).

- `HYPRE_DIR`:
Sets the directory of hypre containing the include and lib folders
Expand All @@ -50,21 +57,15 @@ Note: `make VERBOSE=1` if you want to see what flags are being used.
Sets the directory of metis containing the include and libmetis folders

- `MFEM_DIR`:
Sets the directory of mfem containing mfem.h and libmfem
Sets the directory of mfem containing `mfem.h` and `libmfem`

# Unit Testing
## Unit Testing

The build system uses GoogleTest. The build searches
the source tree and adds any
test directory to `ctest`. For a simple example, see
`raptor/core/tests/ParVector.cpp`.

To test:

```bash
make test
```

# Citing

<pre>
Expand Down
19 changes: 10 additions & 9 deletions cmake/testing.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
if (ENABLE_UNIT_TESTS)
enable_testing()
#find_package(GTest QUIET)
#if (GTEST_FOUND)
# include_directories(${GTEST_INCLUDE_DIRS})
#else()
# add_subdirectory(${CMAKE_SOURCE_DIR}/external/gtest-1.7.0)
# include_directories(${CMAKE_SOURCE_DIR}/external/gtest-1.7.0/include)
# set(GTEST_BOTH_LIBRARIES gtest gtest_main)
#endif()
endif()

include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)
FetchContent_MakeAvailable(googletest)
add_library(googletest INTERFACE IMPORTED)
target_link_libraries(googletest INTERFACE gtest_main)
endif()

#function(add_unit target sources)
# set(mpimain_SRC ${CMAKE_SOURCE_DIR}/raptor/tests/mpi_main.cpp)
Expand Down
157 changes: 0 additions & 157 deletions external/googletest/CHANGES

This file was deleted.

Loading
Loading