From 0673a6470e43ce8055aefb42638a5b5277413bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Thu, 21 Jun 2018 12:21:12 +0200 Subject: [PATCH 1/8] Added class gzFileLoader to read models in gzipped files (using boost::iostreams) --- dynet/io.cc | 289 +++++++++++++++++++++++++++++++++++++++++++++++++ dynet/io.h | 16 +++ dynet/model.cc | 10 +- 3 files changed, 313 insertions(+), 2 deletions(-) diff --git a/dynet/io.cc b/dynet/io.cc index bca3b9952..3c88b3aa8 100644 --- a/dynet/io.cc +++ b/dynet/io.cc @@ -4,6 +4,8 @@ #include "dynet/str-util.h" #include +#include +#include // Normally DyNet style permits using namespace std, but to make compatibility // possible with some external code, it is simpler if types are fully @@ -20,6 +22,7 @@ static const int FLOAT32_EXPONENT = 2; namespace dynet { namespace { +// ----------------- utility functions bool valid_key(const std::string & s) { if (s.size() == 0) return true; if (s == "/") return false; @@ -52,11 +55,27 @@ void read_param_header(std::string line, std::string &type, std::string &name, D } } + +bool relevant_header_line(std::string line, const std::string &pref, const std::string &key_, std::string &type, std::string &name, Dim& dim,size_t& byte_count, bool& zero_grad){ + + if (line.substr(0,pref.size()) != pref) + return false; // not the required header start "#", "#Parameter", etc + + // if a param header, check the key + read_param_header(line, type, name, dim, byte_count, zero_grad); + return (name.substr(0, key_.size()) == key_); +} + + + } // anyonymous namespace Saver::~Saver() {} Loader::~Loader() {} + +// =========== TextFileSaver ==================== + TextFileSaver::TextFileSaver(const std::string & filename, bool append) : p_datastream( new std::ofstream( @@ -135,6 +154,8 @@ void TextFileSaver::save(const LookupParameterStorage & p, datastream << dynet::as_vector(p.all_grads) << std::endl; } +// =========== TextFileLoader ==================== + TextFileLoader::TextFileLoader(const std::string & filename) : dataname(filename) { } @@ -333,4 +354,272 @@ LookupParameter TextFileLoader::load_lookup_param(ParameterCollection & model, DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); } + +// =========== gzFileLoader ==================== + +gzFileLoader::gzFileLoader(const std::string & filename) : + dataname(filename) { } + +gzFileLoader::~gzFileLoader() {} + + + +void gzFileLoader::populate(ParameterCollection & model, const std::string & key) { + + std::ifstream fmod(dataname, std::ios_base::in | std::ios_base::binary); + if(!fmod) DYNET_RUNTIME_ERR("Could not read model from " << dataname); + boost::iostreams::filtering_streambuf inbuf; + inbuf.push(boost::iostreams::gzip_decompressor()); + inbuf.push(fmod); + std::istream datastream(&inbuf); + + std::string line, type, name; + bool zero_grad = false; + Dim dim; + size_t byte_count = 0; + std::vector values; + Tensor *value_t, *grad_t; + size_t param_id = 0, lookup_id = 0; + ParameterCollectionStorage & storage = model.get_storage(); + std::string key_ = key; + if (key_.size() != 0 && key_.back() != '/') key_ += "/"; + while(std::getline(datastream, line)) { + // skip non-relevant parameter lines + while (not relevant_header_line(line, "#", key_, type, name, dim, byte_count, zero_grad)) + std::getline(datastream, line); + + // We found a relevant parameter line, load it + if (type == "#Parameter#") { + values.resize(dim.size()); + if(param_id >= storage.params.size()) + DYNET_RUNTIME_ERR("Too many parameters to load in populated model at " << name); + ParameterStorage & param = *storage.params[param_id++]; + if(param.dim != dim) + DYNET_RUNTIME_ERR("Dimensions of parameter " << name << " looked up from file (" << dim << + ") do not match parameters to be populated (" << param.dim << ")"); + value_t = ¶m.values; + grad_t = ¶m.g; + } + + // Load a lookup parameter + else if(type == "#LookupParameter#") { + values.resize(dim.size()); + if(lookup_id >= storage.lookup_params.size()) + DYNET_RUNTIME_ERR("Too many lookup parameters in populated model at " << name); + LookupParameterStorage & param = *storage.lookup_params[lookup_id++]; + if(param.all_dim != dim) + DYNET_RUNTIME_ERR("Dimensions of lookup parameter " << name << " lookup up from file (" << dim << + ") do not match parameters to be populated (" << param.all_dim << ")"); + value_t = ¶m.all_values; + grad_t = ¶m.all_grads; + } + + // some unexpected header + else { + DYNET_RUNTIME_ERR("Bad parameter specification in model: " << line); + } + + // load parameter + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(*value_t, values); + if(!zero_grad){ + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(*grad_t, values); + } else { + TensorTools::zero(*grad_t); + } + } + + if(param_id != storage.params.size() || lookup_id != storage.lookup_params.size()) + DYNET_RUNTIME_ERR("Number of parameter/lookup parameter objects loaded from file (" << + param_id << '/' << lookup_id << ") did not match number to be populated (" << + storage.params.size() << '/' << storage.lookup_params.size() << ')'); + + fmod.close(); +} + +void gzFileLoader::populate(Parameter & param, + const std::string & key) { + if(key == "") DYNET_INVALID_ARG("gzFileLoader.populate() requires non-empty key"); + + std::ifstream fmod(dataname, std::ios_base::in | std::ios_base::binary); + if(!fmod) DYNET_RUNTIME_ERR("Could not read model from " << dataname); + boost::iostreams::filtering_streambuf inbuf; + inbuf.push(boost::iostreams::gzip_decompressor()); + inbuf.push(fmod); + std::istream datastream(&inbuf); + + std::string line, type, name; + bool zero_grad=false; + Dim dim; + size_t byte_count = 0; + + // skip non-relevant parameter lines + bool found = false; + std::getline(datastream, line); + while (not datastream.eof() and not found) { + if (relevant_header_line(line, "#Parameter#", key, type, name, dim, byte_count, zero_grad)) + found = true; + else + std::getline(datastream, line); + } + // search parameter was not found + if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + + // parameter was found, load it + if(param.p->dim != dim) + DYNET_RUNTIME_ERR("Attempted to populate parameter where arguments don't match (" << param.p->dim << " != " << dim << ")"); + std::vector values(dim.size()); + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(param.get_storage().values, values); + if(!zero_grad){ + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(param.get_storage().g, values); + } + else { + TensorTools::zero(param.get_storage().g); + } + + fmod.close(); + return; +} + + +void gzFileLoader::populate(LookupParameter & lookup_param, + const std::string & key) { + if(key == "") DYNET_INVALID_ARG("gzFileLoader.populate() requires non-empty key"); + + std::ifstream fmod(dataname, std::ios_base::in | std::ios_base::binary); + if(!fmod) DYNET_RUNTIME_ERR("Could not read model from " << dataname); + boost::iostreams::filtering_streambuf inbuf; + inbuf.push(boost::iostreams::gzip_decompressor()); + inbuf.push(fmod); + std::istream datastream(&inbuf); + + std::string line, type, name; + bool zero_grad=false; + Dim dim; + size_t byte_count = 0; + + // skip non-relevant parameter lines + bool found = false; + std::getline(datastream, line); + while (not datastream.eof() and not found) { + if (relevant_header_line(line, "#LookupParameter#", key, type, name, dim, byte_count, zero_grad)) + found = true; + else + std::getline(datastream, line); + } + // search parameter was not found + if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + + // parameter was found, load it + if(lookup_param.p->all_dim != dim) + DYNET_RUNTIME_ERR("Attempted to populate lookup parameter where arguments don't match (" << lookup_param.p->all_dim << " != " << dim << ")"); + + std::vector values(dim.size()); + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(lookup_param.get_storage().all_values, values); + if(!zero_grad){ + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(lookup_param.get_storage().all_grads, values); + } + else { + TensorTools::zero(lookup_param.get_storage().all_grads); + } + fmod.close(); + return; +} + +Parameter gzFileLoader::load_param(ParameterCollection & model, + const std::string & key) { + if (key == "") DYNET_INVALID_ARG("gzFileLoader.load_param() requires non-empty key"); + + std::ifstream fmod(dataname, std::ios_base::in | std::ios_base::binary); + if(!fmod) DYNET_RUNTIME_ERR("Could not read model from " << dataname); + boost::iostreams::filtering_streambuf inbuf; + inbuf.push(boost::iostreams::gzip_decompressor()); + inbuf.push(fmod); + std::istream datastream(&inbuf); + + std::string line, type, name; + bool zero_grad=false; + Dim dim; + size_t byte_count = 0; + + // skip non-relevant parameter lines + bool found = false; + std::getline(datastream, line); + while (not datastream.eof() and not found) { + if (relevant_header_line(line, "#Parameter#", key, type, name, dim, byte_count, zero_grad)) + found = true; + else + std::getline(datastream, line); + } + // search parameter was not found + if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + + // parameter was found, add and load it + Parameter param = model.add_parameters(dim); + param.get_storage().name = name; + std::vector values(dim.size()); + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(param.get_storage().values, values); + if(!zero_grad){ + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(param.get_storage().g, values); + } else { + TensorTools::zero(param.get_storage().g); + } + fmod.close(); + return param; +} + +LookupParameter gzFileLoader::load_lookup_param(ParameterCollection & model, + const std::string & key) { + + if(key == "") DYNET_INVALID_ARG("gzFileLoader.load_lookup_param() requires non-empty key"); + + std::ifstream fmod(dataname, std::ios_base::in | std::ios_base::binary); + if(!fmod) DYNET_RUNTIME_ERR("Could not read model from " << dataname); + boost::iostreams::filtering_streambuf inbuf; + inbuf.push(boost::iostreams::gzip_decompressor()); + inbuf.push(fmod); + std::istream datastream(&inbuf); + + std::string line, type, name; + bool zero_grad=false; + Dim dim; + size_t byte_count = 0; + + // skip non-relevant parameter lines + bool found = false; + std::getline(datastream, line); + while (not datastream.eof() and not found) { + if (relevant_header_line(line, "#LookupParameter#", key, type, name, dim, byte_count, zero_grad)) + found = true; + else + std::getline(datastream, line); + } + // search parameter was not found + if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + + // parameter was found, load it + std::vector values(dim.size()); + size_t size = dim[dim.nd-1]; dim.nd--; + LookupParameter lookup_param = model.add_lookup_parameters(size, dim); + lookup_param.get_storage().name = name; + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(lookup_param.get_storage().all_values, values); + if(!zero_grad){ + { std::getline(datastream, line); std::istringstream iss(line); iss >> values; } + TensorTools::set_elements(lookup_param.get_storage().all_grads, values); + } else { + TensorTools::zero(lookup_param.get_storage().all_grads); + } + fmod.close(); + return lookup_param; +} + + } // namespace dynet diff --git a/dynet/io.h b/dynet/io.h index 9fa82a2b5..e686d743a 100644 --- a/dynet/io.h +++ b/dynet/io.h @@ -173,6 +173,22 @@ class TextFileLoader : public Loader { std::string dataname; }; // class TextFileLoader +class gzFileLoader : public Loader { + public: + gzFileLoader(const std::string & filename); + ~gzFileLoader() override; + void populate(ParameterCollection & model, const std::string & key = "") override; + void populate(Parameter & param, const std::string & key = "") override; + void populate(LookupParameter & lookup_param, + const std::string & key = "") override; + Parameter load_param(ParameterCollection & model, const std::string & key) override; + LookupParameter load_lookup_param(ParameterCollection & model, const std::string & key) override; + + private: + std::string dataname; +}; // class gzFileLoader + + } // namespace dynet #endif diff --git a/dynet/model.cc b/dynet/model.cc index f81ba74e9..b3587964a 100644 --- a/dynet/model.cc +++ b/dynet/model.cc @@ -516,8 +516,14 @@ void save_dynet_model(std::string filename, ParameterCollection* model) { }; void load_dynet_model(std::string filename, ParameterCollection* model) { - TextFileLoader loader(filename); - loader.populate(*model, "/model"); + if (filename.substr(filename.size()-3) == ".gz") { + gzFileLoader loader(filename); + loader.populate(*model, "/model"); + } + else { + TextFileLoader loader(filename); + loader.populate(*model, "/model"); + } }; Model::Model() : ParameterCollection() { From 704ee1e5b073206784f840149d918a16b9549e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Thu, 21 Jun 2018 14:54:09 +0200 Subject: [PATCH 2/8] fixed to compile in msvc --- dynet/io.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dynet/io.cc b/dynet/io.cc index 3c88b3aa8..61adf52ab 100644 --- a/dynet/io.cc +++ b/dynet/io.cc @@ -385,7 +385,7 @@ void gzFileLoader::populate(ParameterCollection & model, const std::string & key if (key_.size() != 0 && key_.back() != '/') key_ += "/"; while(std::getline(datastream, line)) { // skip non-relevant parameter lines - while (not relevant_header_line(line, "#", key_, type, name, dim, byte_count, zero_grad)) + while (! relevant_header_line(line, "#", key_, type, name, dim, byte_count, zero_grad)) std::getline(datastream, line); // We found a relevant parameter line, load it @@ -457,14 +457,14 @@ void gzFileLoader::populate(Parameter & param, // skip non-relevant parameter lines bool found = false; std::getline(datastream, line); - while (not datastream.eof() and not found) { + while (!datastream.eof() && !found) { if (relevant_header_line(line, "#Parameter#", key, type, name, dim, byte_count, zero_grad)) found = true; else std::getline(datastream, line); } // search parameter was not found - if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + if (!found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); // parameter was found, load it if(param.p->dim != dim) @@ -504,14 +504,14 @@ void gzFileLoader::populate(LookupParameter & lookup_param, // skip non-relevant parameter lines bool found = false; std::getline(datastream, line); - while (not datastream.eof() and not found) { + while (!datastream.eof() && !found) { if (relevant_header_line(line, "#LookupParameter#", key, type, name, dim, byte_count, zero_grad)) found = true; else std::getline(datastream, line); } // search parameter was not found - if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + if (!found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); // parameter was found, load it if(lookup_param.p->all_dim != dim) @@ -550,14 +550,14 @@ Parameter gzFileLoader::load_param(ParameterCollection & model, // skip non-relevant parameter lines bool found = false; std::getline(datastream, line); - while (not datastream.eof() and not found) { + while (!datastream.eof() && !found) { if (relevant_header_line(line, "#Parameter#", key, type, name, dim, byte_count, zero_grad)) found = true; else std::getline(datastream, line); } // search parameter was not found - if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + if (!found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); // parameter was found, add and load it Parameter param = model.add_parameters(dim); @@ -595,14 +595,14 @@ LookupParameter gzFileLoader::load_lookup_param(ParameterCollection & model, // skip non-relevant parameter lines bool found = false; std::getline(datastream, line); - while (not datastream.eof() and not found) { + while (!datastream.eof() && !found) { if (relevant_header_line(line, "#LookupParameter#", key, type, name, dim, byte_count, zero_grad)) found = true; else std::getline(datastream, line); } // search parameter was not found - if (not found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); + if (!found) DYNET_RUNTIME_ERR("Could not find key " << key << " in the model file"); // parameter was found, load it std::vector values(dim.size()); From bf01d4affc4556a7185d32a934e4590160244207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Thu, 21 Jun 2018 16:06:21 +0200 Subject: [PATCH 3/8] link with boost::iostreams --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f592036ba..8f54d9f4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,7 @@ if(ENABLE_BOOST) endif() endif() set(Boost_REALPATH ON) - find_package(Boost COMPONENTS program_options regex serialization REQUIRED) + find_package(Boost COMPONENTS program_options regex serialization iostreams REQUIRED) message("-- Boost dir is " ${Boost_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR}) if(MSVC) From 7bacc73f9357e9a5565aba7988bcbb1e79330a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Thu, 12 Jul 2018 17:15:38 +0200 Subject: [PATCH 4/8] compilation of boost depending features is now conditioned to ENABLE_BOOST --- CMakeLists.txt | 1 + dynet/CMakeLists.txt | 3 ++- dynet/io.cc | 8 ++++++-- dynet/io.h | 5 ++++- dynet/model.cc | 4 ++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f54d9f4c..3ad4c1417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,7 @@ if(ENABLE_BOOST) endif() set(Boost_REALPATH ON) find_package(Boost COMPONENTS program_options regex serialization iostreams REQUIRED) + add_definitions(-DHAVE_BOOST) message("-- Boost dir is " ${Boost_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR}) if(MSVC) diff --git a/dynet/CMakeLists.txt b/dynet/CMakeLists.txt index 5a69b89c4..7539fc775 100644 --- a/dynet/CMakeLists.txt +++ b/dynet/CMakeLists.txt @@ -68,6 +68,7 @@ set(dynet_library_SRCS ) if(ENABLE_BOOST) list(APPEND dynet_library_SRCS mp.cc) + endif() # Headers: @@ -161,7 +162,7 @@ weight-decay.h if(ENABLE_BOOST) list(APPEND dynet_library_HDRS mp.h) endif() - + set(dynet_gpu_mergeable_SRCS nodes-activations nodes-affinetransform diff --git a/dynet/io.cc b/dynet/io.cc index 61adf52ab..6372fb913 100644 --- a/dynet/io.cc +++ b/dynet/io.cc @@ -4,8 +4,11 @@ #include "dynet/str-util.h" #include + +#ifdef HAVE_BOOST #include #include +#endif // Normally DyNet style permits using namespace std, but to make compatibility // possible with some external code, it is simpler if types are fully @@ -356,7 +359,8 @@ LookupParameter TextFileLoader::load_lookup_param(ParameterCollection & model, // =========== gzFileLoader ==================== - +#ifdef HAVE_BOOST + gzFileLoader::gzFileLoader(const std::string & filename) : dataname(filename) { } @@ -620,6 +624,6 @@ LookupParameter gzFileLoader::load_lookup_param(ParameterCollection & model, fmod.close(); return lookup_param; } - +#endif // ifdef HAVE_BOOST } // namespace dynet diff --git a/dynet/io.h b/dynet/io.h index e686d743a..5fc7bbe63 100644 --- a/dynet/io.h +++ b/dynet/io.h @@ -173,6 +173,8 @@ class TextFileLoader : public Loader { std::string dataname; }; // class TextFileLoader + +#ifdef HAVE_BOOST class gzFileLoader : public Loader { public: gzFileLoader(const std::string & filename); @@ -187,7 +189,8 @@ class gzFileLoader : public Loader { private: std::string dataname; }; // class gzFileLoader - +#endif + } // namespace dynet diff --git a/dynet/model.cc b/dynet/model.cc index b3587964a..401ddd439 100644 --- a/dynet/model.cc +++ b/dynet/model.cc @@ -517,8 +517,12 @@ void save_dynet_model(std::string filename, ParameterCollection* model) { void load_dynet_model(std::string filename, ParameterCollection* model) { if (filename.substr(filename.size()-3) == ".gz") { + #ifdef HAVE_BOOST gzFileLoader loader(filename); loader.populate(*model, "/model"); + #else + DYNET_RUNTIME_ERR("gzipped model support was not built. Compile with cmake option -DENABLE_BOOST=ON to enable it."); + #endif } else { TextFileLoader loader(filename); From 0de9492757bb19a306264daa7a3d11657b3335df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Sat, 15 Sep 2018 02:27:41 +0200 Subject: [PATCH 5/8] test scripts fixed --- .appveyor.yml | 2 +- .travis/install_dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 09360a62d..88f968b44 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -42,6 +42,7 @@ before_build: - cmd: cd build - cmd: cmake -DEIGEN3_INCLUDE_DIR=C:/projects/eigen -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=%configuration% -DENABLE_BOOST=ON -DENABLE_CPP_EXAMPLES=ON -DBOOST_ROOT:PATHNAME="%BOOST_ROOT%" -DBoost_LIBRARY_DIRS:FILEPATH="%BOOST_LIBRARYDIR%" -DBoost_NO_BOOST_CMAKE=TRUE -DBoost_NO_SYSTEM_PATHS=TRUE -DPYTHON=python.exe .. - cmd: set VS90COMNTOOLS=%VS140COMNTOOLS% + - cmd: set PATH=%BOOST_LIBRARYDIR%;%PATH% - cmd: cd .. build: @@ -54,7 +55,6 @@ after_build: test_script: # Cmake (C++) unit tests - - cmd: set PATH=%BOOST_LIBRARYDIR%;%PATH% - cmd: cd %APPVEYOR_BUILD_FOLDER%\build - cmd: ctest -C %configuration% --output-on-failure --timeout 300 # Python unit tests diff --git a/.travis/install_dependencies.sh b/.travis/install_dependencies.sh index 70636a560..1c19fb6ba 100755 --- a/.travis/install_dependencies.sh +++ b/.travis/install_dependencies.sh @@ -8,7 +8,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y gcc-4.8 g++-4.8 PYTHON_PACKAGES="numpy pypandoc twine auditwheel cython" if [[ "$PYTHON_INSTALL" == manual ]]; then - sudo apt-get install -y --allow-unauthenticated libboost-filesystem1.55-dev libboost-program-options1.55-dev libboost-serialization1.55-dev libboost-test1.55-dev libboost-regex1.55-dev + sudo apt-get install -y --allow-unauthenticated libboost-filesystem1.55-dev libboost-program-options1.55-dev libboost-serialization1.55-dev libboost-test1.55-dev libboost-regex1.55-dev libboost-iostreams1.55-dev sudo -H pip install -U $PYTHON_PACKAGES else sudo apt-get install -y pandoc From 2788900a4e09a59506f88f9ce4b69e344a1cb45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Sat, 15 Sep 2018 03:47:08 +0200 Subject: [PATCH 6/8] appveyor fixing --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 88f968b44..4ca87855b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -55,6 +55,7 @@ after_build: test_script: # Cmake (C++) unit tests + - cmd: set PATH=%BOOST_LIBRARYDIR%;%PATH% - cmd: cd %APPVEYOR_BUILD_FOLDER%\build - cmd: ctest -C %configuration% --output-on-failure --timeout 300 # Python unit tests From f1337fe6c03bc975398832a017651ed7e6a72320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Mon, 17 Sep 2018 17:01:56 +0200 Subject: [PATCH 7/8] trying again for appveyor --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 4ca87855b..d18e00856 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -46,6 +46,7 @@ before_build: - cmd: cd .. build: + - cmd: set PATH=%BOOST_LIBRARYDIR%;%PATH% project: build\dynet.sln verbosity: normal From 1d07eef10cd8e4538131fe1b2c55582e3d01f1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Padr=C3=B3?= Date: Mon, 17 Sep 2018 17:04:46 +0200 Subject: [PATCH 8/8] trying again for appveyor --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index d18e00856..4ca87855b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -46,7 +46,6 @@ before_build: - cmd: cd .. build: - - cmd: set PATH=%BOOST_LIBRARYDIR%;%PATH% project: build\dynet.sln verbosity: normal