So,
I just checked the changes ... and the build does not work correctly.
But I left the compilation enabled and we will have breaking builds until this
is fixed.
The error message is:
[INFO] --- cmake-maven-plugin:3.7.2-b1:compile (cmake-compile) @
plc4cpp-utils-logger ---
Scanning dependencies of target plc4cpp-utils-logger
[ 14%] Building CXX object
CMakeFiles/plc4cpp-utils-logger.dir/src/main/cpp/org/apache/plc4x/cpp/utils/logger/BLogger.cpp.o
In file included from
/Users/christofer.dutz/Projects/Apache/PLC4X/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/BLogger.cpp:20:
/Users/christofer.dutz/Projects/Apache/PLC4X/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/BLogger.h:118:43:
warning: control reaches end of non-void function [-Wreturn-type]
BLogger& operator=(BLogger
const&){ }; // assignment operator is private
^
1 warning generated.
[ 28%] Building CXX object
CMakeFiles/plc4cpp-utils-logger.dir/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DatDmp.cpp.o
[ 42%] Building CXX object
CMakeFiles/plc4cpp-utils-logger.dir/src/main/cpp/org/apache/plc4x/cpp/utils/logger/DbgTrace.cpp.o
[ 57%] Building CXX object
CMakeFiles/plc4cpp-utils-logger.dir/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ErrorCategory.cpp.o
In file included from
/Users/christofer.dutz/Projects/Apache/PLC4X/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ErrorCategory.cpp:20:
/Users/christofer.dutz/Projects/Apache/PLC4X/plc4cpp/utils/logger/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ErrorCategory.h:23:10:
fatal error: 'boost\system\error_code.hpp' file not found
#include <boost\system\error_code.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: ***
[CMakeFiles/plc4cpp-utils-logger.dir/src/main/cpp/org/apache/plc4x/cpp/utils/logger/ErrorCategory.cpp.o]
Error 1
make[1]: *** [CMakeFiles/plc4cpp-utils-logger.dir/all] Error 2
make: *** [all] Error 2
The strange thing is that I triple- and quadruple-checked that the file
(boost\system\error_code.hpp) is there and the directory is correctly
referenced in the CMakeFile.txt:
target_include_directories (plc4cpp-utils-logger PUBLIC
target/dependencies/include)
So something strange must be going on in there ... unfortunately I stopped C
and C++ development in the early 2000s so I'm not 100% sure where to look.
Chris
Am 27.05.19, 10:17 schrieb "Christofer Dutz" <[email protected]>:
Hi Markus,
I did talk to you about this in our last session. And it once worked while
we did it in Stuttgart.
You introduced the problems by dropping code you didn't test with our
primary build system, which is Maven.
And it's not really a fun trip for me to travel to Stuttgart cause it takes
me about 6 hours of travelling, so I would rather not do this over and over
again.
And it's not quite the Apache way to do these private one-to-one meetups. I
would be happy if we stared discussing C++ related things on this mailing-list,
as we are discussing all the other ones.
Feel free to sign-up to our plc4x slack channel if you prefer that, but we
should only use this for chats, fun and informal discussions. The deeper
discussions should happen here.
Right now the primary build system is Maven and the aggregational CMake
files were a convenience to help use other IDEs (VisualStudio, CLion, ...).
The problem is, that if we don't do this, we will be having big problems
when starting to generate drivers. I would not really like to develop a plugin
for each build system.
In maven it's considered absolute bad practice to reference resources
outside the maven module ... so the referencing stuff "../../../src/main/cpp"
is not a good thing.
That's why I introduced the packaging and the unpacking in the build as
this allows to add a maven dependency to the pom and the managing of the links
to
dependencies is handles as all dependencies are located in the same
directory. So this simplifies the management of the CMakeFile.txt as you only
need one entry
for all dependencies: target/dependencies/include
So if you have a better suggestion how to manage the dependencies and the
driver generation in the future, I'm open for this.
Otherwise I would like to keep things the way I set them up.
I know that with C# and Python we will be having exactly the same problems
... but at least for C++ I had thought I had solved them.
Chris
Am 27.05.19, 09:54 schrieb "Markus Sommer" <[email protected]>:
Hello, Chris,
I looked at the pom.xml on the weekend. To resolve the dependencies
towards Boost, a local duplicate is created in the Dependencies folder. The
duplicate is then created for each module.
To include Boost in CMake you can use the following in the top level:
set(BOOST_ROOT "./libs/boost/target/boost_1_70_0/")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS filesystem log REQUIRED)
In the sub CMakes Boost can then be used as follows:
TARGET_LINK_LIBRARIES (plc4cpp-utils-logger ${Boost_LIBRARIES})
target_include_directories (plc4cpp-utils-logger PUBLIC
${Boost_INCLUDE_DIRS})
Duplication of the code is then no longer necessary.
@Chris: I think we should solve the topic pom.xml together in one
appointment (Stuttgart?).
The errors in the cpp files I have just made a commit to the branch
"develop".
Best regards
Markus
Translated with www.DeepL.com/Translator
Freundliche Grüße
Markus Sommer
Geschäftsführer
isb innovative software businesses GmbH
Otto-Lilienthal-Strasse 2
D - 88046 Friedrichshafen
Tel.: +49 (0) 7541 3834-14
Mob: +49 (0) 171 537 8437
Fax: +49 (0) 7541 3834-20
E-Mail: [email protected]
Web: www.isb-fn.de
Geschäftsführer: Markus Sommer, Thomas Zeler
Sitz: Friedrichshafen
Registergericht: Amtsgericht Ulm HRB-Nr. 631624
Important Note: This e-mail and any attachments are confidential, may
contain trade secrets and may well also be legally privileged or otherwise
protected from disclosure. If you have received it in error, you are on notice
of its status.
Please notify us immediately by reply e-mail and then delete his e-mail
and any attachment from your system. If you are not the intended recipient
please understand that you must not copy this e-mail or any attachments or
disclose the contents to any other person. Thank you.
-----Ursprüngliche Nachricht-----
Von: Christofer Dutz <[email protected]>
Gesendet: Donnerstag, 23. Mai 2019 13:43
An: [email protected]
Betreff: [C++] Getting the logger module working?
Hi all (especially Markus),
I noticed that I had to disable the compilation of the logger module in
the plc4cpp as I am getting errors.
Would be great if you could look into them.
In order to do this, you need to comment in the cmake-compile execution
in: plc4cpp/utils/logger/pom.xml I tried finding out what’s wrong, but gave up
in the end.
Chris