Can't make Clockwordmod Tether on Ubuntu 16.10
I'm trying to install Clockwordmod Tether on my Ubuntu 16.10 laptop in order to facilitate USB tethering with the corresponding app on Google Play.
I've downloaded and extracted the Tether tar file. The instructions for installation are very simple. Just run the following in a terminal:
cd /home/username/Tether/node
./configure
make
But when I run make
, it always ends in this error:
../deps/v8/src/checks.h:251:22: warning: typedef ‘__StaticAssertTypedef__125’ locally defined but not used [-Wunused-local-typedefs]
SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
^
../deps/v8/src/checks.h:241:39: note: in definition of macro ‘SEMI_STATIC_JOIN_HELPER’
#define SEMI_STATIC_JOIN_HELPER(a, b) a##b
^
../deps/v8/src/checks.h:251:5: note: in expansion of macro ‘SEMI_STATIC_JOIN’
SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
^~~~~~~~~~~~~~~~
../deps/v8/src/checks.h:283:30: note: in expansion of macro ‘STATIC_CHECK’
#define STATIC_ASSERT(test) STATIC_CHECK(test)
^~~~~~~~~~~~
../deps/v8/src/v8utils.h:125:3: note: in expansion of macro ‘STATIC_ASSERT’
STATIC_ASSERT(sizeof(T) == kPointerSize);
^~~~~~~~~~~~~
In file included from ../deps/v8/src/elements.h:32:0,
from ../deps/v8/src/objects-inl.h:38,
from ../deps/v8/src/v8.h:60,
from ../deps/v8/src/accessors.cc:28:
../deps/v8/src/objects.h: At global scope:
../deps/v8/src/objects.h:5017:44: error: left operand of shift expression ‘(-1 << 3)’ is negative [-fpermissive]
static const int kElementsKindMask = (-1 << kElementsKindShift) &
~~~~^~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/objects.h:7152:36: error: left operand of shift expression ‘(-8 << 26)’ is negative [-fpermissive]
(~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/v8/tools/gyp/v8_base.target.mk:209: recipe for target '/home/username/Tether/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o' failed
make[1]: *** [/home/username/Tether/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o] Error 1
make[1]: Leaving directory '/home/username/Tether/node/out'
Makefile:26: recipe for target 'node' failed
make: *** [node] Error 2
Looking on the net, it was suggested to install the following:
sudo apt-get install libssl-dev cmake g++ lib32ncurses5 nodejs-legacy
But this didn't help. I also saw that it might have something to do with a Python version issue, but I could not find user level instructions on how to deal with that.
Is there a way I can resolve this and install Tether on my Ubuntu laptop? And is the solution something that can be explained in terms that someone who knows nothing about configure
or make
can understand?
Update:
Thanks to DropHammer99's answer below, it seems I was able to successfully compile the program. This is how the XXFLAGS=-fpermissive make
command ended after a few minutes:
LINK(target) /home/username/Tether/node/out/Release/node: Finished
touch /home/username/Tether/node/out/Release/obj.target/node_dtrace_header.stamp
touch /home/username/Tether/node/out/Release/obj.target/node_dtrace_provider.stamp
touch /home/username/Tether/node/out/Release/obj.target/node_dtrace_ustack.stamp
touch /home/username/Tether/node/out/Release/obj.target/node_etw.stamp
make[1]: Leaving directory '/home/username/Tether/node/out'
ln -fs out/Release/node node
Unfortunately, though, when I first ran the program as instructed in the README
file, it crashed with this error:
~/Tether$ sudo linux/run.sh
[sudo] password for username:
~/Tether
Starting Tether...
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
linux/run.sh: line 39: 21096 Segmentation fault (core dumped) $NODE/node tether.js
Is this program just not going to work, or is there something I can do to resolve this segmentation fault error?
Solution 1:
That error is the C++ compiler complaining about some usable but less than ideal code. With the right command line options, you can tell the compiler to ignore code issues like that and keep going. This isn't always the best solution, but it will get things to compile and work.
First, run make clean
to get rid of anything left behind from your old build attempt.
Then, run CXXFLAGS=-fpermissive make
to try again with the C++ compiler downgrading those code issues to warnings.
I was able to reproduce your error on my 64-bit 16.10 install, and this workaround allowed the build to get past that error for me.
Unfortunately, the build seemed to fail further along with this issue:
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory '/home/username/work/Tether/node/out'
LD_LIBRARY_PATH=/home/username/work/Tether/node/out/Release/lib.host:/home/username/work/Tether/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /home/username/work/Tether/node/out/Release/obj.target/v8_snapshot/geni; "/home/username/work/Tether/node/out/Release/mksnapshot" --log-snapshot-positions --logfile "/home/username/work/Tether/node/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/home/username/work/Tether/node/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
Segmentation fault (core dumped)
deps/v8/tools/gyp/v8_snapshot.target.mk:13: recipe for target '/home/username/work/Tether/node/out/Release/obj.target/v8_snapshot/geni/snapshot.cc' failed
make[1]: *** [/home/username/work/Tether/node/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 139
make[1]: Leaving directory '/home/username/work/Tether/node/out'
Makefile:26: recipe for target 'node' failed
make: *** [node] Error 2
I'm still looking into that issue. Try the initial workaround, as maybe your system won't hit the second issue that mine did.
Update: I was able to sidestep that second issue by telling the config tool to skip the snapshot step. Unfortunately, I have no idea what the snapshot step is supposed to do, and am afraid I might just be postponing a failure until later. If you want to try this second workaround too, here is a command sequence to try:
make distclean
./configure --without-snapshot
CXXFLAGS=-fpermissive make
Solution 2:
It seems that Clockwordmod Tether linux app is out-of-date and needs a significant maintenance. I have compiled node with help of above answers. But it gave
linux/run.sh: line 39: 25901 Segmentation fault $NODE/node tether.js
error. When I check its node version, I saw that v0.8.14. This version is very very old that it's out of documentation. When I edited run.sh file and make it use my system installed nodejs (v4.8.2), it failed message:
[TypeError: os.setupTun is not a function]
As being gnu/linux users, we need to find another alternative up-to-date solution this application!
Solution 3:
I have a fix for now.
- Go in file:
spaces.cc
innode/deps/v8/src
- Go to function:
bool PagedSpace::AdvanceSweeper
(approximately line 2274) - Add
return true;
at the beginning of the method.
Do:
make distclean
./configure --without-snapshot
CXXFLAGS=-fpermissive make
Run tether:
sudo linux/run.sh
It connects and is in the network manager!