Skip to content

Commit

Permalink
proper importing of yaml-cpp. simplifying the installation for yaml-cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Dec 20, 2023
1 parent 7dd8018 commit ae95252
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -100,7 +101,6 @@ include_directories(
${HDF5_C_INCLUDE_DIRS}
${MPI_C_INCLUDE_DIRS}
${MFEM_C_INCLUDE_DIRS}
${YAML_INCLUDES}
${LIBROM_INCLUDES}
)
link_libraries(
Expand All @@ -118,7 +118,7 @@ link_libraries(
${PARMETIS}
${METIS}
${MUMPS}
${YAML}
yaml-cpp::yaml-cpp
GTest::GTest
${LIBROM}
)
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && 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
Expand Down
2 changes: 1 addition & 1 deletion include/input_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae95252

Please sign in to comment.