Topics

Pip install error

rcg54@...
 

Hi, I tried to pip install Dionysus in an anaconda environment on windows 10 and got the same error that was reported here: https://github.com/mrzv/dionysus/issues/15 . Was this ever resolved? Full output is attached.
Thanks!
Ross

Dmitriy Morozov
 

I've never managed to compile Dionysus on Windows. The only person to ever say they succeeded is Connor Brennan, CCed on this email. He said he used MinGW as the compiler. Here's a brief mention of this in an earlier message on this list:

  https://groups.io/g/dionysus/topic/16962556#31

Connor, do you mind writing up some instructions on how to do this?

Dmitriy

On Tue, Jul 3, 2018 at 12:03 AM, <rcg54@...> wrote:
Hi, I tried to pip install Dionysus in an anaconda environment on windows 10 and got the same error that was reported here: https://github.com/mrzv/dionysus/issues/15 . Was this ever resolved? Full output is attached.
Thanks!
Ross


Connor Brennan
 

Hey Dmitriy,
 
I'll go over a few of the key things that helped me get the compilation to work on windows, but ultimately it was a pretty hacky process. If you are using windows 10, I suggest that you instead make use the linux subsystem. It works great for python and anything else that doesn't require GPU support. Below is a link to information about that. Specifically, check out the section: Run Graphical Linux Desktop Programs.
 
 
Using this method dionysus installed without issue using pip.
 
 
 
Now, if you can't use the subsystem for whatever reason here's some of the things that I encountered compiling on windows 10. This is likely not a full list, but should be a good starting point.
 
cmake: You can download cmake from: https://cmake.org/
 
Compiler: The Microsoft compiler doesn't work, so download mingw. Make sure you get the 64 bit version.
 
Package installation: Microsoft provides a great tool called vcpkg which lets you add a toolchain to the cmake process. Setup instructions are on the git wiki. Once this is installed you can install most packages just like you would on Ubuntu with vcpkg install <package name>. Use this to install boost and other dependencies of dionysus.
 
 
Running the cmake command: Once the above are all installed and you set them up appropriately (might require adding bin folders to your PATH variable), then you can build with cmake. However, the CMakeFiles expect some variables that are not set on the windows 10 system. This is the magical incantation I've been using to build from command-line:
 
cmake.exe  -G "MinGW Makefiles" -DCMAKE_{C,CXX}_FLAGS=-m64 -DCMAKE_INSTALL_PREFIX:PATH="./x64-Release"  -DCMAKE_TOOLCHAIN_FILE="<PATH TO VCPKG>/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows" -DPYTHON_EXECUTABLE=" <PATH TO PYTHON EXE>python.exe"  -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_CXX_FLAGS="-D_hypot=hypot" 
 
-G "MinGW Makefiles"  selects MingW as your compiler and  CMAKE_{C,CXX}_FLAGS sets it to 64 bit.
 
CMAKE_TOOLCHAIN_FILE includes all the packages you installed via vcpkg
 
VCPKG_TARGET_TRIPLET tells vcpkg to use 64 bit packages
 
PYTHON_EXECUTABLE tells cmake where python is installed (bust be 64bit)
 
CMAKE_CXX_FLAGS is a hack used to allow one of the dionysus headers compile correctly
 
All the other options are likely superfluous.
 
Compiling the code: Once cmake runs you can use mingw32-make to compile the code. I got an error about 'dumpbin', but it seems to have worked so I haven't bothered fixing it yet. Then you just need to use steup.py to install the library into python like normal.
 
Hope this helps!

Dmitriy Morozov
 

Thanks, Connor!

Ross, can you let us know if this works for you?

Meanwhile, I really ought to figure out how to cajole conda to build Dionysus on Windows using mingw. That would solve a lot of problems.

Thanks.
Dmitriy

On Wed, Jul 4, 2018 at 11:30 PM Connor Brennan <sharsnik@...> wrote:
Hey Dmitriy,
 
I'll go over a few of the key things that helped me get the compilation to work on windows, but ultimately it was a pretty hacky process. If you are using windows 10, I suggest that you instead make use the linux subsystem. It works great for python and anything else that doesn't require GPU support. Below is a link to information about that. Specifically, check out the section: Run Graphical Linux Desktop Programs.
 
 
Using this method dionysus installed without issue using pip.
 
 
 
Now, if you can't use the subsystem for whatever reason here's some of the things that I encountered compiling on windows 10. This is likely not a full list, but should be a good starting point.
 
cmake: You can download cmake from: https://cmake.org/
 
Compiler: The Microsoft compiler doesn't work, so download mingw. Make sure you get the 64 bit version.
 
Package installation: Microsoft provides a great tool called vcpkg which lets you add a toolchain to the cmake process. Setup instructions are on the git wiki. Once this is installed you can install most packages just like you would on Ubuntu with vcpkg install <package name>. Use this to install boost and other dependencies of dionysus.
 
 
Running the cmake command: Once the above are all installed and you set them up appropriately (might require adding bin folders to your PATH variable), then you can build with cmake. However, the CMakeFiles expect some variables that are not set on the windows 10 system. This is the magical incantation I've been using to build from command-line:
 
cmake.exe  -G "MinGW Makefiles" -DCMAKE_{C,CXX}_FLAGS=-m64 -DCMAKE_INSTALL_PREFIX:PATH="./x64-Release"  -DCMAKE_TOOLCHAIN_FILE="<PATH TO VCPKG>/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows" -DPYTHON_EXECUTABLE=" <PATH TO PYTHON EXE>python.exe"  -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_CXX_FLAGS="-D_hypot=hypot" 
 
-G "MinGW Makefiles"  selects MingW as your compiler and  CMAKE_{C,CXX}_FLAGS sets it to 64 bit.
 
CMAKE_TOOLCHAIN_FILE includes all the packages you installed via vcpkg
 
VCPKG_TARGET_TRIPLET tells vcpkg to use 64 bit packages
 
PYTHON_EXECUTABLE tells cmake where python is installed (bust be 64bit)
 
CMAKE_CXX_FLAGS is a hack used to allow one of the dionysus headers compile correctly
 
All the other options are likely superfluous.
 
Compiling the code: Once cmake runs you can use mingw32-make to compile the code. I got an error about 'dumpbin', but it seems to have worked so I haven't bothered fixing it yet. Then you just need to use steup.py to install the library into python like normal.
 
Hope this helps!