From 247ba952c8311138c94161e841c2751b983ed413 Mon Sep 17 00:00:00 2001 From: Ivan Pribec Date: Fri, 12 May 2023 00:36:37 +0200 Subject: [PATCH 1/2] Add missing return statement --- vx2refine/parallel/mpivx2refine.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/vx2refine/parallel/mpivx2refine.cc b/vx2refine/parallel/mpivx2refine.cc index 32ed015..ae437d7 100644 --- a/vx2refine/parallel/mpivx2refine.cc +++ b/vx2refine/parallel/mpivx2refine.cc @@ -225,6 +225,7 @@ int vx2refine(char *fname_vx, char *fnameRef_vx, uint64_t bsize, MPI_Comm comm) free(record); free(refined); + return 0; } int main(int argc, char **argv) From db8ba4e79bcbce1dcccfb95838f1ca7cfacc178b Mon Sep 17 00:00:00 2001 From: Ivan Pribec Date: Fri, 12 May 2023 01:57:23 +0200 Subject: [PATCH 2/2] Add CMake build with automatic dependency resolution --- CMakeLists.txt | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..af3f053 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,87 @@ +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + +# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + cmake_policy(SET CMP0135 NEW) +endif() + +project(HemePure_Tools VERSION 0.1.0 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) + +find_package(ZLIB REQUIRED) +find_package(MPI) + +add_executable(gmy2gmy+ gmy2gmy+/gmy2gmy+.cc) +target_link_libraries(gmy2gmy+ ZLIB::ZLIB) + +add_executable(gmy2lets gmy2inlets/gmy2lets.cc) +target_link_libraries(gmy2lets PRIVATE ZLIB::ZLIB) +target_include_directories(gmy2lets PRIVATE ZLIB::ZLIB) + +add_executable(vx2ascii vx2ascii/vx2ascii.cc) + +if (MPI_FOUND) + add_executable(mpivx2gmy vx2gmy/mpivx2gmy.cc) + target_include_directories(mpivx2gmy PRIVATE ${MPI_CXX_INCLUDE_DIRS}) + target_link_libraries(mpivx2gmy PRIVATE MPI::MPI_CXX) + target_link_libraries(mpivx2gmy PRIVATE ZLIB::ZLIB) +endif() + +add_executable(vx2paraview vx2paraview/vx2paraview.cc) + +add_executable(vx2refine vx2refine/vx2refine.cc) +target_compile_definitions(vx2refine + PUBLIC LARGEFILE_SOURCE=1 FILE_OFFSET_BITS=64 +) + +if (MPI_FOUND) + add_executable(mpivx2refine vx2refine/parallel/mpivx2refine.cc) + target_compile_definitions(mpivx2refine + PUBLIC LARGEFILE_SOURCE=1 FILE_OFFSET_BITS=64 + ) + target_include_directories(mpivx2refine PRIVATE MPI::MPI_CXX) + target_link_libraries(mpivx2refine PRIVATE MPI::MPI_CXX) + target_link_libraries(mpivx2refine PRIVATE ZLIB::ZLIB) +endif() + +option(BUILD_VOXELIZER "Build the Palabos-based voxelizer" OFF) + +if (BUILD_VOXELIZER) + + include(FetchContent) + FetchContent_Declare( + palabos + URL https://gitlab.com/unigespc/palabos/-/archive/v2.3.0/palabos-v2.3.0.tar.gz + URL_HASH SHA256=2085de7b06cc9c4a7b3457f7c2d17747d8960c0f861e32fc883acd504dfc1e23 + ) + # Only the palabos headers appear to be needed! + FetchContent_Populate(palabos) + + #add_library(tinyxml + # ${palabos_SOURCE_DIR}/externalLibraries/tinyxml/tinyxml.cpp + # ${palabos_SOURCE_DIR}/externalLibraries/tinyxml/tinyxmlerror.cpp + # ${palabos_SOURCE_DIR}/externalLibraries/tinyxml/tinyxmlparser.cpp + #) + #target_include_directories(tinyxml PUBLIC + # ${palabos_SOURCE_DIR}/externalLibraries/tinyxml) + + add_executable(voxelizer voxelizer/source/voxelizer_MultiInput.cpp) + target_include_directories(voxelizer + PRIVATE ${palabos_SOURCE_DIR}/src + PRIVATE ${palabos_SOURCE_DIR}/externalLibraries) + +endif() + +# +# Installation +# +install(TARGETS gmy2gmy+ gmy2lets vx2ascii vx2paraview vx2refine RUNTIME) + +if(MPI_FOUND) + install(TARGETS mpivx2gmy mpivx2refine RUNTIME) +endif() + +if(BUILD_VOXELIZER) + install(TARGETS voxelizer RUNTIME) +endif() \ No newline at end of file