Closed tukusejssirs closed 2 years ago
The cmake .. should have compiled the required libraries as part of the initial project creation. Not sure why it did not work on fedora. I can see about testing the build. Only verified on Mac, windows, and Ubuntu.
Best W
(Sent from mobile)
On Oct 8, 2020, at 09:57, Tukusej’s Sirs notifications@github.com wrote:
I’m just trying to compile cppagent on Fedora 32 (x86_64 Linux). The following commands I wanted to issue in order build the program:
Clone MTConnect agent with all the submodules
git clone --recurse-submodules git@github.com:mtconnect/cppagent.git mtconnect_cpp_agent
Create
build
foldermkdir mtconnect_cpp_agent/build
Enter
build
foldercd mtconnect_cpp_agent/build
Install dependencies
Note: I am not sure if I don’t miss any dependencies yet
sudo dnf -y groupinstall "Development Tools" sudo dnf -y install cmake
Build
cppagent
cmake .. make sudo make install cmake .. completed successfully, however, make complains:
[ 17%] Building CXX object agent/CMakeFiles/agent.dir/cppagent.cpp.o In file included from /home/ts/git/itens/mtconnect_cpp_agent/agent/cppagent.cpp:18: /home/ts/git/itens/mtconnect_cpp_agent/agent_lib/../src/agent.hpp:55:39: warning: declaration ‘struct dlib::incoming_things’ does not declare anything 55 | using IncomingThings = struct dlib::incoming_things; | ^
~~~~~~ make[2]: No rule to make target 'install/dlib/lib/libdlib.a', needed by 'agent/agent'. Stop. make[1]: [CMakeFiles/Makefile2:372: agent/CMakeFiles/agent.dir/all] Error 2 make: *** [Makefile:183: all] Error 2 There is no such folder as mtconnect_cpp_agent/build/install/dlib/lib/, but there is mtconnect_cpp_agent/build/install/dlib/lib64/.I have read BUILD.TXT, but I need to build and install an MTConnect agent on headless Linux (aka server without GUI).
I’ve checked mtconnect-agent repo (which I like more as it is coded in JS), but it is archived, therefore I presume it is not developed/maintained anymore.
Any help is appreciated! Thanks in advance!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Thanks for comment, @wsobel!
Is there anything I could help you with?
Any progress? Can I help you with testing?
I have not had a chance to install Fedora to test.
You can check if when you do the cmake ..
if the dependencies are built. That would be a big help.
Do you get an error when you run cmake ..
?
Thanks, W
On Oct 23, 2020, at 07:39, Tukusej’s Sirs notifications@github.com wrote:
Any progress? Can I help you with testing?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mtconnect/cppagent/issues/156#issuecomment-715383524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6BCJ65RWJ7SU2SA63UITSMGITZANCNFSM4SJAIIXQ.
You can check if when you do the
cmake ..
if the dependencies are built. That would be a big help.
From my point of view, yes, all dependencies are built.
Here are full command-line outputs.
cmake ..
(success)make
(error 2)There was a small change to fix an issue with earlier versions of ubuntu and gcc that may help. It was a C++ compatibility issue and now builds on Ubuntu 14 with gcc 8 (i believe)
Best, W
On Nov 5, 2020, at 03:10, Tukusej’s Sirs notifications@github.com wrote:
You can check if when you do the cmake .. if the dependencies are built. That would be a big help.
From my point of view, yes, all dependencies are built.
Here are full command-line outputs.
cmake .. (success) make (error 2) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mtconnect/cppagent/issues/156#issuecomment-722310296, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6BCNPFQH6S2LAJENYZ2TSOKB3NANCNFSM4SJAIIXQ.
Well, some link to that issue would be helpful, but I believe you mean #1 and this comment of yours. However, I believe that the code has since evolved and that is not a solution I’d like to see. :smiley:
Anyway, I use gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
.
I’ve just tried to simply rename the {repo_root}/buildinstall/dlib/lib64
to {repo_root}/buildinstall/dlib/lib
and make
works as expected, therefore the issue is definitely in the Makefile
(or the scripts it is calling), however, I’ve never packaged anything, therefore I can’t help you with fixing this issue. Note that I use x86_64 system and the 64-bit libraries are placed into lib64
.
Anyway for reference, below I post you the output of make
, which was successfull.
make
thanks, i’ll take a look at the logs and what you did. thx - W
On Nov 5, 2020, at 13:09, Tukusej’s Sirs notifications@github.com wrote:
Well, some link to that issue would be helpful, but I believe you mean #1 https://github.com/mtconnect/cppagent/issues/1 and this comment of yours https://github.com/mtconnect/cppagent/issues/1#issuecomment-16830987. However, I believe that the code has since evolved and that is not a solution I’d like to see. 😃
Anyway, I use gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1).
I’ve just tried to simply rename the {repo_root}/buildinstall/dlib/lib64 to {repo_root}/buildinstall/dlib/lib and make works as expected, therefore the issue is definitely in the Makefile (or the scripts it is calling), however, I’ve never packaged anything, therefore I can’t help you with fixing this issue. Note that I use x86_64 system and the 64-bit libraries are placed into lib64.
Anyway for reference, below I post you the output of make, which was successfull.
make — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mtconnect/cppagent/issues/156#issuecomment-722646503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6BCKINT5QLI57664XCLDSOMIAVANCNFSM4SJAIIXQ.
@wsobel, after some time, here I am again trying to build cppagent
on Fedora 34 x86_64. Now the error is different:
[ 18%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-all.cc:42:
/git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
1301 | StackLowerThanAddress(&dummy, &result);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
| ^~~~~~~~~~~~~~~~~~~~~
/git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
1299 | int dummy;
| ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [_deps/googletest-build/googletest/CMakeFiles/gtest.dir/build.make:76: _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1674: _deps/googletest-build/googletest/CMakeFiles/gtest.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
make
logDo I miss a dependency? Could help me out please? :wink: :pray:
I’ll start Fedora and try again. Not sure if this is a real issue or if it is just a warning that is taken as an error. The dummy is not used and therefor should not cause an actual problem. This is in the gtest library, so is not under our control.
Did you change the settings to make warnings treated as errors?
On Oct 27, 2021, at 05:35, Tukusej’s Sirs @.***> wrote:
@wsobel https://github.com/wsobel, after some time, here I am again trying to build cppagent on Fedora 34 x86_64. Now the error is different:
[ 18%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o In file included from /git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-all.cc:42: /git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’: /git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized] 1301 | StackLowerThanAddress(&dummy, &result); |
~~~~~^~~~~ /git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void’ to ‘void testing::internal::StackLowerThanAddress(const void, bool)’ declared here 1290 | static void StackLowerThanAddress(const void ptr, bool* result) { | ^~~~~/git/others/cppagent/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here 1299 | int dummy; | ^~~~~ cc1plus: all warnings being treated as errors make[2]: [_deps/googletest-build/googletest/CMakeFiles/gtest.dir/build.make:76: _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1 make[1]: [CMakeFiles/Makefile2:1674: _deps/googletest-build/googletest/CMakeFiles/gtest.dir/all] Error 2 make: *** [Makefile:166: all] Error 2 full make log Do I miss a dependency? Could help me out please? 😉 🙏— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mtconnect/cppagent/issues/156#issuecomment-952881203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6BCORNJFHFF2DBQAWDQTUI7W2JANCNFSM4SJAIIXQ.
Did you change the settings to make warnings treated as errors?
No, I did exactly what I wrote in the OP.
@wsobel, why did you close this issue?
I had not heard back in a month and assumed that the issue was resolved. I could not reproduce the issue on multiple versions of linux. I can reopen.
Well, actually the issue is not resolved since October 2020. Also I provided you with the build steps I used and the error I get.
I you cannot reproduce it on multiple versions of Linux (I assume you also tried to build it on at least one RHEL-like system), I presume you used some other build instructions—could you share them with me please?
I'll check it out tomorrow. Can you provide the following:
That will help. I built it on Fedora a while ago without an issue. My CI/CD is with windows 10 ms-dev 15, Ubuntu 20.04 w/ gcc 9, and Mac clang 11.
dist and version of Linux
Fedora 34 x86_64; any RHEL-like system
compiler version for gcc
gcc
installed using dnf
(gcc-11.2.1-1.fc34
). Output of gcc -v
:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC)
any dependencies you installed
All I installed are the dev tools (see below). Are there any other deps?
sudo dnf -y groupinstall 'Development Tools' # Not all of the packages are required
sudo dnf -y install cmake gcc
additional environment variables that may effect the compiler like cflags, include, and libraries
I didn’t modify any env variables globally that might affect compiling. I use the defaults set by Fedora / Red Hat.
Here’s once again the guide I followed:
I have just tested this and now it fails in sudo make install
with the following error (this whole output of that command):
sudo make install
One thing that jumps out at me is gcc 11. I have only tested through 9 for the existing version and the dev version through 10. I’ll see if this could be the issue.
They did rearrange their headers and the issue you were having was in google test, I library widely used and not maintained by us.
One option is to install gcc 9 and see if the problem is still there. You will need to use update-alternatives to switch.
(Sent from mobile)
On Nov 28, 2021, at 03:31, Tukusej’s Sirs @.***> wrote:
dist and version of Linux
Fedora 34 x86_64; any RHEL-like system
compiler version for gcc
gcc installed using dnf (gcc-11.2.1-1.fc34). Output of gcc -v:
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC) any dependencies you installed
All I installed are the dev tools (see below). Are there any other deps?
sudo dnf -y groupinstall 'Development Tools' # Not all of the packages are required sudo dnf -y install cmake gcc additional environment variables that may effect the compiler like cflags, include, and libraries
I didn’t modify any env variables globally that might affect compiling. I use the defaults set by Fedora / Red Hat.
Here’s once again the guide I followed:
compilation guide I have just tested this and now it fails in sudo make install with the following error (this whole output of that command):
sudo make install — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
Currently gtest does not support g++ version 11. We will not be able to fix this or address this without google.
To compile successfully: do the following:
mkdir build
cd build
cmake .. -D AGENT_ENABLE_UNITTESTS=OFF
cmake --build .
This will turn the compilation of unit tests off. I tried to change the version of gtest to 1.11, but it still failed.
The only other option is to install g++ version 9 or 10, but I am not a Fedora/dnf savant and do not know how to get update-alternatives working properly on the environment. If you figure out how to get this working, please post here.
Best,
I’m just trying to compile
cppagent
on Fedora 32 (x86_64 Linux). The following commands I wanted to issue in order build the program:cmake ..
completed successfully, however,make
complains:There is no such folder as
mtconnect_cpp_agent/build/install/dlib/lib/
, but there ismtconnect_cpp_agent/build/install/dlib/lib64/
.I have read
BUILD.TXT
, but I need to build and install an MTConnect agent on headless Linux (aka server without GUI).I’ve checked
mtconnect-agent
repo (which I like more as it is coded in JS), but it is archived, therefore I presume it is not developed/maintained anymore.Any help is appreciated! Thanks in advance!
Update: Using
cmake -D CMAKE_BUILD_TYPE=Release ..
instead ofcmake ..
(as it is suggested here) does not make any difference.