PLCnext / CppExamples

Collection of various C++ sample code for PLCnext Technology controllers.
MIT License
31 stars 20 forks source link

Running build-local.sh with latest plcncli 21.0.0 LTS (21.0.0.489) #13

Closed Adito5393 closed 3 years ago

Adito5393 commented 3 years ago

Environment (please complete the following information):

Describe the bug I tried to compile an example from here (CppDataTypeTest) using the build-local.sh. I have manage to narrow it down to something going wrong with the build-forOneTarget.sh script (i.e. plcncli build command). See the LOG OUTPUT section for the error.

To Reproduce Steps to reproduce the behavior:

  1. Git clone this repo & Modify the tools/build-local.sh file:
    • set BUILD_HARDWARE="AXCF2152" && PROJECTNAME="CppDataTypeTest"
    • Add DIR=$PWD instead of DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
    • Add $DIR/ for all relative paths: code line: 24, 25 and 26
    • Add also: plcncli set target -n $BUILD_HARDWARE --add --verbose --path $DIR/build/$PROJECTNAME before line 30 (Create Config and Code)
  2. Run chmod +x tools/build-local.sh && ./tools/build-local.sh

Expected behavior Obtaining the libCppDataTypeTest.so using the plcncli from a C++ project.

LOG OUTPUT Here is the relevant output:

Build
+ plcncli build --path /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest --buildtype RELEASE --configure --target AXCF2152,21.0.0.35466 --output /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/ --verbose
+ tee /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466/BUILD_CppDataTypeTest.log
Requested build for targets AXCF2152,21.0.0.35466
Starting build for target AXCF2152,21.0.0.35466
Starting process which cmake in .
Change: Cleared cmake directory.
Checking if CMake needs to be reconfigured...
Configuring CMake...
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/toolchain.cmake" -DARP_TOOLCHAIN_ROOT="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS" -DCMAKE_BUILD_TYPE=RELEASE -DARP_DEVICE="AXCF2152" -DARP_DEVICE_VERSION="2021.0.0 LTS (21.0.0.35466)" -DCMAKE_STAGING_PREFIX="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/" -DCMAKE_PREFIX_PATH="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/external" -G "Unix Makefiles" "/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE.
[cmake]: -- Setting ARP_TOOLCHAIN_NATIVE_SYSROOT='/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux'
[cmake]: -- Setting ARP_TOOLCHAIN_TARGET_SYSROOT='/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi'
[cmake]: -- Setting ARP_TOOLCHAIN_ENVIRONMENT_PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin;/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin'
[cmake]: -- Setting ENV{PATH}='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin;/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin'
[cmake]: -- The C compiler identification is GNU 9.3.0
[cmake]: -- The CXX compiler identification is GNU 9.3.0
[cmake]: -- Check for working C compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc
[cmake]: -- Check for working C compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc -- works
[cmake]: -- Detecting C compiler ABI info
[cmake]: -- Detecting C compiler ABI info - done
[cmake]: -- Detecting C compile features
[cmake]: -- Detecting C compile features - done
[cmake]: -- Check for working CXX compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++
[cmake]: -- Check for working CXX compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++ -- works
[cmake]: -- Detecting CXX compiler ABI info
[cmake]: -- Detecting CXX compiler ABI info - done
[cmake]: -- Detecting CXX compile features
[cmake]: -- Detecting CXX compile features - done
[cmake]: -- Found ArpProgramming: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/include/plcnext
[cmake]: -- Configuring done
[cmake]: -- Generating done
[cmake]: -- Build files have been written to: /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE
Starting process which cmake in .
Starting process /bin/sh -c "'/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE/EnvironmentSetup.sh' && '/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake' --build . --target install" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE.
[cmake]: Scanning dependencies of target CppDataTypeTest
[cmake]: [ 20%] Building CXX object CMakeFiles/CppDataTypeTest.dir/src/CppDataTypeTestComponent.meta.cpp.o
[cmake]: /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestComponent.meta.cpp:1:10: fatal error: CppDataTypeTestComponent.hpp: No such file or directory
[cmake]:     1 | #include "CppDataTypeTestComponent.hpp"
[cmake]:       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[cmake]: compilation terminated.
[cmake]: make[2]: *** [CMakeFiles/CppDataTypeTest.dir/build.make:63: CMakeFiles/CppDataTypeTest.dir/src/CppDataTypeTestComponent.meta.cpp.o] Error 1
[cmake]: make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/CppDataTypeTest.dir/all] Error 2
[cmake]: make: *** [Makefile:130: all] Error 2
cmake process exited with error
Rollback transaction.

