Blockstream / satellite

Blockstream Satellite
https://blockstream.github.io/satellite/
GNU General Public License v3.0
977 stars 152 forks source link

Installation of TSDuck from the sources #49

Closed VDelport closed 4 years ago

VDelport commented 4 years ago

Hello, I'm trying to install the new version of blocksat, for reception with the RTL-SDR and by compiling the sources. The TSDuck installation guide states:

'And then add the following to your .bashrc: source ~ / .blocksat / src / tsduck / src / tstools / release-x86_64 / setenv.sh'

But this directory does not exist or is not created.

On the TSDuck website (https://tsduck.io/doxy/building.html) it says: 'The TSDuck binaries, executables and shared objects (.so), are built in directories bin/release-i386-hostname, bin/release-x86_64-hostname and bin/release-arm-hostname for Intel 32-bit, 64-bit and ARM platforms respectively. '

It is the same after my installation.

blockstreamsatellite commented 4 years ago

@VDelport Thanks for reporting the issue.

There was a recent update on TSDuck that changed the paths where the setenv.sh script is located. To cope with that, we have recently pushed an update changing the paths where we expect to place binaries. The update was on commit https://github.com/Blockstream/satellite/commit/e791ba3302abc49fcdc557b07815b9da3ba12684.

Based on the fact that you are experiencing this issue, I assume you didn't use the automatic installation of dependencies using command blocksat-cli deps install and instead tried to compile and install from source manually. Unfortunately, the manual compilation instructions were missing the path updates. We have just updated them, and you can see them at https://github.com/Blockstream/satellite/blob/master/doc/sdr.md#further-information

The main modification is that binaries are now expected to be at ~/.blocksat/usr/bin instead of ~/.blocksat/bin. Furthermore, we don' rely on the setenv.sh script from TSDuck anymore. So if you did add that to your ~/.bashrc, you can remove it now. Instead of relying on this script, now we actually install TSDuck into ~/.blocksat/usr, by running an extra step that didn't exist in the instructions before:

make install SYSPREFIX=$HOME/.blocksat/usr

Note the path changes are also the reason why you have the problem reported in #50 .

If you want a quick solution, I would recommend the following sequence:

  1. Remove the ~/.blocksat/bin directory that is not used anymore: rm -r ~/.blocksat/bin
  2. Remove the setenv.sh line from your .bashrc, as it is also not used anymore
  3. Run blocksat-cli deps install

Alternatively, instead of running step 3, manually run only the installation steps again, as follows:

mkdir -p ~/.blocksat/usr/bin
cd ~/.blocksat/src/leansdr/src/apps
install leandvb ~/.blocksat/usr/bin
cd ../../LDPC/
install ldpc_tool ~/.blocksat/usr/bin
cd ~/.blocksat/src/tsduck
make install SYSPREFIX=$HOME/.blocksat/usr

Note that command blocksat-cli deps install runs the sequence in https://github.com/Blockstream/satellite/blob/master/blocksatcli/dependencies.py#L25, so it is essentially the same as building and installing everything manually.

VDelport commented 4 years ago

@blockstreamsatellite Thank you. After make install SYSPREFIX=$HOME/.blocksat/usr follows this: /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found make -C src install /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found [DEP] dtv/static/tsStaticReferencesDVB.cpp [DEP] tsduck.cpp /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found install -d -m 755 /home/delport/.blocksat/usr/bin rm -f \ /home/delport/.blocksat/usr/bin/tsduck.xml \ /home/delport/.blocksat/usr/bin/tsduck.channels.xml \ /home/delport/.blocksat/usr/bin/tsduck.dvb.names install -m 644 \ /home/delport/.blocksat/src/tsduck/bin/release-x86_64-pc_name/tsduck.so \ dtv/tsduck.keytable.model.xml dtv/tsduck.hfbands.xml dtv/tsduck.lnbs.model.xml dtv/tsduck.channels.model.xml dtv/tsduck.hfbands.model.xml dtv/tsduck.lnbs.xml dtv/tsduck.tables.model.xml dtv/tsduck.names dtv/tsduck.oui.names \ /home/delport/.blocksat/usr/bin /bin/bash: curl-config: command not found /bin/bash: curl-config: command not found [CXX] tsplugin_teletext.cpp In file included from /home/delport/.blocksat/src/tsduck/src/libtsduck/base/tsUChar.h:37:0, from /home/delport/.blocksat/src/tsduck/src/libtsduck/base/tsUString.h:36, from /home/delport/.blocksat/src/tsduck/src/libtsduck/base/tsReport.h:36, from /home/delport/.blocksat/src/tsduck/src/libtsduck/base/tsArgs.h:36, from /home/delport/.blocksat/src/tsduck/src/libtsduck/plugin/tsPlugin.h:36, from /home/delport/.blocksat/src/tsduck/src/libtsduck/plugin/tsInputPlugin.h:36, from /home/delport/.blocksat/src/tsduck/src/libtsduck/plugin/tsPluginRepository.h:36, from tsplugin_teletext.cpp:35: /home/delport/.blocksat/src/tsduck/src/libtsduck/base/tsPlatform.h:871:10: fatal error: winscard.h: No such file or directory

include

      ^~~~~~~~~~~~

compilation terminated. ../../Makefile.common:936: recipe for target '/home/delport/.blocksat/src/tsduck/bin/release-x86_64-pc_name/objs-tsplugins/tsplugin_teletext.o' failed make[2]: [/home/delport/.blocksat/src/tsduck/bin/release-x86_64-pc_name/objs-tsplugins/tsplugin_teletext.o] Error 1 Makefile:47: recipe for target 'install' failed make[1]: [install] Error 2 Makefile:90: recipe for target 'install' failed make: *** [install] Error 2

blockstreamsatellite commented 4 years ago

@VDelport When running the instructions for the first time, did you run the step below?

build/install-prerequisites.sh

Note this should be executed after cd ~/.blocksat/src/tsduck. See the SDR guide.

This script (install-prerequisites.sh) should install the required libraries. It seems the one that is missing is libpcsclite-dev (in Ubuntu).

VDelport commented 4 years ago

@blockstreamsatellite

When running the instructions for the first time, did you run the step below? build/install-prerequisites.sh Yes I did. I use Linux Mint.

blockstreamsatellite commented 4 years ago

@VDelport Right. See if you can install the equivalent of libpcsclite-dev on Linux Mint.

You can see the list of packages that are installed by the install-prerequisites.sh script in the following link:

https://github.com/tsduck/tsduck/blob/master/build/install-prerequisites.sh#L123

blockstreamsatellite commented 4 years ago

@VDelport We've just investigated your issue further. Could you confirm whether command lsb_release is available on your OS?

The problem if lsb_release is not available (on Ubuntu/Debian based distros) is that TSDuck's installation script will fail to discover the distribution version here: https://github.com/tsduck/tsduck/blob/master/build/install-prerequisites.sh#L79. So the script will return and won't install the pre-requisites.

We've just pushed an update to our CLI that will overcome this issue by installing lsb-release. So, if you were using blocksat-cli deps install, this command would automatically install lsb-release (see here) prior to compiling tsduck.

Since you are compiling and installing all components manually, you would need to run apt install lsb-release and then re-run the following:

cd ~/.blocksat/src/tsduck
build/install-prerequisites.sh
make NOTELETEXT=1 NOSRT=1 NOPCSC=1 NOCURL=1 NODTAPI=1
make install SYSPREFIX=$HOME/.blocksat/usr

Make sure that build/install-prerequisites.sh actually works this time (prints installation logs).

VDelport commented 4 years ago

Thank you for your additional answer.

lsb-release was already installed on my computer. build / install-prerequisites.sh does not appear to be running, so make install SYSPREFIX = $ HOME / .blocksat / usr fails.

As already mentioned, the binaries from tsduck are installed on my computer in a directory tsduck / bin / release-x86_64- "computername".

make install SYSPREFIX = $ HOME / .blocksat / usr does not seem to be able to handle this.

blockstreamsatellite commented 4 years ago

@VDelport could you share the failure logs?

The step make install SYSPREFIX=$HOME/.blocksat/usr is supposed to install the binaries on directory $HOME/.blocksat/usr. The directory you mentioned (tsduck/bin/release-x86_64-"computername") is where the compilation step puts the binaries, but that's not the installation yet. The installation step will move all of these binaries to a single place of choice. By default it would be /usr/local, but in our case we choose to install instead at $HOME/.blocksat/usr.

Now, if make install fails, it's probably because the make step (make NOTELETEXT=1 NOSRT=1 NOPCSC=1 NOCURL=1 NODTAPI=1) is failing too. And that, in turn, is a missing library (related to winscard.h), which should have been installed by build/install-prerequisites.sh. So the real problem is that build/install-prerequisites.sh is not running. If you can send some logs, we can try to find out why.

You could try to run the following:

bash -x build/install-prerequisites.sh

With that, we can see where the script is going.

Also, if possible, please send also the results of:

lsb_release -i 

and

lsb_release -r
VDelport commented 4 years ago

bash -x build/install-prerequisites.sh ++ basename build/install-prerequisites.sh .sh

lsb_release -i

Distributor ID: LinuxMint

lsb_release -r Release: 19

blockstreamsatellite commented 4 years ago

Thanks for the information, @VDelport So in this case, with the given lsb_release outputs, the install-prerequisites.sh script really won't install anything (and the logs confirm).

What is your package manager? If apt, you can run:

apt install g++ dos2unix curl tar zip doxygen graphviz pcscd libpcsclite-dev dpkg-dev

After installing the above packages, what happens if you run the following?

cd ~/.blocksat/src/tsduck
build/install-prerequisites.sh
make NOTELETEXT=1 NOSRT=1 NOPCSC=1 NOCURL=1 NODTAPI=1

If everything goes well, you can proceed to the installation step (below). If not, please share the error logs so that we can troubleshoot further.

make install SYSPREFIX=$HOME/.blocksat/usr
VDelport commented 4 years ago

Thank you, the binaries from tsduck were then successfully installed in .blocksat / usr / bin. The dos2unix and libpcsclite-dev packages were not previously installed.