-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
file attributes; cmake files updates
Possible names for PETSC & SLEPC libraries first workflow error for petsc and slepc replacement libopenblas ready workflows for ubuntu-latest default paths parallel make Enhanced build instructions correction for petsc name cache test mpi for aarch64 architecture cleaning merge garbage lowercase message no default path problem update cmake and docker overrideable paths simplify include/src simplify SLEPC is required delete shared lib by default rm makefile make metis optional update readme fixes path search for slepc Better openblas search and flags whoops fix actions + slepc Use different header
- Loading branch information
Showing
409 changed files
with
20,138 additions
and
6,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Sparselizard Compilation | ||
|
||
on: [push] | ||
|
||
jobs: | ||
Compilation-Actions: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CCACHE_COMPRESS: "true" | ||
CCACHE_MAXSIZE: 500M | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- run: echo "The ${{ github.repository }} repository has been cloned to the runner." | ||
- run: echo "The workflow is now ready to test the code on the runner." | ||
|
||
- name: install ccache | ||
run: sudo apt-get install ccache | ||
|
||
- name: identify machine architecture | ||
run: | | ||
gcc -### -E -march=native - &> machine-type.txt | ||
cat machine-type.txt | ||
- name: restore cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.ccache | ||
key: ccache-${{ hashFiles('machine-type.txt') }}-${{ github.sha }} | ||
restore-keys: ccache-${{ hashFiles('machine-type.txt') }}- | ||
|
||
- name: Install mandatory packages | ||
run: sudo apt-get install -y libomp-dev ninja-build cmake libopenblas-dev libmetis-dev libopenmpi-dev libmumps-dev petsc-dev slepc-dev libgmsh-dev | ||
|
||
- name: build | ||
run: | | ||
export PATH="/usr/lib/ccache:$PATH" | ||
mkdir build | ||
cmake -G Ninja -S . -B build | ||
cmake --build build -- -j $(getconf NPROCESSORS_ONLN) | ||
- name: show ccache stats | ||
run: | | ||
ccache --show-stats | ||
ccache --zero-stats | ||
- run: echo "🍏 This job's status is ${{ job.status }}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ build/ | |
|
||
# CCLS cache | ||
.ccls-cache/ | ||
machine-type.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,79 @@ | ||
# Thanks to S. Matsievskiy for bringing cmake to the project. | ||
|
||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) | ||
cmake_minimum_required(VERSION 3.23 FATAL_ERROR) | ||
|
||
project(Sparselizard LANGUAGES CXX) | ||
|
||
set(DEFAULT_BUILD_TYPE "Release") | ||
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build" FORCE) | ||
|
||
set(PETSC_PATH "~/SLlibs/petsc" CACHE STRING "Provide the path to the petsc folder") | ||
set(GMSH_PATH "~/SLlibs/gmsh" CACHE STRING "Provide the path to the gmsh folder") | ||
set(MPI_PATH "" CACHE STRING "Provide the path to the mpi folder") | ||
|
||
# Place library in build folder: | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
SET(CMAKE_CXX_STANDARD 17) | ||
SET(BUILD_MODE Debug) | ||
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic") | ||
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Og") | ||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3") | ||
set(BLA_VENDOR OpenBLAS) | ||
|
||
# Default flags: | ||
set(BLAS_FOUND NO) | ||
set(GMSH_FOUND NO) | ||
set(METIS_FOUND NO) | ||
set(MPI_FOUND NO) | ||
set(MUMPS_FOUND NO) | ||
set(PETSC_FOUND NO) | ||
set(SLEPC_FOUND NO) | ||
|
||
# Add cmake packages | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
list(PREPEND CMAKE_PREFIX_PATH /opt/homebrew/opt/openblas) | ||
# Installation definitions | ||
include(GNUInstallDirs) | ||
# Aux functions | ||
include(cMake/functions.cmake) | ||
include(cMake/SetupBLAS.cmake) | ||
include(cMake/SetupGMSH.cmake) | ||
include(cMake/SetupMETIS.cmake) | ||
include(cMake/SetupMPI.cmake) | ||
include(cMake/SetupMUMPS.cmake) | ||
include(cMake/SetupPETSC.cmake) | ||
include(cMake/SetupSLEPC.cmake) | ||
|
||
# Add libsparselizard target | ||
add_subdirectory(src) | ||
|
||
# Add simulations targets | ||
add_subdirectory(simulations) | ||
|
||
# this is not the cmake-official way but it's a lot easier | ||
file(GLOB_RECURSE SRC_FILES "src/*.cpp") | ||
add_library(sparselizard SHARED ${SRC_FILES}) | ||
|
||
target_include_directories(sparselizard PUBLIC include) | ||
|
||
target_compile_options(sparselizard PUBLIC -fPIC -O3) | ||
|
||
find_package(OpenMP REQUIRED) | ||
target_link_libraries(sparselizard PUBLIC OpenMP::OpenMP_CXX) | ||
|
||
find_package(MPI REQUIRED) | ||
target_link_libraries(sparselizard PUBLIC MPI::MPI_CXX) | ||
|
||
find_package(BLAS REQUIRED) | ||
target_link_libraries(sparselizard PUBLIC BLAS::BLAS) | ||
|
||
find_package(PETSC REQUIRED) | ||
target_link_libraries(sparselizard PUBLIC PETSC::PETSC) | ||
|
||
find_package(SLEPC REQUIRED) | ||
target_link_libraries(sparselizard PUBLIC SLEPC::SLEPC) | ||
|
||
find_package(GMSH) | ||
|
||
if(GMSH_FOUND) | ||
target_link_libraries(sparselizard PUBLIC GMSH::GMSH) | ||
target_compile_definitions(sparselizard PRIVATE -DHAVE_GMSH) | ||
endif() | ||
|
||
find_package(METIS) | ||
|
||
if(METIS_FOUND) | ||
target_link_libraries(sparselizard PUBLIC METIS::METIS) | ||
target_compile_definitions(sparselizard PRIVATE -DHAVE_METIS) | ||
endif() | ||
|
||
target_link_libraries(sparselizard PUBLIC cmumps) | ||
target_compile_definitions(sparselizard PRIVATE | ||
-DHAVE_BLAS | ||
-DHAVE_MPI | ||
-DHAVE_MUMPS | ||
-DHAVE_PETSC | ||
-DHAVE_SLEPC | ||
) | ||
|
||
install(TARGETS sparselizard LIBRARY PUBLIC_HEADER) | ||
|
||
set(BUILD_SIMULATIONS YES) | ||
|
||
if(BUILD_SIMULATIONS) | ||
add_subdirectory(simulations) | ||
message(STATUS "Building simulations") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
FROM debian:testing-slim as build | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL version="0.2" | ||
LABEL description="Sparselizard on docker. See https://github.com/pthibaud/dockerlizard" | ||
|
||
# Disable prompt during packages installation | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update ubuntu software repository | ||
# Install additional repository | ||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get -y dist-upgrade && \ | ||
apt-get install -y apt-utils build-essential git cmake clang \ | ||
libopenblas-dev \ | ||
libopenmpi-dev \ | ||
libmumps-dev \ | ||
libmetis-dev \ | ||
petsc-dev \ | ||
slepc-dev \ | ||
libgmsh-dev \ | ||
libomp-dev \ | ||
ninja-build | ||
|
||
# Clean the installation | ||
RUN apt-get clean | ||
|
||
|
||
# Clone git sparselizard repository | ||
# RUN git clone https://github.com/araven/sparselizard.git | ||
WORKDIR /sparselizard | ||
COPY CMakeLists.txt . | ||
COPY src src | ||
COPY cmake cmake | ||
COPY include include | ||
COPY simulations simulations | ||
RUN mkdir build | ||
# Prepare compilation environment | ||
RUN CXX=clang++ cmake -G Ninja -S . -B build | ||
RUN cmake --build build -- -j 8 | ||
|
||
RUN mkdir -p /usr/local | ||
RUN cmake --install build -v --prefix /usr/local | ||
|
||
# Install the library and headers; Put the env variables | ||
# RUN make install | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib | ||
ENV OMPI_CXX=clang++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.