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

error building on ubuntu 14.04 #293

Closed
zoff99 opened this issue Nov 27, 2016 · 30 comments
Closed

error building on ubuntu 14.04 #293

zoff99 opened this issue Nov 27, 2016 · 30 comments
Labels
P3 Low priority
Milestone

Comments

@zoff99
Copy link

zoff99 commented Nov 27, 2016

the problem is at building toxav:

[ 30%] Building C object CMakeFiles/toxav_shared.dir/toxav/audio.c.o
In file included from /home/ubuntu/c-toxcore/toxav/audio.c:28:0:
/home/ubuntu/c-toxcore/toxav/rtp.h:43:5: error: type of bit-field ‘cc’ is a GCC extension [-Werror=pedantic]
     uint16_t cc: 4; /* Contributing sources count */
     ^
/home/ubuntu/c-toxcore/toxav/rtp.h:44:5: error: type of bit-field ‘xe’ is a GCC extension [-Werror=pedantic]
     uint16_t xe: 1; /* Extra header */
     ^
/home/ubuntu/c-toxcore/toxav/rtp.h:45:5: error: type of bit-field ‘pe’ is a GCC extension [-Werror=pedantic]
     uint16_t pe: 1; /* Padding */
     ^
/home/ubuntu/c-toxcore/toxav/rtp.h:46:5: error: type of bit-field ‘ve’ is a GCC extension [-Werror=pedantic]
     uint16_t ve: 2; /* Version */
     ^
/home/ubuntu/c-toxcore/toxav/rtp.h:48:5: error: type of bit-field ‘pt’ is a GCC extension [-Werror=pedantic]
     uint16_t pt: 7; /* Payload type */
     ^
/home/ubuntu/c-toxcore/toxav/rtp.h:49:5: error: type of bit-field ‘ma’ is a GCC extension [-Werror=pedantic]
     uint16_t ma: 1; /* Marker */
     ^
cc1: error: unrecognized command line option "-Wno-used-but-marked-unused" [-Werror]
cc1: error: unrecognized command line option "-Wno-unreachable-code-return" [-Werror]
cc1: error: unrecognized command line option "-Wno-shorten-64-to-32" [-Werror]
cc1: error: unrecognized command line option "-Wno-reserved-id-macro" [-Werror]
cc1: error: unrecognized command line option "-Wno-gnu-zero-variadic-macro-arguments" [-Werror]
cc1: error: unrecognized command line option "-Wno-assign-enum" [-Werror]
cc1: error: unrecognized command line option "-Wno-tautological-constant-out-of-range-compare" [-Werror]
cc1: error: unrecognized command line option "-Wno-documentation-deprecated-sync" [-Werror]
cc1: error: unrecognized command line option "-Wno-covered-switch-default" [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/toxav_shared.dir/toxav/audio.c.o] Error 1
make[1]: *** [CMakeFiles/toxav_shared.dir/all] Error 2
make: *** [all] Error 2

make returned exit code 2

Action failed: make

see my build commands here:
https://circleci.com/gh/zoff99/c-toxcore/7

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

do you know what the problem is?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Well, your output tells precisely what the problem is. Compilation fails because of the warnings, which were made to be treated as errors with -Werror.

Just add -DWARNINGS=OFF to your cmake command.

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

shouldn't the problem be fix in the source?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Yeah, the build system should be fixed.

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

@zoff99 does the compilation still fail if you do a clean build with the line containing -Werror in CMakeLists.txt removed?

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

cmake -DWARNINGS=OFF works.
but i thought since this is a crypto code, maybe somebody should actually fix code so that there a no more warnings? and leave the settings alone

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Yes, the code which triggers these warnings should be fixed. No, this is not the code that deals with the crypto, toxav only handles audio/video. Also, even if all the warnings are fixed in the code, the compilation would still fail because of the unrecognized warning flags, so fixing the code alone is not enough. @iphydf can we somehow query the compiler if it supports a certain warning flag?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Hm, interesting, it looks like add_cflag() and add_cxxflag() are supposed to set the flags only if the compiler supports them, yet you got unrecognized command line option.

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

maybe the gcc version is old on circleCI ? do you need a specific version of GCC ?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

@iphydf is the guy to ask this about.

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

We build the library on Travis CI with gcc 4.6.3 and clang 3.4, there are no warnings produced during the builds.

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

What version of gcc does circleCI use?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

I also don't get any warnings with gcc version 4.9.2 (Debian 4.9.2-10).

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

