Changed filesystem dependency to boost instead of experimental std library
authorBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Thu, 4 Apr 2019 07:24:50 +0000 (09:24 +0200)
committerBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Thu, 4 Apr 2019 07:24:50 +0000 (09:24 +0200)
.travis.yml
Makefile
README.md
passes/cmds/plugin.cc

index c972949607bdcfd69013282b255b7a2a0ea1e2d2..957735f1dc110dd60e9ec78ca6b3b843eda246f3 100644 (file)
@@ -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"
 
index 119afc5944df302d46187310335bad6eacb13ab7..2038801e694eabed406d41f1ace4cbd92f5dd5fb 100644 (file)
--- 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
index 87c2adcce320a6b7f9b93964e85bbe9a7bb4d37a..45577ade23c00d323fc718fe6e0d9faabcef9965 100644 (file)
--- 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:
 
index 60dab38dd0373c46337459d55a32269ce889aa45..5da8f5b0b32d94cf9549ae50a95589f7d230c76b 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef WITH_PYTHON
 #  include <boost/algorithm/string/predicate.hpp>
 #  include <Python.h>
-#  include <experimental/filesystem>
+#  include <boost/filesystem.hpp>
 #endif
 
 YOSYS_NAMESPACE_BEGIN
@@ -53,7 +53,7 @@ void load_plugin(std::string filename, std::vector<std::string> 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<std::string> 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();