1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-15 18:40:09 +00:00

testing problems with return carriage

This commit is contained in:
Carles Fernandez 2014-04-23 19:51:12 +02:00
parent 9ea9225172
commit 93cea14648

View File

@ -56,7 +56,8 @@ In case you do not want to use PyBOMBS and prefer to build and install GNU Radio
### Install other libraries used by GNSS-SDR: ### Install other libraries used by GNSS-SDR:
#### Install the [Armadillo](http://arma.sourceforge.net/ "Armdillo's Homepage") C++ linear algebra library: #### Install the [Armadillo](http://arma.sourceforge.net/ "Armadillo's Homepage") C++ linear algebra library:
``` ```
$ sudo apt-get install libblas-dev liblapack-dev gfortran # For Debian/Ubuntu/LinuxMint $ sudo apt-get install libblas-dev liblapack-dev gfortran # For Debian/Ubuntu/LinuxMint
$ sudo yum install lapack-devel blas-devel gcc-fortran # For Fedora/CentOS/RHEL $ sudo yum install lapack-devel blas-devel gcc-fortran # For Fedora/CentOS/RHEL
@ -72,7 +73,8 @@ $ sudo make install
The full stop separated from "cmake" by a space is important. [CMake](http://www.cmake.org/ "CMake's Homepage") will figure out what other libraries are currently installed and will modify Armadillo's configuration correspondingly. CMake will also generate a run-time armadillo library, which is a combined alias for all the relevant libraries present on your system (eg. BLAS, LAPACK and ATLAS). The full stop separated from "cmake" by a space is important. [CMake](http://www.cmake.org/ "CMake's Homepage") will figure out what other libraries are currently installed and will modify Armadillo's configuration correspondingly. CMake will also generate a run-time armadillo library, which is a combined alias for all the relevant libraries present on your system (eg. BLAS, LAPACK and ATLAS).
#### Install [Gflags](http://code.google.com/p/gflags/ "gflags' Homepage"), a commandline flags processing module for C++: #### Install [Gflags](http://code.google.com/p/gflags/ "Gflags' Homepage"), a commandline flags processing module for C++:
``` ```
$ wget http://gflags.googlecode.com/files/gflags-2.0.zip $ wget http://gflags.googlecode.com/files/gflags-2.0.zip
$ unzip gflags-2.0.zip $ unzip gflags-2.0.zip
@ -82,7 +84,9 @@ $ make
$ sudo make install $ sudo make install
$ sudo ldconfig $ sudo ldconfig
``` ```
#### Install [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage"), a library that implements application-level logging: #### Install [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage"), a library that implements application-level logging:
``` ```
$ wget http://google-glog.googlecode.com/files/glog-0.3.3.tar.gz $ wget http://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
$ tar xvfz glog-0.3.3.tar.gz $ tar xvfz glog-0.3.3.tar.gz
@ -94,6 +98,7 @@ $ sudo ldconfig
``` ```
#### Build the [Google C++ Testing Framework](http://code.google.com/p/googletest/ "Googletest Homepage"), also known as googletest: #### Build the [Google C++ Testing Framework](http://code.google.com/p/googletest/ "Googletest Homepage"), also known as googletest:
``` ```
$ wget http://googletest.googlecode.com/files/gtest-1.7.0.zip $ wget http://googletest.googlecode.com/files/gtest-1.7.0.zip
$ unzip gtest-1.7.0.zip $ unzip gtest-1.7.0.zip
@ -103,21 +108,28 @@ $ make
``` ```
Please **DO NOT install** gtest (do *not* type ```sudo make install```). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of ```#if``` in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of gtest its own tests; it is only required that you tell the system where the gtest folder that you downloaded resides. Just add to your ```$HOME/.bashrc``` file the following line: Please **DO NOT install** gtest (do *not* type ```sudo make install```). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of ```#if``` in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of gtest its own tests; it is only required that you tell the system where the gtest folder that you downloaded resides. Just add to your ```$HOME/.bashrc``` file the following line:
``` ```
$ export GTEST_DIR=/home/username/gtest-1.7.0 $ export GTEST_DIR=/home/username/gtest-1.7.0
``` ```
changing /home/username/gtest-1.7.0 by the actual directory where you downloaded gtest. Again, it is recommended to add this line to your ```$HOME/.bashrc``` file. changing /home/username/gtest-1.7.0 by the actual directory where you downloaded gtest. Again, it is recommended to add this line to your ```$HOME/.bashrc``` file.
#### Install the [SSL development libraries](https://www.openssl.org/ "OpenSSL's Homepage"): #### Install the [SSL development libraries](https://www.openssl.org/ "OpenSSL's Homepage"):
``` ```
$ sudo apt-get install libssl-dev # For Debian/Ubuntu/LinuxMint $ sudo apt-get install libssl-dev # For Debian/Ubuntu/LinuxMint
$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL $ sudo yum install openssl-devel # For Fedora/CentOS/RHEL
``` ```
### Clone GNSS-SDR's Git repository: ### Clone GNSS-SDR's Git repository:
``` ```
$ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr $ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr
``` ```
Cloning the GNSS-SDR repository as in the line above will create a folder named gnss-sdr with the following structure: Cloning the GNSS-SDR repository as in the line above will create a folder named gnss-sdr with the following structure:
``` ```
|-gnss-sdr |-gnss-sdr
|---build <- where gnss-sdr is built |---build <- where gnss-sdr is built
@ -141,6 +153,7 @@ Cloning the GNSS-SDR repository as in the line above will create a folder named
- Go to GR-GN3S root directory, compile and install the driver - Go to GR-GN3S root directory, compile and install the driver
(read the drivers/gr-gn3s/README for more information): (read the drivers/gr-gn3s/README for more information):
``` ```
$ cd gnss-sdr/drivers/gr-gn3s $ cd gnss-sdr/drivers/gr-gn3s
$ cd build $ cd build
@ -149,10 +162,13 @@ $ make
$ sudo make install $ sudo make install
$ sudo ldconfig $ sudo ldconfig
``` ```
- Set the environment variable ```GN3S_DRIVER=1``` in order to enable the GN3S_Signal_Source in GNSS-SDR: - Set the environment variable ```GN3S_DRIVER=1``` in order to enable the GN3S_Signal_Source in GNSS-SDR:
``` ```
$ export GN3S_DRIVER=1 $ export GN3S_DRIVER=1
``` ```
In order to gain access to USB ports, gnss-sdr should be used as root. In order to gain access to USB ports, gnss-sdr should be used as root.
In addition, the driver requires access to the GN3S firmware binary file. In addition, the driver requires access to the GN3S firmware binary file.
It should be available in the same path where the application is called. It should be available in the same path where the application is called.
@ -164,6 +180,7 @@ Please copy this file to the application path. The GNSS-SDR default path is gnss
###### Build RTL-SDR support (OPTIONAL): ###### Build RTL-SDR support (OPTIONAL):
- Install the [OsmoSDR](http://sdr.osmocom.org/trac/ "OsmoSDR's Homepage") library and GNU Radio's source block: - Install the [OsmoSDR](http://sdr.osmocom.org/trac/ "OsmoSDR's Homepage") library and GNU Radio's source block:
``` ```
$ git clone git://git.osmocom.org/osmo-sdr.git $ git clone git://git.osmocom.org/osmo-sdr.git
$ cd osmo-sdr/software/libosmosdr $ cd osmo-sdr/software/libosmosdr
@ -183,14 +200,19 @@ $ make
$ sudo make install $ sudo make install
$ sudo ldconfig $ sudo ldconfig
``` ```
- Set the environment variable ```RTLSDR_DRIVER=1``` in order to enable the Rtlsdr_Signal_Source in GNSS-SDR: - Set the environment variable ```RTLSDR_DRIVER=1``` in order to enable the Rtlsdr_Signal_Source in GNSS-SDR:
``` ```
$ export RTLSDR_DRIVER=1 $ export RTLSDR_DRIVER=1
``` ```
- In order to compile the RTLSDR adapter you should also provide the path to the gr-osmosdr source code using: - In order to compile the RTLSDR adapter you should also provide the path to the gr-osmosdr source code using:
``` ```
$ export OSMOSDR_ROOT=/path/to/gr-osmosdr $ export OSMOSDR_ROOT=/path/to/gr-osmosdr
``` ```
The default will be ```OSMOSDR_ROOT=/usr/local``` The default will be ```OSMOSDR_ROOT=/usr/local```
(in order to disable the Rtlsdr_Signal_Source compilation, you should remove the RTLSDR_DRIVER variable and build again GNSS-SDR). (in order to disable the Rtlsdr_Signal_Source compilation, you should remove the RTLSDR_DRIVER variable and build again GNSS-SDR).
@ -198,54 +220,74 @@ The default will be ```OSMOSDR_ROOT=/usr/local```
### Build GNSS-SDR ### Build GNSS-SDR
- Go to GNSS-SDR's build directory: - Go to GNSS-SDR's build directory:
``` ```
$ cd gnss-sdr/build $ cd gnss-sdr/build
``` ```
- Configure and build the application: - Configure and build the application:
``` ```
$ cmake ../ $ cmake ../
$ make $ make
``` ```
By default, CMake is configured to build the release version. If you want to build the debug version, please use: By default, CMake is configured to build the release version. If you want to build the debug version, please use:
``` ```
cmake ../ -DCMAKE_BUILD_TYPE=Debug cmake ../ -DCMAKE_BUILD_TYPE=Debug
``` ```
- Move the executables to the install folder: - Move the executables to the install folder:
``` ```
$ make install $ make install
``` ```
- If everything goes well, two new executables will be created at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```. - If everything goes well, two new executables will be created at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```.
- You can create the documentation by doing: - You can create the documentation by doing:
``` ```
$ make doc $ make doc
``` ```
from the gnss-sdr/build folder. This will generate HTML documentation that can be retrieved pointing your browser of preference to gnss-sdr/docs/html/index.html. from the gnss-sdr/build folder. This will generate HTML documentation that can be retrieved pointing your browser of preference to gnss-sdr/docs/html/index.html.
If a LaTeX installation is detected in your system, If a LaTeX installation is detected in your system,
``` ```
$ make pdfmanual $ make pdfmanual
``` ```
will create a PDF manual at gnss-sdr/docs/GNSS-SDR_manual.pdf. Please note that the PDF generation requires some fonts to be installed on the host system. In Ubuntu 12.10, those fonts do not come by default. You can install them by doing: will create a PDF manual at gnss-sdr/docs/GNSS-SDR_manual.pdf. Please note that the PDF generation requires some fonts to be installed on the host system. In Ubuntu 12.10, those fonts do not come by default. You can install them by doing:
``` ```
$ sudo apt-get install texlive-fonts-recommended $ sudo apt-get install texlive-fonts-recommended
``` ```
and then run ```cmake ../``` and make pdfmanual again. Finally, and then run ```cmake ../``` and make pdfmanual again. Finally,
``` ```
$ make doc-clean $ make doc-clean
``` ```
will remove the content of previously-generated documentation. will remove the content of previously-generated documentation.
- By default, CMake will build the Release version, meaning that the compiler will generate a faster, optimized executable. This is the recommended build type when using a RF front-end and you need to attain real time. If you are working with a file (and thus without real-time constraints), you may want to obtain more information about the internals of the receiver, as well as more fine-grained logging. This can be done by building the Debug version, by doing: - By default, CMake will build the Release version, meaning that the compiler will generate a faster, optimized executable. This is the recommended build type when using a RF front-end and you need to attain real time. If you are working with a file (and thus without real-time constraints), you may want to obtain more information about the internals of the receiver, as well as more fine-grained logging. This can be done by building the Debug version, by doing:
``` ```
$ cd gnss-sdr/build $ cd gnss-sdr/build
$ cmake -DCMAKE_BUILD_TYPE=Debug ../ $ cmake -DCMAKE_BUILD_TYPE=Debug ../
$ make $ make
$ make install $ make install
``` ```
- If you are using Eclipse as your development environment, CMake can create the project for you. Type: - If you are using Eclipse as your development environment, CMake can create the project for you. Type:
``` ```
$ cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_VERSION=3.7 -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 ../ $ cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_VERSION=3.7 -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 ../
``` ```
and then import the created project file into Eclipse: and then import the created project file into Eclipse:
1. Import project using Menu File -> Import. 1. Import project using Menu File -> Import.
@ -268,6 +310,7 @@ If you still have not installed [Xcode](http://developer.apple.com/xcode/), do i
Then, [install Macports](http://www.macports.org/install.php). If you are upgrading from a previous installation, please follow the [migration rules](http://trac.macports.org/wiki/Migration). Then, [install Macports](http://www.macports.org/install.php). If you are upgrading from a previous installation, please follow the [migration rules](http://trac.macports.org/wiki/Migration).
In a terminal, type: In a terminal, type:
``` ```
$ sudo port selfupdate $ sudo port selfupdate
$ sudo port upgrade outdated $ sudo port upgrade outdated
@ -275,7 +318,9 @@ $ sudo port install doxygen +latex
$ sudo port install uhd gnuradio $ sudo port install uhd gnuradio
$ sudo port install armadillo $ sudo port install armadillo
``` ```
Install [Gflags](http://code.google.com/p/gflags/ "gflags' Homepage") manually from the trunk:
Install [Gflags](http://code.google.com/p/gflags/ "Gflags' Homepage") manually from the trunk:
``` ```
$ svn checkout http://gflags.googlecode.com/svn/trunk gflags-trunk $ svn checkout http://gflags.googlecode.com/svn/trunk gflags-trunk
$ cd gflags-trunk $ cd gflags-trunk
@ -283,7 +328,9 @@ $ CXXFLAGS="-stdlib=libc++" CC=clang CXX=clang++ ./configure
$ make $ make
$ sudo make install $ sudo make install
``` ```
Install [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage") manually from the subversion repository. Revision 142 is known to work well: Install [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage") manually from the subversion repository. Revision 142 is known to work well:
``` ```
$ svn checkout -r142 http://google-glog.googlecode.com/svn/trunk/ google-glog $ svn checkout -r142 http://google-glog.googlecode.com/svn/trunk/ google-glog
$ cd google-glog $ cd google-glog
@ -291,7 +338,9 @@ $ CXXFLAGS="-stdlib=libc++" CC=clang CXX=clang++ ./configure
$ make $ make
$ sudo make install $ sudo make install
``` ```
Finally, you are ready to clone the GNSS-SDR repository and build the software: Finally, you are ready to clone the GNSS-SDR repository and build the software:
``` ```
$ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr $ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr
$ cd gnss-sdr/build $ cd gnss-sdr/build
@ -301,10 +350,13 @@ $ make install
``` ```
This will create two executables at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```. The documentation can be built by: This will create two executables at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```. The documentation can be built by:
``` ```
$ make doc $ make doc
``` ```
and can be viewed doing: and can be viewed doing:
``` ```
$ open ../docs/html/index.html $ open ../docs/html/index.html
``` ```
@ -320,25 +372,32 @@ Xcode -> Preferences -> Downloads -> Components -> Command Line Tools
Then, install Macports via [Mac OS X Package (.pkg) installer](http://www.macports.org/install.php). Then, install Macports via [Mac OS X Package (.pkg) installer](http://www.macports.org/install.php).
Once MacPorts is properly installed on your system, open a terminal and type: Once MacPorts is properly installed on your system, open a terminal and type:
``` ```
$ sudo port selfupdate $ sudo port selfupdate
$ sudo port install gcc48 $ sudo port install gcc48
$ sudo port select --set gcc mp-gcc48 $ sudo port select --set gcc mp-gcc48
``` ```
Install [X11 via XQuartz-2.7.4.dmg](http://xquartz.macosforge.org/landing/) (needed by gnuradio-companion but not by GNSS-SDR). Install [X11 via XQuartz-2.7.4.dmg](http://xquartz.macosforge.org/landing/) (needed by gnuradio-companion but not by GNSS-SDR).
Install GNU Radio: Install GNU Radio:
``` ```
$ sudo port install gnuradio $ sudo port install gnuradio
``` ```
Install other dependencies: Install other dependencies:
``` ```
$ sudo port install armadillo $ sudo port install armadillo
``` ```
The libraries [Gflags](http://code.google.com/p/gflags/ "gflags' Homepage") and [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage") should be installed manually, and in that particular order (same steps as above). If they are not already installed
The libraries [Gflags](http://code.google.com/p/gflags/ "Gflags' Homepage") and [Glog](http://code.google.com/p/google-glog/ "Glog's Homepage") should be installed manually, and in that particular order (same steps as above). If they are not already installed
when building GNSS-SDR, [CMake](http://www.cmake.org/ "CMake's Homepage") will download, build and link them statically for you when doing ```make```, but they will not remain installed in the system. when building GNSS-SDR, [CMake](http://www.cmake.org/ "CMake's Homepage") will download, build and link them statically for you when doing ```make```, but they will not remain installed in the system.
Then, you are ready to clone the GNSS-SDR repository and build the software: Then, you are ready to clone the GNSS-SDR repository and build the software:
``` ```
$ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr $ git clone git://git.code.sf.net/p/gnss-sdr/cttc gnss-sdr
$ cd gnss-sdr/build $ cd gnss-sdr/build
@ -346,11 +405,15 @@ $ cmake ../ -DCMAKE_CXX_COMPILER=g++
$ make $ make
$ make install $ make install
``` ```
This will create two executables at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```. The documentation can be built by: This will create two executables at gnss-sdr/install, namely ```gnss-sdr``` and ```run_tests```. The documentation can be built by:
``` ```
$ make doc $ make doc
``` ```
and can be viewed doing: and can be viewed doing:
``` ```
$ open ../docs/html/index.html $ open ../docs/html/index.html
``` ```
@ -360,16 +423,21 @@ Updating GNSS-SDR
================= =================
If you cloned GNSS-SDR some days ago, it is possible that some developer has updated files at the Git repository. You can update your working copy by doing: If you cloned GNSS-SDR some days ago, it is possible that some developer has updated files at the Git repository. You can update your working copy by doing:
``` ```
$ git checkout master # Switch to branch you want to update $ git checkout master # Switch to branch you want to update
$ git pull origin master # Download the newest code from our repository $ git pull origin master # Download the newest code from our repository
``` ```
or, if you want to test the lastest developments: or, if you want to test the lastest developments:
``` ```
$ git checkout next $ git checkout next
$ git pull origin next $ git pull origin next
``` ```
Before rebuilding the source code, it is safe (and recommended) to remove the remainders of old compilations: Before rebuilding the source code, it is safe (and recommended) to remove the remainders of old compilations:
``` ```
$ rm -rf gnss-sdr/build/* $ rm -rf gnss-sdr/build/*
``` ```