From 3d7db4f879a15a55513240039268f7b57dd1bd0d Mon Sep 17 00:00:00 2001 From: HarshaRani Date: Wed, 9 Mar 2022 17:38:48 +0530 Subject: [PATCH 1/2] minimum gcc version is 5.X and hdf5 included in cmake as default --- CMakeLists.txt | 21 ++++++++++++++++++++- CheckCXXCompiler.cmake | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3ce946992..9e5b8004bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.3 FATAL_ERROR) +cmake_minimum_required(VERSION 4.9.3 FATAL_ERROR) # Project to build MOOSE's python module. project(PyMOOSE) @@ -105,6 +105,25 @@ if(WITH_BOOST OR WITH_BOOST_ODE) set(WITH_GSL OFF) endif() +find_package(HDF5 COMPONENTS CXX HL) + +if (NOT HDF5_FOUND) + message("==================================================================\n" + " HDF5 not found. Disabling NSDF support.\n\n" + " If you need NSDF support, please install hdf5-dev or hdf5-devel\n" + " package or equivalent.\n\n" + " $ sudo apt-get install libhdf5-dev \n" + " $ sudo yum install libhdf5-devel \n" + " $ brew install hdf5 \n\n" + " Otherwise, continue with 'make' and 'make install' \n" + " If you install hdf5 to non-standard path, export environment \n" + " variable HDF5_ROOT to the location. Rerun cmake \n" + "================================================================ \n" + ) +elseif(HDF5_FOUND) + set(WITH_NSDF ON) +endif() + ################################### TARGETS #################################### link_directories(${CMAKE_BINARY_DIR}) diff --git a/CheckCXXCompiler.cmake b/CheckCXXCompiler.cmake index f6661fa179..785946900c 100644 --- a/CheckCXXCompiler.cmake +++ b/CheckCXXCompiler.cmake @@ -20,8 +20,8 @@ add_definitions(-Wall ) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") - message(FATAL_ERROR "Insufficient gcc version. Minimum requried 4.9") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1") + message(FATAL_ERROR "Insufficient gcc version. Minimum requried 5.1") endif() add_definitions( -Wno-unused-local-typedefs ) add_definitions( -fmax-errors=5 ) From f7388989b5770ba92708c3411723aaa9bcd6fdde Mon Sep 17 00:00:00 2001 From: HarshaRani Date: Thu, 10 Mar 2022 14:32:51 +0530 Subject: [PATCH 2/2] CMake correction --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e5b8004bf..2b718ea7fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 4.9.3 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.3 FATAL_ERROR) # Project to build MOOSE's python module. project(PyMOOSE)