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

fails to build on ubuntu 17.10 #2

Closed
tazhate opened this issue May 16, 2018 · 6 comments
Closed

fails to build on ubuntu 17.10 #2

tazhate opened this issue May 16, 2018 · 6 comments

Comments

@tazhate
Copy link

tazhate commented May 16, 2018

➜  tcpbench git:(master) make                              
cc -g -O2 -Wall -levent -o tcpbench tcpbench.c
/tmp/ccDx1Nre.o: In function `set_slice_timer':
/home/taz/tcpbench/tcpbench.c:277: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:284: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:285: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:283: undefined reference to `event_add'
/tmp/ccDx1Nre.o: In function `tcp_server_handle_sc':
/home/taz/tcpbench/tcpbench.c:438: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:442: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:443: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:444: undefined reference to `event_add'
/tmp/ccDx1Nre.o: In function `tcp_server_accept':
/home/taz/tcpbench/tcpbench.c:469: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:496: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:498: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:481: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:482: undefined reference to `event_add'
/tmp/ccDx1Nre.o: In function `main':
/home/taz/tcpbench/tcpbench.c:885: undefined reference to `event_init'
/home/taz/tcpbench/tcpbench.c:886: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:887: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:888: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:889: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:890: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:891: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:899: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:911: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:912: undefined reference to `event_add'
/tmp/ccDx1Nre.o: In function `client_init':
/home/taz/tcpbench/tcpbench.c:668: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:670: undefined reference to `event_add'
/tmp/ccDx1Nre.o: In function `main':
/home/taz/tcpbench/tcpbench.c:918: undefined reference to `event_dispatch'
/home/taz/tcpbench/tcpbench.c:902: undefined reference to `event_set'
/tmp/ccDx1Nre.o: In function `server_init':
/home/taz/tcpbench/tcpbench.c:569: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:571: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:568: undefined reference to `event_set'
collect2: error: ld returned 1 exit status
Makefile:6: ошибка выполнения рецепта для цели «all»
make: *** [all] Ошибка 1
➜  tcpbench git:(master) make -v
GNU Make 4.1
Эта программа собрана для x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Лицензия GPLv3+: GNU GPL версии 3 или новее <http://gnu.org/licenses/gpl.html>
Это свободное программное обеспечение: вы можете свободно изменять его и
распространять. НЕТ НИКАКИХ ГАРАНТИЙ вне пределов, допустимых законом.
➜  tcpbench git:(master) cat /etc/*issue*
Ubuntu 17.10 \n \l

Ubuntu 17.10
➜  tcpbench git:(master) gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3.2' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2) 
@NanXiao
Copy link
Owner

NanXiao commented May 17, 2018

I think the reason is you don't install libevent: https://packages.ubuntu.com/artful/libevent-2.1-6.

@tazhate
Copy link
Author

tazhate commented May 17, 2018

nope. it is installed.

➜  tcpbench git:(master) sudo apt-get install libevent-2.1.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libevent-2.1-6' for regex 'libevent-2.1.6'
libevent-2.1-6 is already the newest version (2.1.8-stable-4).
The following packages were automatically installed and are no longer required:
  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libboost-regex1.62.0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
➜  tcpbench git:(master) make
cc -g -O2 -Wall -levent -o tcpbench tcpbench.c
/tmp/ccicwyGR.o: In function `set_slice_timer':
/home/taz/tcpbench/tcpbench.c:277: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:284: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:285: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:283: undefined reference to `event_add'
/tmp/ccicwyGR.o: In function `tcp_server_handle_sc':
/home/taz/tcpbench/tcpbench.c:438: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:442: undefined reference to `event_pending'
/home/taz/tcpbench/tcpbench.c:443: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:444: undefined reference to `event_add'
/tmp/ccicwyGR.o: In function `tcp_server_accept':
/home/taz/tcpbench/tcpbench.c:469: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:496: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:498: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:481: undefined reference to `event_del'
/home/taz/tcpbench/tcpbench.c:482: undefined reference to `event_add'
/tmp/ccicwyGR.o: In function `main':
/home/taz/tcpbench/tcpbench.c:885: undefined reference to `event_init'
/home/taz/tcpbench/tcpbench.c:886: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:887: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:888: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:889: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:890: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:891: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:899: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:911: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:912: undefined reference to `event_add'
/tmp/ccicwyGR.o: In function `client_init':
/home/taz/tcpbench/tcpbench.c:668: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:670: undefined reference to `event_add'
/tmp/ccicwyGR.o: In function `main':
/home/taz/tcpbench/tcpbench.c:918: undefined reference to `event_dispatch'
/home/taz/tcpbench/tcpbench.c:902: undefined reference to `event_set'
/tmp/ccicwyGR.o: In function `server_init':
/home/taz/tcpbench/tcpbench.c:569: undefined reference to `event_set'
/home/taz/tcpbench/tcpbench.c:571: undefined reference to `event_add'
/home/taz/tcpbench/tcpbench.c:568: undefined reference to `event_set'
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 1
➜  tcpbench git:(master) 

@NanXiao
Copy link
Owner

NanXiao commented May 17, 2018

Could you try:

cc -g -O2 -Wall -o tcpbench tcpbench.c -levent

Thanks!

@tazhate
Copy link
Author

tazhate commented May 17, 2018

➜  tcpbench git:(master) cc -g -O2 -Wall -o tcpbench tcpbench.c -levent

➜  tcpbench git:(master) 

@NanXiao
Copy link
Owner

NanXiao commented May 17, 2018

Yes, according to this post, Ubuntu compiler has its own characteristic. Tomorrow I will modify the Makefile to adapt to Ubuntu and do some tests.

@NanXiao
Copy link
Owner

NanXiao commented May 18, 2018

@tazhate I update the Makefile and close this issue, you can submit new issue once find other errors, thanks!

@NanXiao NanXiao closed this as completed May 18, 2018
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