Commit 7db49e3b authored by Lukas Weber's avatar Lukas Weber Committed by Lukas Weber
Browse files

build system tidying

parent 080f9a79
cmake_minimum_required(VERSION 3.1)
project(load_leveller)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package (PkgConfig REQUIRED)
find_package(MPI REQUIRED)
find_package(fmt REQUIRED)
find_package(HDF5 REQUIRED)
find_package(fmt CONFIG REQUIRED)
pkg_check_modules(yaml-cpp REQUIRED IMPORTED_TARGET yaml-cpp)
pkg_check_modules(HDF5 REQUIRED IMPORTED_TARGET HDF5)
set(CMAKE_CXX_STANDARD 17)
......@@ -26,5 +25,5 @@ set(SRCs
)
add_library(load_leveller ${SRCs})
target_link_libraries(load_leveller PUBLIC MPI::MPI_CXX fmt::fmt)
target_link_libraries(load_leveller PUBLIC MPI::MPI_CXX fmt::fmt PkgConfig::yaml-cpp PkgConfig::HDF5)
install(FILES load_leveller.h DESTINATION include)
......@@ -3,7 +3,8 @@
#include <fstream>
#include <yaml-cpp/yaml.h>
void results::write_yaml(const std::string &filename, const std::string &taskdir, const YAML::Node &params) {
void results::write_yaml(const std::string &filename, const std::string &taskdir,
const YAML::Node &params) {
YAML::Emitter out;
out << YAML::BeginSeq;
out << YAML::BeginMap;
......
......@@ -34,6 +34,6 @@ struct results {
std::map<std::string, observable_result> observables;
// writes out the results in a yaml file.
void write_yaml(const std::string &filename, const std::string& taskdir,
void write_yaml(const std::string &filename, const std::string &taskdir,
const YAML::Node &params);
};
#include "merger.h"
#include "runner.h"
#include "merger.h"
#include <dirent.h>
#include <fmt/format.h>
#include <fstream>
......@@ -89,12 +89,12 @@ std::vector<std::string> jobinfo::list_run_files(const std::string &taskdir,
void jobinfo::concatenate_results() {
std::ofstream cat_results{fmt::format("{}.results.yml", jobfile_name)};
for(size_t i = 0; i < task_names.size(); i++) {
std::ifstream res_file{taskdir(i)+"/results.yml"};
res_file.seekg(0,res_file.end);
std::ifstream res_file{taskdir(i) + "/results.yml"};
res_file.seekg(0, res_file.end);
size_t size = res_file.tellg();
res_file.seekg(0, res_file.beg);
std::vector<char> buf(size+1, 0);
std::vector<char> buf(size + 1, 0);
res_file.read(buf.data(), size);
cat_results << buf.data() << "\n";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment