Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too much Python! #508

Open
OldMagicMan opened this issue Mar 19, 2019 · 4 comments
Open

Too much Python! #508

OldMagicMan opened this issue Mar 19, 2019 · 4 comments

Comments

@OldMagicMan
Copy link

OldMagicMan commented Mar 19, 2019

I don't actually know much Python. I am working on a Windows 7 machine with Visual Studio 2017 and a number of other development packages installed. For instance I've installed the TDM-GCC port of mingw64. I've also downloaded Python 3.7.2 for Windows. However, your page for setting up Python doesn't tell what I need to do after I install it. There are a lot of instructions for other environments that imply there are other things I need to do, but not how to proceed in my specific case.

I installed Msys2 and followed the instructions there, but the shell couldn't find the python binary:
$ pacman -S mingw64/mingw-w64-x86_64-python3
$ pacman -S mingw64/mingw-w64-x86_64-python3-pip
$ python3 -m pip install pipenv # This line generated a "python3 not found" message.

I had a browse around in the Msys2 shell environment, but I just don't want to waste time figuring out how to fix the search path and then dealing with the next issue, then the inevitable next again issue ...

I've worked with msys in the past. It is just an ugly kludge. I worked for years as a UNIX programmer. If I want to work in a POSIX environment then I can just fire up a virtual machine. However, I am coding for Windows with possible ports to other environments. I just want to know how to use CMake. When I looked at your Table of Contents, your book looked like one to the only straight forward and comprehensive introductions. However, my confidence has now taken a knock.

How much Python do I actually have to know to use CMake? Kitware's site makes no mention of a dependency on Python.

Possible Solution

If you are planning a new edition of your book, please sit down at a Windows development environment with an experienced developer, and work through how to get your stuff going without kludges on a straight forward Windows development box. Alternatively, if the Python stuff adds nothing to CMake consider dropping it and anything else that is not germane.

Context

I mainly work on custom software applications for Windows users. While I've had years of experience with UNIX, and can happily find my way around a Linux (debian) system, that's not my working environment.

Your Environment

Was planning to work through you book on a virtual machine running Window 7 Pro x64 with Visual Studio 2017 Community edition installed. It also has a variety of other development software such as CMake 3.7, NSIS installer, and TDM-GCC mingw64 port. I often work from the command line.

What's next?

I plan to continue working through the book, just ignoring anything to do with Python.

@TheErk
Copy link
Collaborator

TheErk commented Mar 19, 2019

I'm not a windows user myself but I think that many recipes in the book (beside the one explicitely using python) may perfectly be run without python.

And you are right using CMake does not require python at all. Python is mainly used for test automation of the recipe. You don't need it if you experiment each recipe "by hand"

Could you try each recipe by launching CMake GUI and select the source directory chapter-01/recipe-01/cxx-example. Then select the "build dir" you want and hit configure.
The recipe should work "natively on windows".

@bast
Copy link
Member

bast commented Mar 19, 2019

Also from me: thank you for the report. I admit that Windows is not a familiar environment for me and I possibly felt a similar frustration to navigate on Windows as you feel now dealing with Python. Also the choice of MSYS2 was done since this was the most sane looking environment for me among many Windows environments I have tested, but again we look at it from different perspectives.

I agree with Eric that for most recipes Python is not needed. The installation instructions possibly over-emphasize Python but this was done to reflect what we have done for automated testing.

I will also happily help out debugging the Python environment issues if it helps.

I admit that for an update of the book or the recipes we would greatly benefit from having Windows expertise among the authors - something we did not have.

@TheErk
Copy link
Collaborator

TheErk commented Mar 19, 2019

CMake GUI dialog on windows is shown here: https://cmake.org/runningcmake/
and you can see there that you can select source directory and binary/build directory from the GUI.
When you hit "configure" (for the first time) CMake will propose you a set of generator/compiler to be used.

As you say you are familiar with the command line you can do the same from the command line by:

cd /path/to/build_dir
cmake /path/to/source/chapter-XX/recipe-YY
cmake --build .

@OldMagicMan
Copy link
Author

Thanks for getting back to me. I'm still working on this. I'm making some notes as I go. Please also note that when I'm programming on Windows, I almost always work from the brain-dead Windoze command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants