From c11690e75c4ea655f8e914813d4396a87ae661fc Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Wed, 20 Dec 2023 15:04:48 -0800 Subject: [PATCH] proper importing of yaml-cpp. simplifying the installation for yaml-cpp. --- CMakeLists.txt | 8 ++++---- docker/Dockerfile | 6 +++--- include/input_parser.hpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2093779..63ffa817 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,8 +84,9 @@ find_path(PARMETIS_INCLUDES metis.h "$ENV{PARMETIS_DIR}/metis/include") find_path(MUMPS_INCLUDES dmumps_c.h "$ENV{MUMPS_DIR}/include") # yaml-cpp library -find_library(YAML yaml-cpp HINTS "$ENV{YAML_DIR}/lib") -find_path(YAML_INCLUDES yaml.h HINTS "$ENV{YAML_DIR}/include/yaml-cpp") +find_package(yaml-cpp REQUIRED) +# find_library(YAML yaml-cpp HINTS "$ENV{YAML_DIR}/lib") +# find_path(YAML_INCLUDES yaml.h HINTS "$ENV{YAML_DIR}/include/yaml-cpp") # libROM find_library(LIBROM libROM.so HINTS "$ENV{LIBROM_DIR}/build/lib") @@ -100,7 +101,6 @@ include_directories( ${HDF5_C_INCLUDE_DIRS} ${MPI_C_INCLUDE_DIRS} ${MFEM_C_INCLUDE_DIRS} - ${YAML_INCLUDES} ${LIBROM_INCLUDES} ) link_libraries( @@ -118,7 +118,7 @@ link_libraries( ${PARMETIS} ${METIS} ${MUMPS} - ${YAML} + yaml-cpp::yaml-cpp GTest::GTest ${LIBROM} ) diff --git a/docker/Dockerfile b/docker/Dockerfile index 43d54944..cd55c901 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,9 +39,9 @@ ENV MFEM_INCLUDES=${MFEM_DIR} WORKDIR $LIB_DIR RUN sudo git clone https://github.com/jbeder/yaml-cpp.git WORKDIR ./yaml-cpp/lib -RUN cmake .. -DYAML_BUILD_SHARED_LIBS=on && make -WORKDIR $LIB_DIR/yaml-cpp/include/yaml-cpp -RUN sudo ln -s ./ yaml-cpp +RUN cmake .. -DYAML_BUILD_SHARED_LIBS=on && make && sudo make install +# WORKDIR $LIB_DIR/yaml-cpp/include/yaml-cpp +# RUN sudo ln -s ./ yaml-cpp # flags for libROM cmake ENV YAML_DIR=$LIB_DIR/yaml-cpp diff --git a/include/input_parser.hpp b/include/input_parser.hpp index d48c9214..9d4dd55e 100644 --- a/include/input_parser.hpp +++ b/include/input_parser.hpp @@ -5,7 +5,7 @@ #ifndef INPUT_PARSER_HPP #define INPUT_PARSER_HPP -#include "yaml.h" +#include "yaml-cpp/yaml.h" #include "mfem.hpp" using namespace mfem;