Shop Learn
CMAKE_MAKE_PROGRAM Error using PropWare and Visual Studio Code — Parallax Forums

CMAKE_MAKE_PROGRAM Error using PropWare and Visual Studio Code

Having trouble setting up PropWare with Visual Studio Code on a Windows 10 system(s)

The background is that a young sharp co-op student has been successfully producing propeller C/C++ code using Visual Studio Code for file generation and Propware from the command line to compile and download. We have been trying to get the same setup on my computer(s) following the guide on David Zemon's site using the information on the Getting Started page and the Download page (MS Windows section) but are unsuccessful in running cmake.

The PropWare is on the C drive (C:\PropWare) as is the PropGCC (C:\parallax). Attempted with SimpleIDE installed (C:\Program Files (x86)\SimpleIDE) and not installed.

The extensions (think should not influence command line operations?) installed in Visual Studio Code are:

Name: C/C++
Id: ms-vscode.cpptools
Description: C/C++ IntelliSense, debugging, and code browsing.
Version: 1.3.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

Name: CMake
Id: twxs.cmake
Description: CMake langage support for Visual Studio Code
Version: 0.0.17
Publisher: twxs
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=twxs.cmake

Name: CMake Tools
Id: ms-vscode.cmake-tools
Description: Extended CMake support in Visual Studio Code
Version: 1.7.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools

The banner at the bottom of Visual Studio Code shows "No Kit Selected"

The CMakeLists.txt file is as follows:

cmake_minimum_required(VERSION 3.12)
set(PROPWARE_PATH C:/PropWare/share/PropWare)
find_package(PropWare REQUIRED)

project(GettingStarted)

create_simple_executable(${PROJECT_NAME} GettingStarted.cpp)

and the GettingStarted.cpp file is

#include <PropWare/hmi/output/printer.h>

int main () {
    pwOut << "Hello, world!";
    return 0;
}

There are two error messages associated with the GettingStarted.cpp file:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\PropellerProjects\GettingStarted\GettingStarted.cpp).
cannot open source file "PropWare/hmi/output/printer.h"

but unsure if they relate to the cmake problem.

Upon running cmake the error message (with an empty Bin directory) is as follows

PS C:\PropellerProjects\GettingStarted\bin> cmake -G "Unix Makefiles" ..
-- Found PropWare: C:/PropWare/share/cmake-3.13/Modules/PropellerToolchain.cmake (found version "3.0.0.228")
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "C:/PropellerProjects/GettingStarted/bin/CMakeFiles/CMakeOutput.log".

The CMake files in the bin directory are attached.

With the caveat that i am essentially ignorant of all matters IDE and compiling, a few items in CMakeCache stood out:

//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=CMAKE_MAKE_PROGRAM-NOTFOUND

//The CMake toolchain file
CMAKE_TOOLCHAIN_FILE:FILEPATH=C:/PropWare/share/cmake-3.13/Modules/PropellerToolchain.cmake

CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL= 

In looking around for hints on CMake_Make_Program program errors, common problems appear to be absence of a compiler or undefined tool path neither of which seem to be the problem and absence of or undefined path for nmake.exe.. At some point in our trouble shooting i seem to recall an nmake.exe error but it has not recurred.

Unsure if there should be a value assigned after the ...:INTERNAL= statements or not.

Any advice or troubleshooting tips would be much appreciated.
Bruce Guest

Respectfully, @DavidZemon

Comments

  • Hi @bruceg! Great to hear someone still finds PropWare useful.
    The CMAKE_MAKE_PROGRAM variable defines the path to the middleman build system. You invoke CMake -> CMake generates Makefiles -> you invoke Make -> make invokes compiler/propeller-load/etc. There are multiple flavors of Make out there, so CMake needs to know what flavor you want to use so that it knows exactly how to generate the Makefiles.

    It appears that the PropWare documentation still says that GNU Make is included with the Windows distributable... that's not true anymore. Hasn't been for a while. Sorry for the confusion. You'll need to pick a Make flavor yourself and get it installed and working. This has, for a long time, been the part that has given me the most trouble on Windows, and is no small part of why I gave up on actively maintaining PropWare (Windows users are the majority of users -> I don't like Windows -> Windows instructions are not as well tested -> majority of users find PropWare difficult to use -> I loose interest).

    You can try this installable - I've had luck with it in the past. But I've also seen that one fail to work. No idea if it will work for you today or not. You could also try Ninja: https://github.com/ninja-build/ninja/releases. I remember doing some tests with it many years ago, and it worked fine, but it does prevent the "debug" target from doing any good, so just be aware of that (Ninja tries to make your life "easier" by hiding unnecessary compiler output, and the way PropWare is designed, Ninja doesn't know the difference between compiler output and propeller-load's/your program's output, so it all gets hidden). You could also try NMake - that's Microsoft's Make flavor. It comes bundled with full Visual Studio installations (not VSCode).

    There's a version of GNU Make included in the MinGW package. That's a complicated mess I haven't poked at in a long while, but it might work.

    And there's Cygwin. That should theoretically work quite nicely, since you just install Cygwin and then it has a package manager with the real version of GNU Make that you can install. I think I tested this some 7 or 8 years ago, but I don't remember at all whether or not it worked and if it did what (if any) issues I had to overcome. I would think it would work very well and very seamlessly, and that the only reason I don't recommend it in PropWare's documentation is because it runs contrary to my goal of making it as easy as Arduino (I don't like the idea that you should need to install Propware AND a compiler AND Cygwin AND Make).

    If you can integrate VSCode with WSL (Windows Subsystem for Linux), that is by far the easiest way to get compilation working. You just follow all of the Linux instructions and it works wonderfully. The only trick might be getting the serial port to work through the WSL layer so you can actually program the board.... I haven't tried it in years, and certainly not since WSL2 became a thing.

    Once you do have a flavor of Make installed, you'll need to make sure you pass the right string to CMake's -G flag. The "Command-Line Build Tool Generators" section of this CMake docs page has the list of options available: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id9

    Let me know how it goes. I'd be happy to help some more and maybe we can find a proper solution to PropWare + Make on Windows.

    Cheers,
    David

  • @DavidZemon

    Propeller Version 1 on COM5
    Patching __cfg_txpin with 0000001e
    Patching __cfg_baudrate with 0001c200
    Loading C:/PropellerProjects/GettingStarted/bin/GettingStarted.elf to hub memory
    4440 bytes sent
    Verifying RAM ... OK
    [ Entering terminal mode. Type ESC or Control-C to exit. ]
    Thank You David!
    

    Thank you very much for your quick response, was just looking at the CMake-generator page pondering the depths of my ignorance when your post came through, so your explanation tied everything together perfectly. Went with GNU Make direct via the Make for Windows page and "Setup program" package route. Other then having to manually put make on the Windows path it was straight forward. Will also give Cygwin a whirl on another machine and see how that goes and report back.

    Thank you for PropWare and thanks again for your help (i appreciate your lack of enthusiasm for Windows, will get to Linux one day...),
    Bruce

  • Excellent! Glad you got it working. If you run into any issues, feel free to let me know either here in the forums or in the issue tracker. Or if any of the open issues are directly affecting you, let me know and I can probably get it closed out.

Sign In or Register to comment.