Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failed Ubuntu 14.04 #6

Closed
nburn42 opened this issue Dec 7, 2016 · 6 comments
Closed

Build Failed Ubuntu 14.04 #6

nburn42 opened this issue Dec 7, 2016 · 6 comments

Comments

@nburn42
Copy link

nburn42 commented Dec 7, 2016

I am running ubuntu 14.04.
I have installed realpath, and checked that I have all dependencies that are listed.
I also ran bazel clean then rerun with the same results.

Thanks

nburn42@Octahedrons:lab$ bazel run :random_agent --define headless=false -- --length=10000 --width=640 --height=480 --verbose_failures
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 1 target...
ERROR: /home/nburn42/Projects/deeprobotics/lab/BUILD:432:1: Linking of rule '//:bspc' failed: namespace-sandbox failed: error executing command /home/nburn42/.cache/bazel/_bazel_nburn42/8ac04bba4272ff63a5f54d73f1af83e1/lab/_bin/namespace-sandbox ... (remaining 20 argument(s) skipped).
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_move.pic.o: In function VectorLength': be_aas_move.c:(.text+0xdf): undefined reference to sqrt'
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_move.pic.o: In function AAS_ApplyFriction': be_aas_move.c:(.text+0x167d): undefined reference to sqrt'
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_move.pic.o: In function AAS_HorizontalVelocityForJump': be_aas_move.c:(.text+0x467e): undefined reference to sqrt'
be_aas_move.c:(.text+0x4740): undefined reference to sqrt' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_reach.pic.o: In function VectorLength':
be_aas_reach.c:(.text+0x67): undefined reference to sqrt' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_reach.pic.o:be_aas_reach.c:(.text+0xd9c): more undefined references to sqrt' follow
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_reach.pic.o: In function AAS_Reachability_Grapple': be_aas_reach.c:(.text+0xf17b): undefined reference to tan'
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/botlib/be_aas_sample.pic.o: In function VectorLength': be_aas_sample.c:(.text+0x67): undefined reference to sqrt'
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/l_math.pic.o: In function AngleVectors': l_math.c:(.text+0x4c): undefined reference to sin'
l_math.c:(.text+0x69): undefined reference to cos' l_math.c:(.text+0xad): undefined reference to sin'
l_math.c:(.text+0xca): undefined reference to cos' l_math.c:(.text+0x112): undefined reference to sin'
l_math.c:(.text+0x12f): undefined reference to cos' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/l_math.pic.o: In function VectorLength':
l_math.c:(.text+0x902): undefined reference to sqrt' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/l_math.pic.o: In function Q_rint':
l_math.c:(.text+0x9c0): undefined reference to floor' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/l_math.pic.o: In function VectorNormalize':
l_math.c:(.text+0xdf5): undefined reference to sqrt' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/l_math.pic.o: In function VectorNormalize2':
l_math.c:(.text+0xf1d): undefined reference to sqrt' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/map.pic.o: In function WriteMapBrush':
map.c:(.text+0x2a3b): undefined reference to atan2' map.c:(.text+0x2b2f): undefined reference to atan2'
bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/bspc/textures.pic.o: In function TexinfoForBrushTexture': textures.c:(.text+0x793): undefined reference to sin'
textures.c:(.text+0x7b3): undefined reference to cos' bazel-out/local-fastbuild/bin/_objs/bspc/engine/code/qcommon/cm_patch.pic.o: In function VectorLength':
cm_patch.c:(.text+0x67): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Target //:random_agent failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.866s, Critical Path: 1.26s
ERROR: Build failed. Not running target.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Dec 7, 2016

Can you try adding -lm to the relevant linkopts?

@nburn42
Copy link
Author

nburn42 commented Dec 7, 2016

Thanks that helped some.

This command now works.

lab$ bazel run :random_agent --define headless=false -- \
               --length=10000 --width=640 --height=480

But this command results in an error.

lab$ bazel run :game -- --level_script tests/demo_map

What I did.
I added -lm to bspc as below, which resulted in the following error.

I tried both

linkopts = ["-pthread", "-lm"],

and

linkopts = ["-lm", "-pthread"],

with bazel cleans.

Thanks

cc_binary(
    name = "bspc",
    srcs = glob([
        CODE_DIR + "/botlib/*.h",
        CODE_DIR + "/qcommon/*.h",
    ]) + [
        CODE_DIR + "/botlib/be_aas_bspq3.c",
        CODE_DIR + "/botlib/be_aas_cluster.c",

        . . .

       "-DQDECL=",
        "-pthread",
    ],
    linkopts = ["-pthread", "-lm"],
    visibility = ["//deepmind/level_generation:__subpackages__"],
    deps = ["@zlib_archive//:zlib"],
)

ERROR: /home/nburn42/Projects/deeprobotics/lab/BUILD:899:1: Linking of rule '//:game' failed: namespace-sandbox failed: error executing command /home/nburn42/.cache/bazel/_bazel_nburn42/8ac04bba4272ff63a5f54d73f1af83e1/lab/_bin/namespace-sandbox ... (remaining 19 argument(s) skipped).
/usr/bin/ld: bazel-out/local-fastbuild/bin/libgame_lib_sdl.a(cl_input.pic.o): undefined reference to symbol 'powf@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Target //:game failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 193.349s, Critical Path: 178.77s
ERROR: Build failed. Not running target.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Dec 7, 2016

Interesting. Can you remove the linker script from the DSO build rule? We were trying to isolate the DSO as much as possible, since we don't have a lot of control over all the external names in it, but it may be interfering here. Alternatively, try adding -lm also to the DSO build rule.

@nburn42
Copy link
Author

nburn42 commented Dec 19, 2016

Sorry about the delay.

I found that linking the math library into :game fixed my second issue.
It fixed the problems on both ubuntu 16.04 and 14.04.

All the bazel commands on the instructions now work.
I submitted a pull request with the change.

Thanks for the help.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Dec 20, 2016

We will make a change similar to the one proposed in #12 in the future, which should address this. Thanks for raising!

@tkoeppe
Copy link
Collaborator

tkoeppe commented Dec 20, 2016

Fixed by d6b1afc.

@tkoeppe tkoeppe closed this as completed Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants