Drake source installation unsuccessful due to missing files - bazel

I'm following the instructions from here and here to install drake and I used this file to install all the dependencies. Now when I run cmake ../drake and then make -j, I see I very very long traceback that stackoverflow won't let me post here because I can't seem to get it into a format it likes. But this is where the first error starts:
ERROR: /home/prasanth/.cache/bazel/_bazel_prasanth/7a6ad5daa22f12899ee3dcd32eb0729d/external/gz_math_internal/BUILD.bazel:172:20: Compiling external/gz_math_internal/drake_src/src/Angle.cc failed: (Exit 1): cc failed: error executing command /usr/bin/cc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 25 arguments skipped)
Alternatively, when I use bazel build //... as mentioned here, I see:
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files: /home/prasanth/ros2/robotic_tray_processor/drake/tools/bazel.rc INFO: Build option --compilation_mode has changed, discarding analysis cache. INFO: Analyzed 9795 targets (143 packages loaded, 29016 targets configured). INFO: Found 9795 targets... ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13: Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: missing input file '//tools/install:installer.py' ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13: Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: 1 input file(s) do not exist ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13 Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: 1 input file(s) do not exist INFO: Elapsed time: 7.483s, Critical Path: 0.01s INFO: 9 processes: 9 internal. FAILED: Build did NOT complete successfully
Please help! Thanks in advance.

Related

Setting up environment for group project, getting error when running "make install"

