make command fails
69sparrow69 opened this issue · 9 comments
I installed libations, jsconcpp, libpcap-dev but when I run the make command in the "build" directory inside dublin-traceroute, it fails.
ubuntu:~/dublin-traceroute/build$ make [ 12%] Building CXX object CMakeFiles/dublintraceroute.dir/src/common.cc.o In file included from /home/ubuntu/dublin-traceroute/src/common.cc:16:0: /home/ubuntu/dublin-traceroute/include/dublintraceroute/common.h:23:23: fatal error: tins/tins.h: No such file or directory compilation terminated. CMakeFiles/dublintraceroute.dir/build.make:62: recipe for target 'CMakeFiles/dublintraceroute.dir/src/common.cc.o' failed make[2]: *** [CMakeFiles/dublintraceroute.dir/src/common.cc.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dublintraceroute.dir/all' failed make[1]: *** [CMakeFiles/dublintraceroute.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
This is running on AWS, on an Ubuntu 16.04.6 LTS xenial. Will I need to RDP into it, to be able to see the graphical representation of the Traceroute?
Help would be appreciated.
The error message says
fatal error: tins/tins.h: No such file or directory
which means you're missing the libtins headers. They can be installed with the libtins-dev
package.
To see the visual traceroute just follow the instructions after running the tool. It will suggest you to transform the JSON output to a PNG by using the Python bindings, which in turn require graphviz (libraries and tools).
I'm closing this issue, feel free to reopen if it doesn't solve it for you.
I just realized that "libations" in your request was actually "libtins". So you may just have the wrong version: dublin-traceroute requires libtins 3.4 as indicated in CMakeLists.txt. Can you check your installed version ?
Hey insomiacslk, I really appreciate you helping me out with this. I'm using it for a school project and it'll really make things so much better! I had the latest version installed (4.x). I pulled 3.4 and built it.
Then I went to libtin's page and realized I needed to run:
sudo make install
sudo ldconfig
Then I went to my dublin folder and did the make command and voila:
$ make
[ 12%] Building CXX object CMakeFiles/dublintraceroute.dir/src/common.cc.o
[ 25%] Building CXX object CMakeFiles/dublintraceroute.dir/src/dublin_traceroute.cc.o
[ 37%] Building CXX object CMakeFiles/dublintraceroute.dir/src/hop.cc.o
[ 50%] Building CXX object CMakeFiles/dublintraceroute.dir/src/udpv4probe.cc.o
[ 62%] Building CXX object CMakeFiles/dublintraceroute.dir/src/traceroute_results.cc.o
[ 75%] Linking CXX shared library libdublintraceroute.so
[ 75%] Built target dublintraceroute
Scanning dependencies of target dublin-traceroute
[ 87%] Building CXX object CMakeFiles/dublin-traceroute.dir/src/main.cc.o
[100%] Linking CXX executable dublin-traceroute
[100%] Built target dublin-traceroute
I made sure I removed any old libtin/dublin folder and did the git clone, cmake and make from the beginning. Thanks for your help again, you're doing a fantastic job! :)
Christ, it finally worked. Will keep you posted if anything comes up.
In order to use the Python bindings, I added unstable + testing repos and then ran this command from the python git:
apt-get install libpcap-dev libjsoncpp-dev libtins-dev libdublintraceroute-dev
But then I get the following errors:
$ python3 -m dublintraceroute plot trace.json
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.5/dist-packages/dublintraceroute-0.4.2-py3.5-linux-x86_64.egg/dublintraceroute/__init__.py", line 5, in <module>
from .dublintraceroute import (
File "/usr/local/lib/python3.5/dist-packages/dublintraceroute-0.4.2-py3.5-linux-x86_64.egg/dublintraceroute/dublintraceroute.py", line 8, in <module>
from .tracerouteresults import TracerouteResults
File "/usr/local/lib/python3.5/dist-packages/dublintraceroute-0.4.2-py3.5-linux-x86_64.egg/dublintraceroute/tracerouteresults.py", line 9, in <module>
import tabulate
ImportError: No module named 'tabulate'
$ python -m dublintraceroute plot trace.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "build/bdist.linux-x86_64/egg/dublintraceroute/__init__.py", line 5, in <module>
File "build/bdist.linux-x86_64/egg/dublintraceroute/dublintraceroute.py", line 8, in <module>
File "build/bdist.linux-x86_64/egg/dublintraceroute/tracerouteresults.py", line 9, in <module>
ImportError: No module named tabulate
I see you sorted things out, good job! If you don't need the latest code and don't need to make any changes there is also a (not too recent) Debian package that you can install with apt install dublin-traceroute
. Similarly I packages and uploaded the python library on pypi, so a pip install dublintraceroute
should sort you out also for the python bindings. At first I didn't think of suggesting it, anyway I always recommend using the latest code.
Another option is using the Go implementation of the tool, that you can find under the go
subdirectory. To install it, you can either run go get github.com/insomniacslk/dublin-traceroute/go/dublintraceroute/cmd/dublin-traceroute
, or run go get -u ./... && go build
in that subdirectory in the checked out repo.
I am maintaining both implementations at the moment, but I'm adding new features only to the Go version. At some point I think the C++ implementation will go away, and the features from the python bindings will also merge in the Go program.
Let me know if I can help with your school project!
Hey,
I'm trying this install on another machine (just Dublin, not the Python version). I keep getting this error when I run the 'make' command from the build folder.
$ make
Scanning dependencies of target dublintraceroute
[ 16%] Building CXX object CMakeFiles/dublintraceroute.dir/src/common.cc.o
[ 33%] Building CXX object CMakeFiles/dublintraceroute.dir/src/dublin_traceroute.cc.o
[ 50%] Building CXX object CMakeFiles/dublintraceroute.dir/src/hop.cc.o
[ 66%] Building CXX object CMakeFiles/dublintraceroute.dir/src/udpv4probe.cc.o
[ 83%] Building CXX object CMakeFiles/dublintraceroute.dir/src/traceroute_results.cc.o
Linking CXX shared library libdublintraceroute.so
/usr/bin/ld: /usr/local/lib/libtins.a(icmp_extension.cpp.o): relocation R_X86_64_32S against `_ZTVN4Tins16malformed_packetE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libtins.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libdublintraceroute.so.0.1.1] Error 1
make[1]: *** [CMakeFiles/dublintraceroute.dir/all] Error 2
make: *** [all] Error 2
So I tried running:
make clean
make CXXFLAGS="$CXXFLAGS -fPIC"
I have libpcap-dev, libtins v3.4 and libjsoncpp-dev installed. But I still get the same error. I've spent a few hours trying to fix this, and perhaps fixing this issue will help others as well.
Any help is appreciated.
I believe that is libtins that should be recompiled with -fPIC. Can you try that and let me know?
Hello insomniacslk,
I tried to have the flag for libtins, but I was not successful. Let me get back to you later perhaps? Thanks a lot for your prompt replies man, the tool is super cool!
Sure. I noticed that it tries to use the archive file (libtins.a) instead of the shared object. So the suggestion to recompile with-fPIC may be a red herring. Can you make sure that your installation of libtins is actually including the .so file?