The CppDataTypeTestComponent.hpp file is there before thebuild-forOneTarget.sh is executed. Are all the sh scripts still valid for the new CLI version? What commands am I missing?

Complete LOG output:

./tools/build-local.sh
DIR=/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples
Change: Create file plcnext.proj for template project in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
Change: Create file CMakeLists.txt for template project in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
Change: Create file ADD_DEPENDENT_LIBRARIES_HERE.txt for template project in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/external.
Change: Create file CppDataTypeTestComponent.cpp for template component in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src.
Change: Create file CppDataTypeTestComponent.hpp for template component in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src.
Change: Create file CppDataTypeTestProgram.cpp for template program in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src.
Change: Create file CppDataTypeTestProgram.hpp for template program in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src.
Successfully created template 'project' in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
Change: Update project targets.
Successfully added target AXCF2152 2021.0.0 LTS (21.0.0.35466) to project /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
DIR=/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools
###############
###############
plcncli 21.0.0 LTS (21.0.0.489)
Copyright (c) 2018 PHOENIX CONTACT GmbH & Co. KG

  -p, --path                         The path to the project settings file or
                                     the project root directory. Default is the
                                     current directory.

  -s, --sources                      The path of the source directories
                                     separated by ','. Default is the 'src'
                                     directory if such a directory exists. If
                                     not, the directory defined with the
                                     '--path' option is used. Relative paths
                                     are relative to the directory defined with
                                     the '--path' option. If any path contains
                                     a ' ' quotation marks should be used
                                     around all paths, e.g. "path1,path With
                                     Space,path2".

  -i, --includes                     Overrides the includes used to find header
                                     files. Usually CMake is used to determine
                                     the include paths. If that is not possible
                                     or wanted the value of this argument is
                                     used instead of the CMake determined
                                     include paths. Relative paths are relative
                                     to the directory defined with the '--path'
                                     option. If any path contains a ' '
                                     quotation marks should be used around all
                                     paths, e.g. "path1,path With Space,path2".
                                     Additionally to these paths the include
                                     paths determined by the SDK will always be
                                     considered and do not need to be specified
                                     additionally.

  -n, --no-include-path-detection    Disables the automatic include path
                                     detection using CMake. This option is not
                                     necessary if the '-includes' option is
                                     used, as that option will automatically
                                     disable the CMake detection. The system
                                     paths defined by the SDK are still used.

  -o, --output                       The path where the files will be generated
                                     in. Default is the 'intermediate'
                                     directory. Relative paths are relative to
                                     the directory defined with the '--path'
                                     option.

  --verbose                          Enables verbose output.

  --quiet                            Suppresses all output.

  --help                             Display this help screen.

Examples:

generate all config files in default location.:
plcncli generate config --path Path/To/Project

