From e64b3f107411c150bbc773fc72b915bc60813c52 Mon Sep 17 00:00:00 2001 From: Benedikt Tutzer Date: Thu, 4 Apr 2019 09:24:50 +0200 Subject: [PATCH] Changed filesystem dependency to boost instead of experimental std library --- .travis.yml | 5 +++++ Makefile | 4 ++-- README.md | 2 +- passes/cmds/plugin.cc | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c97294960..957735f1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ matrix: - python3 - libboost-system-dev - libboost-python-dev + - libboost-filesystem-dev env: - MATRIX_EVAL="CONFIG=gcc && CC=gcc-4.8 && CXX=g++-4.8" @@ -62,6 +63,7 @@ matrix: - python3 - libboost-system-dev - libboost-python-dev + - libboost-filesystem-dev env: - MATRIX_EVAL="CONFIG=gcc && CC=gcc-6 && CXX=g++-6" @@ -89,6 +91,7 @@ matrix: - python3 - libboost-system-dev - libboost-python-dev + - libboost-filesystem-dev env: - MATRIX_EVAL="CONFIG=gcc && CC=gcc-7 && CXX=g++-7" @@ -117,6 +120,7 @@ matrix: - python3 - libboost-system-dev - libboost-python-dev + - libboost-filesystem-dev env: - MATRIX_EVAL="CONFIG=clang && CC=clang-3.8 && CXX=clang++-3.8" @@ -144,6 +148,7 @@ matrix: - python3 - libboost-system-dev - libboost-python-dev + - libboost-filesystem-dev env: - MATRIX_EVAL="CONFIG=clang && CC=clang-5.0 && CXX=clang++-5.0" diff --git a/Makefile b/Makefile index 119afc594..2038801e6 100644 --- a/Makefile +++ b/Makefile @@ -270,9 +270,9 @@ endif ifeq ($(ENABLE_PYOSYS),1) ifeq ($(PYTHON_MAJOR_VERSION),3) - LDLIBS += -lpython$(PYTHON_VERSION)m -lboost_python-py$(subst .,,$(PYTHON_VERSION)) -lboost_system -lstdc++fs + LDLIBS += -lpython$(PYTHON_VERSION)m -lboost_python-py$(subst .,,$(PYTHON_VERSION)) -lboost_system -lboost_filesystem -lstdc++fs else - LDLIBS += -lpython$(PYTHON_VERSION) -lboost_python-py$(subst .,,$(PYTHON_VERSION)) -lboost_system -lstdc++fs + LDLIBS += -lpython$(PYTHON_VERSION) -lboost_python-py$(subst .,,$(PYTHON_VERSION)) -lboost_system -lboost_filesystem -lstdc++fs endif CXXFLAGS += -I/usr/include/python$(PYTHON_VERSION) -D WITH_PYTHON PY_WRAPPER_FILE = kernel/python_wrappers diff --git a/README.md b/README.md index 87c2adcce..45577ade2 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ prerequisites for building yosys: $ sudo apt-get install build-essential clang bison flex \ libreadline-dev gawk tcl-dev libffi-dev git \ graphviz xdot pkg-config python3 libboost-system-dev \ - libboost-python-dev + libboost-python-dev libboost-filesystem-dev Similarily, on Mac OS X MacPorts or Homebrew can be used to install dependencies: diff --git a/passes/cmds/plugin.cc b/passes/cmds/plugin.cc index 60dab38dd..5da8f5b0b 100644 --- a/passes/cmds/plugin.cc +++ b/passes/cmds/plugin.cc @@ -26,7 +26,7 @@ #ifdef WITH_PYTHON # include # include -# include +# include #endif YOSYS_NAMESPACE_BEGIN @@ -53,7 +53,7 @@ void load_plugin(std::string filename, std::vector aliases) #ifdef WITH_PYTHON - std::experimental::filesystem::path full_path(filename); + boost::filesystem::path full_path(filename); if(strcmp(full_path.extension().c_str(), ".py") == 0) { @@ -63,6 +63,7 @@ void load_plugin(std::string filename, std::vector aliases) PyRun_SimpleString(("sys.path.insert(0,\""+path+"\")").c_str()); PyErr_Print(); PyObject *filename_p = PyUnicode_FromString(filename.c_str()); + if(filename_p == NULL) { PyErr_Print();