Closed ssbanerje closed 4 years ago
I am not sure if this is related. When I try to build the main libs/bins/kmodules in the Release/Debug directories, I get a lot of errors triggered by the -Werrror
flags. For example
Scanning dependencies of target core_common_objects
[ 2%] Building CXX object runtime_src/core/common/CMakeFiles/core_common_objects.dir/scheduler.cpp.o
In file included from /usr/include/string.h:494,
from /usr/include/c++/9/cstring:42,
from /home/subho/Workshop/XRT/src/runtime_src/core/common/scheduler.cpp:26:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘int xrt_core::scheduler::init(xclDeviceHandle, const axlf*)’ at /home/subho/Workshop/XRT/src/runtime_src/core/common/scheduler.cpp:178:14:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 32 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [runtime_src/core/common/CMakeFiles/core_common_objects.dir/build.make:63: runtime_src/core/common/CMakeFiles/core_common_objects.dir/scheduler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1038: runtime_src/core/common/CMakeFiles/core_common_objects.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h: In instantiation of ‘std::vector<xrt::device> xrt::loadDevices(UnaryPredicate) [with UnaryPredicate = xrt::loadDevices()::<lambda(const string&)>]’:
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:982:26: required from here
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:968:27: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
968 | return std::move(devices);
| ^
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:968:27: note: remove ‘std::move’ call
In file included from /home/subho/Workshop/XRT/src/runtime_src/xocl/core/device.h:25,
from /home/subho/Workshop/XRT/src/runtime_src/xdp/profile/plugin/ocl/xocl_profile.h:29,
from /home/subho/Workshop/XRT/src/runtime_src/xdp/profile/plugin/ocl/xocl_profile.cpp:17:
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h: In instantiation of ‘std::vector<xrt::device> xrt::loadDevices(UnaryPredicate) [with UnaryPredicate = xrt::loadDevices()::<lambda(const string&)>]’:
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:982:26: required from here
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:968:27: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
968 | return std::move(devices);
| ^
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:968:27: note: remove ‘std::move’ call
In file included from /home/subho/Workshop/XRT/src/runtime_src/xocl/core/device.h:25,
from /home/subho/Workshop/XRT/src/runtime_src/xdp/profile/plugin/ocl/xocl_profile.h:29,
from /home/subho/Workshop/XRT/src/runtime_src/xdp/profile/plugin/ocl/xocl_plugin.h:21,
from /home/subho/Workshop/XRT/src/runtime_src/xdp/profile/plugin/ocl/xocl_plugin.cpp:17:
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h: In instantiation of ‘std::vector<xrt::device> xrt::loadDevices(UnaryPredicate) [with UnaryPredicate = xrt::loadDevices()::<lambda(const string&)>]’:
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:982:26: required from here
/home/subho/Workshop/XRT/src/runtime_src/xrt/device/device.h:968:27: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
968 | return std::move(devices);
@ssbanerje the compilation errors are code problems indeed. Not yet sure about the CMake errors. We will check it out and fix. Thanks for pointing out the problems.
Hello,
Any updates on this,please ? I am also seeing the same problem when trying to run build.sh
first... -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1")
but then..
CMake Error at runtime_src/tools/xclbin/CMakeLists.txt:125 (add_executable): Target "xclbinutil" links to target "OpenSSL::Crypto" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
I'm seeing the same error when building on Ubuntu 18.03 LTS.
@foolmarks Do you mean 18.04.3 ? We are building and releasing packages on 18.04 by default. While Ubuntu 19.10 has compile errors with gcc9.2, Ubuntu 18.04 is clean. Did you install the necessary packages by running xrtdeps.sh prior to building XRT? Which branch are you building?
@ssbanerje @eejlny I will fix the gcc9.2 compile errors, but please beware that XRT doesn't officially support Ubuntu 19.10, alas it is not built or tested on that platform. Any fixes for gcc9.2 will be on master only.
Lastly, if you have run xrtdpes.sh and are still seeing CMake errors, then maybe there are stale CMake generated files, please try ./build.sh -clean and then build again.
Sorry, yes I did mean 18.04.3 LTS
Yes, I've run the dependency install script (several times).
I'm building the master branch.
@foolmarks That's odd. I am building the master branch on 18.04.3 no problems, and you cleaned stale CMake data with
build.sh -clean
first?
Yes, I did the clean (several times).
Just tried the build of the master branch on 18.04.2 and it ran perfectly - I ended up with several .deb packages in the Release folder:
xrt_202010.2.5.0_18.04-aws.deb xrt_202010.2.5.0_18.04-azure.deb xrt_202010.2.5.0_18.04-container.deb xrt_202010.2.5.0_18.04-xbtest.deb xrt_202010.2.5.0_18.04-xrt.deb
I'm guessing that I need to install xrt_202010.2.5.0_18.04-xrt.deb on my local machine.
I haven't made any packages in the Debug folder - do I need them?
Also, I'm a little unsure what exactly 'please copy aside /lib/firmware/xilinx/sched.bin' means. Should I make a temporary copy of all /lib/firmware/xilinx/sched.bin files, then install the .deb and then copy the original sched*.bin back to where they were?
Yes, if you build XRT yourself, then before installing your locally built package xrt_202010.2.5.0_18.04-xrt.deb, copy /lib/firmware/xilinx/sched.bin to a temporary location. After installing your locally built package, you will see that apt has removed /lib/firmware/xilinx/sched.bin, now simply copy them back. We are working on a better solution for this, e.g. decoupling the scheduler firmware from the XRT package.
I am still not understanding the problem you run into when building on 18.04.3. I created a docker container from scratch with 18.04.3, ran xrtdeps.sh, and was able to build XRT master no problem.
The build script does not create packages for the Debug build. If you need to debug your host application into XRT itself, then in a fresh shell just source build/Debug/opt/xilinx/xrt/setup.sh to set up paths to point at debug libraries.
I got this to work by doing the following:
After that, I was able to flash the Alveo U200 card.
Without the sched.bin files you will not be able to use XRT with the embedded scheduler. I suggest you download the XRT package, extract (dpkg -x) it some some directory, then copy extracted sched.bin files to /lib/firmware/xilinx.
Closing as fixed with PR #2595
I am having some difficulties with the CMake build on Ubuntu 19.10 using the current HEAD as well as the 2019.2_RC1 tag.
When I run
build.sh -driver
the cmake generation script fails to create targets for the tests saying it could not findOpenSSL::Crypto
. However, cmake spits out an earlier log that it was able to findOpenSSL
.Here is a full output of the cmake command.
I have installed the dependencies from
src/runtime_src/tools/scripts/xrtdeps.sh
.