how do i get the clang version?

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Just pass --version to the clang.

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

ok then clang is not installed :-)
maybe thats the issue. let me check ...

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Why would that be an issue? clang is just a different compiler.

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

clang --version ; exit 1

bash: line 1: clang: command not found

clang --version ; exit 1 returned exit code 1

Action failed: clang --version ; exit 1

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

ok. now this looks better:

Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

@nurupo
Copy link
Member

nurupo commented Nov 27, 2016

Did you compile with clang instead of gcc this time?

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

when compiling with clang the errors are gone.
strange that it does not work with gcc

@zoff99
Copy link
Author

zoff99 commented Nov 27, 2016

thanks for the help, guys

@zoff99
Copy link
Author

zoff99 commented Nov 28, 2016

now the network test fails on CI. is there anything special that needs to be installed/setup for that test?

93% tests passed, 1 tests failed out of 15

Total Test time (real) = 209.03 sec

The following tests FAILED:
	  7 - network (Failed)
Errors while running CTest
make: *** [test] Error 8

make test returned exit code 2

all details:
https://circleci.com/gh/zoff99/c-toxcore/15

@nurupo
Copy link
Member

nurupo commented Nov 28, 2016

See the output of the tests as to why it has failed. Also, why are you setting up CircleCI for toxcore? We already have a quite complicated TravisCI setup which we maintain, it compiles toxcore for windows, os x and linux, in linux's case it does so against several compilers and using both builds systems toxcore supports. You could just used the already existing TravisCI setup.

@zoff99
Copy link
Author

zoff99 commented Nov 28, 2016

circleCI has a few advantages. but anyhow, i should be able to do this without much fuzz.
i did not expect there to be some many hurdles :-)

@nurupo
Copy link
Member

nurupo commented Nov 28, 2016

Hm, in your GitHub history I see you are making a lot of single contributions to different Android projects, mostly just adding CircleCI integration for them. If you want to add CircleCI for toxcore, you probably should have created an issue about it first, asking if that's something we would want.

@zoff99
Copy link
Author

zoff99 commented Nov 28, 2016

actually in this case i don't. i am trying to compile 2 projects from source which require toxcore. so i start with toxcore

@nurupo
Copy link
Member

nurupo commented Nov 28, 2016

A bit of off-topic, just some advises based on your GitHub profile.

I see that you do a lot of small messy commits with uninformative commit messages like "fix", "fix 2", "fix 3" and you do them by the most part from the GitHub web interface (the commits have "committed on GitHub"). Firstly, you should try to have a single commit per a meaningfully complete change. The many "fix" commits you have could have been combined into a single commit. Secondly, the commit messages should be meaningful, e.g. "Add CircleCI integration" instead of just "add" or "fix". Thirdly, you should really learn how to use the command line git program, or at least some GUI around it. This would allow you to squash multiple commits together, which is useful if you realize that your previous commit didn't do the job and you want to add more to it, like in the case of "fix", "fix 2", "fix 3", it also allows to modify commit messages and much more. Fourthly, you also seem to keep forks of some repositories and update those forks with upstream by making PRs to your forks with the changes from upstream, creating merge commits. That's a very weird way of keeping your forks up-to-date with upstream, you could have done so with the git command line program in 2 commands and you would avoid any merge commits, i.e. your fork would be completely identical with the upstream repository, but the way you do it you have merge commits for your own PRs.

@iphydf iphydf added this to the v0.0.6 milestone Dec 2, 2016
@iphydf iphydf added this to the v0.0.6 milestone Dec 2, 2016
@zoff99 zoff99 closed this as completed Dec 3, 2016
@nurupo
Copy link
Member

nurupo commented Dec 7, 2016

@iphydf any idea why gcc 4.8.4 on Ubuntu 14.04 was giving @zoff99 warnings in toxav (see the initial post in this thread)? If there are warning in toxav, we got to fix them.

Also, any idea and why cmake was passing unsupported warning flags to the compiler (see the initial post in this thread), while I didn't get any warnings on gcc 4.9.2? Do HAVE_CXX${var} things cmake does in order to check if a compiler supports warnings not work for gcc 4.8.4? It would be surprising if that's the case as gcc 4.8.4 doesn't seem that old, it even supports c++11.

@iphydf iphydf modified the milestones: v0.0.6, v0.1.0 Dec 10, 2016
@iphydf iphydf added the P3 Low priority label Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority
Projects
None yet
Development

No branches or pull requests

4 participants
@nurupo @zoff99 @iphydf and others