Skip to content

CMake error while compiling the HelloPLCnext example from SampleRuntime (GitHub)

Dear Sir/Madame,

I have started to dig into the runtime application creation by following the guides on your GitHub (https://github.com/PLCnext/SampleRuntime) I have encountered an issue while trying to compile the first example's code for the target.

CMake Error at CMakeLists.txt:46 (find_package):
By not providing "FindArpDevice.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ArpDevice", but CMake did not find one.

Could not find a package configuration file provided by "ArpDevice" with
any of the following names:

ArpDeviceConfig.cmake
arpdevice-config.cmake

Add the installation prefix of "ArpDevice" to CMAKE_PREFIX_PATH or set
"ArpDevice_DIR" to a directory containing one of the above files. If
"ArpDevice" provides a separate development package or SDK, be sure it has
been installed.

I have followed the tutorial video on installing the SDK and CLI environment on a Linux machine. I can manually locate the FindDeviceArp.cmake file, but when pinpointing its location in the CMakeLists.txt the CMake is still unable to find the configuration files, which I cannot locate as well.

Kind regards,
Michael Czorniej

Comments

  • Hi Michael,

    I hope I can help.

    Are you using the Shell script in the example to run CMake?

    If you're using the Shell script, what parameters are you passing to the script? The article gives an example of passing parameters from a Visual Studio Code task - but the parameters should be similar regardless of how you call the script. And the three parameters must match the version of the PLCnext SDK that you have installed.

    - Martin.

  • Hi Martin,

    Thanks for your swift reply.

    I have just noticed that the build has to be done via the shell script instead of simply calling the cmake, I did use the following syntax to run it

    sudo ./build-runtime.sh -t "/opt/pxc/sdk/AXCF2152/2019.6" -a "2019.6.3 (19.6.3.22423)" -n "AXCF2152"

     Unfortunately, the command failed with the following output.

    ./build-runtime.sh: 1: ./build-runtime.sh: #!/bin/bash: not found
    Version:19.6.3.22423
    ./build-runtime.sh: 21: ./build-runtime.sh: Bad substitution
    CMAKE Configure
    CMake Error at /opt/pxc/sdk/AXCF2152/2019.6/cmake/FindArpDevice.cmake:93 (message):
    The device version '2019.6.3 (19.6.3.22423)' is not supported by this SDK.
    Supported versions are 2019.6.3 (19.6.3.22423 ).
    Call Stack (most recent call first):
    CMakeLists.txt:46 (find_package)

    -- Configuring incomplete, errors occurred!
    See also "/home/mcz/runtime/build/AXCF2152_19.6.3.22423/CMakeFiles/CMakeOutput.log".
    See also "/home/mcz/runtime/build/AXCF2152_19.6.3.22423/CMakeFiles/CMakeError.log".
    ninja: error: loading 'build.ninja': No such file or directory
    ninja: error: loading 'build.ninja': No such file or directory

    I hope that there should be no incompatibility between the PLCnCLI version (2019.0LTS HF02) and the SDK (2019.6.3).

    Edit:
    I have also tried to insert the whitespace in the version number as suggested by the compiler, but got the same erroneous output.

    ~Michael

  • Hi Michael,

    I was just chatting to a colleague this afternoon about a similar problem.

    You are on the right track.

    The problem is caused by a compounding of two issues:

    1. Some genius decided that there should be TWO white-space characters after the version number, before the closing bracket.
    2. The compiler collapses multiple white-space characters into a single space, so it gives a misleading "solution".

    Please try the same command with two spaces after "19.6.3.22423".

    - Martin.

  • Martin,

    This worked like a charm. Wondering what was the motivation of this genius behind forcing to put the white spaces at all.

    Thanks a lot and have a good day!

    ~Michael

  • Hi all,

     

    i'm having the same problem while trying to build the SampleRuntime but couldnt solve it with the suggestions above

    So, toolchain 2019.6 is installed via plcncli, which has version 19.0.2.779

    I tried with

    sudo ./build-runtime.sh -t "/opt/pxc/sdk/AXCF2152/2019.6" -a "AXCF2152" -n "2019.0.2 (19.0.2.779  )"

    sudo ./build-runtime.sh -t "/opt/pxc/sdk/AXCF2152/2019.6" -a "AXCF2152" -n "2019.6.3 (19.6.3.22423  )"

    sudo ./build-runtime.sh -t "/opt/pxc/sdk/AXCF2152/2019.6" -a "AXCF2152" -n "2019.6.3 (19.0.2.779  )"

    but all i get are errors telling me the device version isnt supported by the SDK... any ideas ?

    ie:

    Version:
    CMAKE Configure
    -- Setting ARP_TOOLCHAIN_NATIVE_SYSROOT='/opt/pxc/sdk/AXCF2152/2019.6/sysroots/x86_64-pokysdk-linux'
    -- Setting ARP_TOOLCHAIN_TARGET_SYSROOT='/opt/pxc/sdk/AXCF2152/2019.6/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi'
    -- The C compiler identification is GNU 8.2.0
    -- The CXX compiler identification is GNU 8.2.0
    -- Check for working C compiler: /opt/pxc/sdk/AXCF2152/2019.6/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc
    -- Check for working C compiler: /opt/pxc/sdk/AXCF2152/2019.6/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /opt/pxc/sdk/AXCF2152/2019.6/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++
    -- Check for working CXX compiler: /opt/pxc/sdk/AXCF2152/2019.6/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at /opt/pxc/sdk/AXCF2152/2019.6/cmake/FindArpDevice.cmake:85 (message):
    The device '2019.0.2 (19.0.2.779 )' is not supported by this SDK.
    Supported devices are AXCF2152.
    Call Stack (most recent call first):
    CMakeLists.txt:48 (find_package)

     

    -- Configuring incomplete, errors occurred!
    See also "/home/thomas/PLCnext/RuntimeTutorial/HelloPLC/runtime/build/2019.0.2 (19.0.2.779 )_/CMakeFiles/CMakeOutput.log".
    See also "/home/thomas/PLCnext/RuntimeTutorial/HelloPLC/runtime/build/2019.0.2 (19.0.2.779 )_/CMakeFiles/CMakeError.log".
    ninja: error: loading 'build.ninja': No such file or directory
    ninja: error: loading 'build.ninja': No such file or directory

    thomas@PLCnext-Dev:~/PLCnext/RuntimeTutorial/HelloPLC/runtime/tools$ plcncli --version
    plcncli 2019.0 LTS (19.0.2.779)

    thomas@PLCnext-Dev:~/PLCnext/RuntimeTutorial/HelloPLC/runtime/tools$ cmake --version
    cmake version 3.15.3

    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    thomas@PLCnext-Dev:~/PLCnext/RuntimeTutorial/HelloPLC/runtime/tools$ ninja --version
    1.8.2

  • Hi Thomas,

    The hint is in the error message:

    The device '2019.0.2 (19.0.2.779 )' is not supported by this SDK.
    Supported devices are AXCF2152.

    The -n and -a parameters are swapped in your calls to the build script.

     

    Also - you should run the commands:

    plcncli get sdks

    and 

    plcncli get targets

    ... and then make sure that the -t parameter matches one of the SDK paths, and the -n and -a parameters match the corresponding device name and version number (respectively).

    Hope this helps!

    - Martin.

  • Hi Martin,

     

    thank you for your response, I got it working now!

    sudo ./build-runtime.sh -t "/opt/pxc/sdk/AXCF2152/2019.6" -n "AXCF2152" -a "2019.6.3 (19.6.3.22423 )"

     

     

Sign In or Register to comment.