###############
###############
generate Config
Generating all files with the 'config' generator for /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/toolchain.cmake" -DARP_TOOLCHAIN_ROOT="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS" -DCMAKE_BUILD_TYPE=Release -DARP_DEVICE="AXCF2152" -DARP_DEVICE_VERSION="2021.0.0 LTS (21.0.0.35466)" -DCMAKE_STAGING_PREFIX="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/bin" -DCMAKE_PREFIX_PATH="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/external" -G "Unix Makefiles" "/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/Release.
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -E server --experimental --pipe=/tmp/cmake-server-8639F113-CD02-524B-A1DF-3BA75439A05B in .
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/CppDataTypeTest.libmeta.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/CppDataTypeTest.typemeta.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/CppDataTypeTestComponent/CppDataTypeTestComponent.compmeta.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/CppDataTypeTestComponent/CppDataTypeTestProgram/CppDataTypeTestProgram.progmeta.
Successfully generated all files with the 'config' generator for /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
###############
###############
plcncli 21.0.0 LTS (21.0.0.489)
Copyright (c) 2018 PHOENIX CONTACT GmbH & Co. KG

  -p, --path                         The path to the project settings file or
                                     the project root directory. Default is the
                                     current directory.

  -s, --sources                      The path of the source directories
                                     separated by ','. Default is the 'src'
                                     directory if such a directory exists. If
                                     not, the directory defined with the
                                     '--path' option is used. Relative paths
                                     are relative to the directory defined with
                                     the '--path' option. If any path contains
                                     a ' ' quotation marks should be used
                                     around all paths, e.g. "path1,path With
                                     Space,path2".

  -i, --includes                     Overrides the includes used to find header
                                     files. Usually CMake is used to determine
                                     the include paths. If that is not possible
                                     or wanted the value of this argument is
                                     used instead of the CMake determined
                                     include paths. Relative paths are relative
                                     to the directory defined with the '--path'
                                     option. If any path contains a ' '
                                     quotation marks should be used around all
                                     paths, e.g. "path1,path With Space,path2".
                                     Additionally to these paths the include
                                     paths determined by the SDK will always be
                                     considered and do not need to be specified
                                     additionally.

  -n, --no-include-path-detection    Disables the automatic include path
                                     detection using CMake. This option is not
                                     necessary if the '-includes' option is
                                     used, as that option will automatically
                                     disable the CMake detection. The system
                                     paths defined by the SDK are still used.

  -o, --output                       The path where the files will be generated
                                     in. Default is the 'intermediate'
                                     directory. Relative paths are relative to
                                     the directory defined with the '--path'
                                     option.

  --verbose                          Enables verbose output.

  --quiet                            Suppresses all output.

  --help                             Display this help screen.

Examples:

generate all code files in default location.:
plcncli generate code --path Path/To/Project

###############
###############
generate Code
Generating all files with the 'code' generator for /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/toolchain.cmake" -DARP_TOOLCHAIN_ROOT="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS" -DCMAKE_BUILD_TYPE=Release -DARP_DEVICE="AXCF2152" -DARP_DEVICE_VERSION="2021.0.0 LTS (21.0.0.35466)" -DCMAKE_STAGING_PREFIX="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/bin" -DCMAKE_PREFIX_PATH="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/external" -G "Unix Makefiles" "/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/Release.
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -E server --experimental --pipe=/tmp/cmake-server-F65506FD-6B0A-E64B-BF73-297D92D62DCC in .
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestLibrary.cpp.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestLibrary.hpp.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestLibrary.meta.cpp.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestComponentProgramProvider.cpp.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestComponentProgramProvider.hpp.
Change: Generated the file /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestComponent.meta.cpp.
Successfully generated all files with the 'code' generator for /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest.
build/CppDataTypeTest/src/CppDataTypeTestLibrary.hpp
build/CppDataTypeTest/src/CppDataTypeTestLibrary.cpp
build/CppDataTypeTest/src/CppDataTypeTestLibrary.meta.cpp
Start Build All
###############
###############
plcncli 21.0.0 LTS (21.0.0.489)
Copyright (c) 2018 PHOENIX CONTACT GmbH & Co. KG

  -p, --path                Directory where the plcnext.proj file is located.

  -t, --target              Targets for which the build shall be executed.
                            Targets should have the form <target>[,<version>]
                            [...]. The complete version can be but does not
                            have to be used. The combination of target and
                            version must be unambiguous. If the version
                            contains a space, quotation marks around that
                            target are necessary. WARNING: Do not use this
                            option directly before the cmake options, because
                            the cmake options will be interpreted as targets.

  -b, --buildtype           Build type for the build, e.g. Release

  --configure               Force CMake to make a new configuration

  --noconfigure             Force CMake to do only a build

  -o, --output              Sets the directory in which the library is
                            installed. The directory can be either absolute or
                            relative to the project directory. This will use
                            the '-DCMAKE_STAGING_PREFIX' option. If the
                            '-DCMAKE_STAGING_PREFIX' option is already
                            specified this option will be ignored.

  --verbose                 Enables verbose output.

  --quiet                   Suppresses all output.

  --help                    Display this help screen.

  cmake options (pos. 0)    Additional CMake options for the build. They will
                            only be applied when the build is configured. To
                            reconfigure the build use the '--configure' option.
                            It is necessary to set these options with a leading
                            ' -- '. Quotation marks will not be preserved. To
                            add quotation marks to the options, use the escape
                            string '%22' instead. NO other escape sequences
                            such as '%20' will be unescaped.

