tulip-control / dd

Binary Decision Diagrams (BDDs) in pure Python and Cython wrappers of CUDD, Sylvan, and BuDDy
https://pypi.org/project/dd
Other
181 stars 39 forks source link

install cudd using --fetch or using existing cudd build directory not working #78

Closed sanskar-chitnis closed 3 years ago

sanskar-chitnis commented 3 years ago

Trying to install cudd using --fetch or using existing cudd build directory throws the following error. I think the error is when /W3 is passed (marked in bold). Passing -W3 should get rid of this error. However, I don't know where exactly I need to look in the code so that it passes -W3 insted of /W3.

I've used [...] to shorten the path to my cudd directory.

python setup.py install --cudd="[...]\cudd\cudd" No git info: Assume release. Generating LALR tables Generating LALR tables running install running bdist_egg running egg_info writing dd.egg-info\PKG-INFO writing dependency_links to dd.egg-info\dependency_links.txt writing requirements to dd.egg-info\requires.txt writing top-level names to dd.egg-info\top_level.txt reading manifest file 'dd.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'dd\CUDD_LICENSE' warning: no files found matching 'dd\GLIBC_COPYING.LIB' warning: no files found matching 'dd\GLIBC_LICENSES' warning: no files found matching 'dd\PYTHON_LICENSE' writing manifest file 'dd.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib running build_py copying dd\bdd_parsetab.py -> build\lib.win-amd64-3.7\dd copying dd\dddmp_parsetab.py -> build\lib.win-amd64-3.7\dd copying dd_version.py -> build\lib.win-amd64-3.7\dd running build_ext building 'dd.cudd' extension C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Idd "-I[...]\cudd\cudd." "-I[...]\cudd\cudd\cudd" "-I[...]\cudd\cudd\dddmp" "-I[...]\cudd\cudd\epd" "-I[...]\cudd\cudd\mtr" "-I[...]\cudd\cudd\st" "-I[...]\cudd\cudd\util" -IC:\Users\Sanskar\Anaconda3\include -IC:\Users\Sanskar\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcdd/cudd.c /Fobuild\temp.win-amd64-3.7\Release\dd/cudd.obj -fPIC -std=c99 -DBSD -DHAVE_IEEE_754 -mtune=native -pthread -fwrapv -fno-strict-aliasing -Wall -W -O3 -DSIZEOF_LONG=4 -DSIZEOF_VOID_P=8 cl : Command line error D8004 : '/W' requires an argument error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2

johnyf commented 3 years ago

The module dd.cudd and the script download.py have been written on Linux and work also on macOS. The script download.py would probably need to be modified in order to build dd.cudd on Windows. Please see https://github.com/tulip-control/dd/issues/68#issuecomment-735007934 for more details (the linked comment discusses also modifying the code that builds CUDD, which would not be needed when passing a path to an already built CUDD). As suggested in that comment, using the Windows Subsystem for Linux (WSL 2) could be an approach for building and running dd.cudd on a Linux that is accessible from Windows.

About the W3-related error reported above, changing the default arguments that Cython passes to the compiler may require modifying distutils at runtime.

Two relevant areas are:

https://github.com/tulip-control/dd/blob/269e4fc493faeec4f8da46162fb78efa6080b9b7/download.py#L84-L118

and:

https://github.com/tulip-control/dd/blob/269e4fc493faeec4f8da46162fb78efa6080b9b7/download.py#L43-L60

though those are for adding arguments to those passed to the compiler, not for changing the default arguments that Cython passes to the compiler. Relevant Cython documentation can be found at: https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html (please note that this link leads to the documentation for Cython 3.0a6, which is a pre-release; the latest Cython release is version 0.29.23, https://pypi.org/project/Cython/#history).