I am setting up the environment for a group project which requires the "make install" command to install ruby and gems. I had to install an older version of Ruby per the project instructions (Ruby 2.7.2) and had to the following first:
rbenv (brew install rbenv) v1.2.0
Docker v20.10.17
Docker Compose v1.29.2
When I run "make install", I get the following error:
BUILD FAILED (macOS 13.1 using ruby-build 20230208.1)
Inspect or clean up the working tree at /var/folders/7d/ry48j5zs6vl266q1vbfddsy00000gn/T/ruby-build.20230213133620.61947.eKpjSA
Results logged to /var/folders/7d/ry48j5zs6vl266q1vbfddsy00000gn/T/ruby-build.20230213133620.61947.log
Last 10 log lines:
*** Because of configuration changes, you MUST do the following before
*** building:
make depend
Makefile:287: warning: undefined variable `CROSS_COMPILE'
making all in crypto...
/usr/bin/perl ../util/mkbuildinf.pl "clang -I. -I.. -I../include -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "darwin64-x86_64-cc" >buildinf.h
make[2]: *** No rule to make target `x86_64cpuid.o', needed by `../libcrypto.a'. Stop.
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [build_crypto] Error 1
make: *** [install] Error 1`
I have tried several steps found online and still getting the exact same error. If this is not formatted correctly, my apologies! Please let me know and I will edit/update it. Thanks in advance
Tried updating Python to correct version needed for app
Ran bundle and bundale install
Installed SSL
Still can't get past the "make install" error. I tried googling the error, no luck. Should I be doing the setup inside the docker app instead of terminal?

How to use the installed (pre-compiled) drake as external with bazel?

I am working on a C++ project with drake, using bazel as the build system. Previously, I use the drake source code as the external, following the drake_bazel_external example. Everything works fine.
Since I want to use the SNOPT solver in drake, I want to change to use the pre-compiled drake. I follow the drake_bazel_installed example. However, I got the following errors.
Compiling kuka/diffIK_controller.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 27 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/common/default_scalars.h:3,
from bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/systems/framework/leaf_system.h:14,
from ./kuka/diffIK_controller.h:3,
from kuka/diffIK_controller.cc:3:
bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/common/autodiff.h:12:10: fatal error: Eigen/Core: No such file or directory
12 | #include <Eigen/Core>
| ^~~~~~~~~~~~
compilation terminated.
I also find that the apps in the drake_bazel_external cannot be compiled successfully by drake_bazel_installed setting. The error message is
ERROR: error loading package 'app': Label '#drake//tools/skylark:py.bzl' is invalid because 'tools/skylark' is not a package; perhaps you meant to put the colon here: '#drake//:tools/skylark/py.bzl'?
Update
The bug can be produced by both the http_archive fetched drake and the apt installed drake (the latest stable drake I think, since I just installed it yesterday). I have isolated the relevant code to reproduce the bug in a github repo. Currently, I can get the original apps in drake_bazel_installed to work.
Update
By adding
# solve the eigen not found bug
build --cxxopt=-I/usr/include/eigen3
to the .bazelrc file, I can solve the above problem. However, when I try to build a program that uses iiwa_status_receiver.h, I encounter a new problem.
ERROR: /home/chenwang/repro_drake_bazel_external/drake_bazel_installed/apps/BUILD.bazel:102:10: Compiling apps/connection_test.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 32 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from apps/connection_test.cc:10:
bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/manipulation/kuka_iiwa/iiwa_status_receiver.h:6:10: fatal error: drake/lcmt_iiwa_status.hpp: No such file or directory
6 | #include "drake/lcmt_iiwa_status.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
INFO: Elapsed time: 2.967s, Critical Path: 0.24s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
This problem is also a missing header file problem. I have update the github repo to reproduce this problem.
This is a bug in Drake (filed as https://github.com/RobotLocomotion/drake/issues/17965 now).
To work around it, pass --cxxopt=-I/usr/include/eigen3 on all of your bazel commands, e.g., by adding this line to your projects' .bazelrc file:
build --cxxopt=-I/usr/include/eigen3
Edit: The nightly builds of Apt packages as of 20220923 should have this fixed as well.

Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

I am trying to build a django project to push it to an ECR instance but I am having trouble building the project through docker.
Running this command:
docker build -t stuffkeep-docker-app .
Results in this error and I have not found any way to resolve this yet.
Building wheels for collected packages: backports.zoneinfo, django-allauth, django-rest-framework, fcm-django, gcloud, http-ece, jws, py-vapid, pywebpush
Building wheel for backports.zoneinfo (pyproject.toml): started
Building wheel for backports.zoneinfo (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
/tmp/pip-build-env-9x4p5_f7/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/backports
copying src/backports/__init__.py -> build/lib.linux-x86_64-cpython-310/backports
creating build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/__init__.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
running egg_info
writing src/backports.zoneinfo.egg-info/PKG-INFO
writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
writing requirements to src/backports.zoneinfo.egg-info/requires.txt
writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.svg' under directory 'docs'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_output'
adding license file 'LICENSE'
adding license file 'licenses/LICENSE_APACHE'
writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
copying src/backports/zoneinfo/__init__.pyi -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
running build_ext
building 'backports.zoneinfo._czoneinfo' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/lib
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-cpython-310/lib/zoneinfo_module.o -std=c99
lib/zoneinfo_module.c: In function ‘zoneinfo_fromutc’:
lib/zoneinfo_module.c:600:19: error: ‘_PyLong_One’ undeclared (first use in this function); did you mean ‘_PyLong_New’?
600 | one = _PyLong_One;
| ^~~~~~~~~~~
| _PyLong_New
lib/zoneinfo_module.c:600:19: note: each undeclared identifier is reported only once for each function it appears in
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for backports.zoneinfo
and
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects
I am very aware of this question which has the same error but the poster of that is building for Heroku which I am not using and the solutions given are heroku focused.

Error installing SDL-ttf-0.6.2.1 in Haskell: cannot find -lSDL_ttf

I'm running into the following problem trying to cabal install reactive-banana-sdl:
c:/program files/haskell platform/7.10.2-a/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL_ttf
collect2: ld returned 1 exit status
linking dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.o failed (exit code 1)
command was: C:\Program Files\Haskell Platform\7.10.2-a\mingw\bin\gcc.exe dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.o dist\build\Graphics\UI\SDL\TTF\Version_hsc_utils.o -o dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.exe -LC:PFSDL_ttf-2.0.11-win32-x64 -lSDL_ttf -LC:\Users\Owner\AppData\Roaming\cabal\x86_64-windows-ghc-7.10.2\SDL-0.6.5.1-26jmephxohM5v84vz7MqXX -LC:/PF/sdl/lib -lSDL -L/mingw64/lib -lmingw32 -lSDLmain -lSDL -mwindows -LC:\Program Files\Haskell Platform\7.10.2-a\lib\base_GDytRqRVSUX7zckgKqJjgw -lwsock32 -luser32 -lshell32 -LC:\Program Files\Haskell Platform\7.10.2-a\lib\integ_2aU3IZNMF9a7mQ0OzsZ0dS -LC:\Program Files\Haskell Platform\7.10.2-a\lib\ghcpr_8TmvWUcS1U1IKHT0levwg3 -LC:\Program Files\Haskell Platform\7.10.2-a\lib/rts -lm -lwsock32 -lgdi32 -lwinmm
C:\Program Files\Haskell Platform\7.10.2-a\bin\hsc2hs.exe returned ExitFailure 1
Failed to install SDL-ttf-0.6.2.1
What do I do?
Some details: I'm using Windows 7, and doing this in MINGW64. I've installed sdl-ttf through pacman, downloaded SDL_ttf from https://www.libsdl.org/projects/SDL_ttf/release-1.2.html, and replaced SDL_platform.h (https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h) to fix another error ("winapifamily.h: No such file or directory" when compiling SDL in Code::Blocks). I made sure to include extra directories.
cabal install -v3 reactive-banana-sdl --extra-include-dirs=C:\PF\SDL_ttf-2.0.11-win32-x64 --extra-lib-dirs=C:\PF\SDL_ttf-2.0.11-win32-x64

asm/socket.h: No such file or directory cross compiling Dart for Raspberry pi

I'm cross-compiling the Dart runtime using the instruction here.
I've installed all the dependencies as specified. I've also cloned the git repository with the necessary tool chain.
I'm running the runtime compilation with this command:
./tools/build.py -m release -a arm --toolchain=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf runtime
The compilation starts with no problem then it stops with this error:
LINK(target) out/ReleaseXARM/libdart_dependency_helper.target
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from runtime/vm/bootstrap.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from out/ReleaseXARM/obj/gen/async_gen.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
runtime/libdart_lib_withcore.host.mk:978: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o] Error 1
make: *** Waiting for unfinished jobs....
runtime/libdart_lib_withcore.host.mk:986: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o] Error 1
BUILD FAILED
Am I missing any dependency or package?
I hit the same problem. On my ubuntu 14.04 system /usr/include/asm didn't exist. It was called asm-generic instead. I sym-linked it and the build was able to continue.
cd /usr/include
sudo ln -s asm-generic/ asm
The build was able to continue after that.
This is probably because you're trying to build an application without some of the include paths correctly set, for example using a 32-bit gcc on a 64-bit platform.
To resolve:
sudo apt-get install gcc-multilib
I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was:
0 lrwxrwxrwx 1 root root 20 May 22 2013 /usr/include/asm -> x86_64-linux-gnu/asm
And the command to recreate it is:
$ cd /usr/include
$ sudo ln -s x86_64-linux-gnu/asm asm
The files in /usr/include/asm-generic are sometimes, but not always, equivalent to the files in the x86-64 specific directory; so it's difficult to recommend symlinking it as a workaround.

Resources