Examples:

build for all targets supported by project:
plcncli build --path Path/To/Project

build project for target AXCF2152:
plcncli build --path Path/To/Project -t AXCF2152

build project with additional options:
plcncli build --path Path/To/Project -t AXCF2152 --configure -- -G %22Unix
Makefiles%22 -DCMAKE_MAKE_PROGRAM=%22mymakepath%22

install into a special folder:
plcncli build --output build/install

###############
###############
TRY Build All: AXCF2152 Toolchains: 1
T: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS"
 V:21.0.0.35466
 HW:AXCF2152

Build AXCF2152
###############
###############
+ echo Build
Build
+ plcncli build --path /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest --buildtype RELEASE --configure --target AXCF2152,21.0.0.35466 --output /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/ --verbose
+ tee /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466/BUILD_CppDataTypeTest.log
Requested build for targets AXCF2152,21.0.0.35466
Starting build for target AXCF2152,21.0.0.35466
Starting process which cmake in .
Change: Cleared cmake directory.
Checking if CMake needs to be reconfigured...
Configuring CMake...
Starting process which cmake in .
Starting process /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/toolchain.cmake" -DARP_TOOLCHAIN_ROOT="/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS" -DCMAKE_BUILD_TYPE=RELEASE -DARP_DEVICE="AXCF2152" -DARP_DEVICE_VERSION="2021.0.0 LTS (21.0.0.35466)" -DCMAKE_STAGING_PREFIX="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/" -DCMAKE_PREFIX_PATH="/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/external" -G "Unix Makefiles" "/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE.
[cmake]: -- Setting ARP_TOOLCHAIN_NATIVE_SYSROOT='/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux'
[cmake]: -- Setting ARP_TOOLCHAIN_TARGET_SYSROOT='/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi'
[cmake]: -- Setting ARP_TOOLCHAIN_ENVIRONMENT_PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin;/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin'
[cmake]: -- Setting ENV{PATH}='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin;/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin'
[cmake]: -- The C compiler identification is GNU 9.3.0
[cmake]: -- The CXX compiler identification is GNU 9.3.0
[cmake]: -- Check for working C compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc
[cmake]: -- Check for working C compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-gcc -- works
[cmake]: -- Detecting C compiler ABI info
[cmake]: -- Detecting C compiler ABI info - done
[cmake]: -- Detecting C compile features
[cmake]: -- Detecting C compile features - done
[cmake]: -- Check for working CXX compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++
[cmake]: -- Check for working CXX compiler: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/x86_64-pokysdk-linux/usr/bin/arm-pxc-linux-gnueabi/arm-pxc-linux-gnueabi-g++ -- works
[cmake]: -- Detecting CXX compiler ABI info
[cmake]: -- Detecting CXX compiler ABI info - done
[cmake]: -- Detecting CXX compile features
[cmake]: -- Detecting CXX compile features - done
[cmake]: -- Found ArpProgramming: /home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/AXCF2152/2021_0_LTS/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/include/plcnext
[cmake]: -- Configuring done
[cmake]: -- Generating done
[cmake]: -- Build files have been written to: /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE
Starting process which cmake in .
Starting process /bin/sh -c "'/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE/EnvironmentSetup.sh' && '/home/adi/gitProjects/plcNext-psxcad-integration/tools-executables/plcncli/cmake/bin/cmake' --build . --target install" in /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/intermediate/cmake/AXCF2152,21.0.0.35466/RELEASE.
[cmake]: Scanning dependencies of target CppDataTypeTest
[cmake]: [ 20%] Building CXX object CMakeFiles/CppDataTypeTest.dir/src/CppDataTypeTestComponent.meta.cpp.o
[cmake]: /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/build/CppDataTypeTest/src/CppDataTypeTestComponent.meta.cpp:1:10: fatal error: CppDataTypeTestComponent.hpp: No such file or directory
[cmake]:     1 | #include "CppDataTypeTestComponent.hpp"
[cmake]:       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[cmake]: compilation terminated.
[cmake]: make[2]: *** [CMakeFiles/CppDataTypeTest.dir/build.make:63: CMakeFiles/CppDataTypeTest.dir/src/CppDataTypeTestComponent.meta.cpp.o] Error 1
[cmake]: make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/CppDataTypeTest.dir/all] Error 2
[cmake]: make: *** [Makefile:130: all] Error 2
cmake process exited with error
Rollback transaction.
+ mkdir -p /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466
+ cp /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/RELEASE/lib/libCppDataTypeTest.so /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466/libCppDataTypeTest.so
cp: cannot stat '/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest/bin/AXCF2152_21.0.0.35466/RELEASE/lib/libCppDataTypeTest.so': No such file or directory
+ echo '###############'
###############
+ echo '###############'
###############
+ plcncli set target --help
plcncli 21.0.0 LTS (21.0.0.489)
Copyright (c) 2018 PHOENIX CONTACT GmbH & Co. KG

  -n, --name       Required. The target to be added or removed.

  -v, --version    The version of the target to be added or removed.

  -a, --add        Indicates that the target should be added to existing
                   targets.

  -r, --remove     Indicates that the target should be removed from existing
                   targets.

  -p, --path       Directory where the plcnext.proj file is located.

  --verbose        Enables verbose output.

  --quiet          Suppresses all output.

  --help           Display this help screen.

Examples:

Add target to project:
plcncli set target --add -p Path/To/Project -n axcf2152 -v 2019.0

Remove target from project:
plcncli set target --remove --path Path/To/Project --name axcf2152

+ echo '###############'
###############
+ echo '###############'
###############
+ echo ' Add sucessfully build target to project.'
 Add sucessfully build target to project.
++ find /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466 -name libCppDataTypeTest.so
+ [[ -n '' ]]
+ rm -r /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/AXCF2152_21.0.0.35466
+ echo 'Failed to build AXCF2152_21.0.0.35466'
Failed to build AXCF2152_21.0.0.35466
+ set +x
ls: cannot access '/home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/*/': No such file or directory
###############
###############
###############
###############
TRY Build All: AXCF2152 Toolchains: 1
V:21.0.0.35466  HW:AXCF2152
Target List: AXCF2152,21.0.0.35466,deploy/AXCF2152_21.0.0.35466/libCppDataTypeTest.so
###############
###############
plcncli 21.0.0 LTS (21.0.0.489)
Copyright (c) 2018 PHOENIX CONTACT GmbH & Co. KG

  -p, --path                 Directory where the plcnext.proj file is located.

  -m, --metapath             Directory where the library meta files are
                             located.

  -c, --compilationpath      Path to the compilation output file(s), if
                             different from <projectname>/bin.

  -o, --output               Output directory for the library. The directory
                             can be either absolute or relative to the project
                             directory.

  -i, --id                   The GUID for the library.

  -t, --target               List of targets to add to library:
                             <target>[,<version>[,<path to compilation file>]].

  -s, --sources              The path of the source directories separated by
                             ','. Default is the 'src' directory if such a
                             directory exists. If not, the directory defined
                             with the '--path' option is used. Relative paths
                             are relative to the directory defined with the
                             '--path' option. If any path contains a ' '
                             quotation marks should be used around all paths,
                             e.g. "path1,path With Space,path2".

  -e, --externallibraries    List of external libraries separated by ',' to add
                             to library. For multibinary libraries: specify
                             list of libraries separated by ',' which then will
                             be added for every target or specify per target a
                             list of libraries.

  --verbose                  Enables verbose output.

  --quiet                    Suppresses all output.

  --help                     Display this help screen.

Examples:

Generate library for all targets supported by project:
plcncli generate library --path Path/To/Project

Generate library for targets AXCF2152 and RFC4072S:
plcncli generate library --path Path/To/Project --target AXCF2152 RFC4072S

Generate library for target with compilation file in special location:
plcncli generate library --path Path/To/Project --target
AXCF2152,2019.0,path/to/Project.so

Generate library with external libraries:
plcncli generate library --path Path/To/Project --externallibraries
AXCF2152,2019.0,path/to/libforaxc.so,path/to/otherlib.so
RFC4072S,path/to/libfornfc.so

###############
###############
+ plcncli generate library --path /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest --output /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy --target AXCF2152,21.0.0.35466,deploy/AXCF2152_21.0.0.35466/libCppDataTypeTest.so --metapath /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../build/CppDataTypeTest/intermediate --verbose
+ tee /home/adi/gitProjects/plcNext-psxcad-integration/CppExamples/tools/../deploy/CppDataTypeTest_GenerateLib.log
Starting library generation...
Change: Create temporary folder /tmp/910F7D1E-75BE-8D4F-8510-975FC26F8DD6
No library file was found in the path 'deploy/AXCF2152_21.0.0.35466/libCppDataTypeTest.so'.
This command is deprecated. Please use 'deploy' instead.
Rollback transaction.
Adito5393 commented 3 years ago

Why was the feature-request label automatically set? Please change it to the bug label.

OWarneke commented 3 years ago

The installation instructions at each example are still valid. As this repository has been moved from gitlab>github. The Gitlab CI build instructions are no longer maintained and will be removed. We will probably adapt them to github actions and create a build plcnext github actions project as well.

Adito5393 commented 3 years ago

@OWarneke Were you able to reproduce the error?

I just want to be able to use the plcncli to compile a C++ project, in the "PLCNext structure" that it is explained in the docs, and deploy it to the AXCF2152.

Could you provide a working example?

martinboers commented 3 years ago

Just to clarify: Are you looking to use the plcncli to compile one of the C++ examples in this repository? If so, there are build instructions in the README for each of the examples. Those instructions do not use the build-local.sh script which, as Oliver mentioned, has not been updated recently. If the instructions in the README file (for any example) is not clear, we can point you to background articles that might help, and possibly improve those instructions. Or, are you looking to use the plcncli to compile your own C++ project, perhaps a stand-alone executable project? There are different plcncli templates, different commands, and different deployment mechanisms depending on the nature of the application.

OWarneke commented 3 years ago

@Adito5393 but using bash scripts?

In the readme you can finde these instructions:

Compile the code with the PLCnext CLI Install Eclipse IDE, CLI, SDK and Eclipse Add-in (how-to guide: see links in the "Getting started" section above) Clone this repository Navigate to the project you want to test, e.g. cd Examples/ProgramComponentInteraction Execute plcncli new project -c DummyC -p DummyP && ls -la src && rm src/Dummy* Execute plcncli set target --add --name AXCF2152 --version 2020.6 to specify details of the build target Execute plcncli generate all to generate intermediate code and Config files Execute plcncli build to build the code. Execute plcncli deploy to generate a .pcwlx file that can be included in PLCnext Engineer

so wrapping these into a bash could look like this:

#!/bin/bash
cd Examples/ProgramComponentInteraction

plcncli new project -c DummyC -p DummyP && ls -la src && rm src/Dummy*
plcncli set target --add --name AXCF2152 --version 2021.0
plcncli generate all
plcncli build
plcncli deploy

tools/*.sh files are unfortunatly for the 2019.0 plcncli Version so there have been alot of changes to the input and output format so the scripts will not work with the most recent example changes and plcncli version.

Adito5393 commented 3 years ago

Thanks, indeed the commands you highlighted are working. 👍

To avoid future confusion, you could update the repo's README.md by adding (NOT WORKING / DEPRECATED for 2021.0) to the Compile using build-local.sh script section.