How do I find out the version of GNU Radio that I have installed?
I would like the use their messaging libraries, but they are available on newer versions of gnuradio only and for some reason I'm getting a compilation error when I try to use the following code:
message_port_register_out(pmt::mp("out_message"));
I get the following error on compilation:
error: ‘message_port_register_out’ was not declared in this scope
It's supposed to be part of the gr_basic_block, which all blocks inherit from, but it's not compiling.
You can get the version number using python.
from gnuradio import gr
gr.version()
If you installed the complete package - not only the library - in a terminal window:
$ gnuradio-companion --version
GNU Radio Companion 3.7.2.1
or
$ gnuradio-config-info --version
3.7.2.1
According to the docs, message_port_register_out is a member of gr_basic_block. Based on the compilation error you have posted and the code snippet, I'd assume you need an instance to work with. It's hard to tell without more context however.
Related
I've been trying to cross compile jlibtorrent for the raspberry pi which uses boost build for compiling. I am using the officially provided cross compiler with the following config.jam:
import os ;
using gcc : arm : arm-linux-gnueabihf-g++ :
<cxxflags>-fPIC
<cxxflags>-std=c++14
<cxxflags>-fno-strict-aliasing
<cxxflags>-fvisibility=hidden
<linkflags>-m32
<linkflags>-static-libstdc++
<linkflags>-static-libgcc
<linkflags>"-z noexecstack"
# debug information
<cxxflags>-g
<cxxflags>-gdwarf-4
<cxxflags>-ggdb
;
I basically copied the existing configuration for linux-x86 and replaced the compiler, but I'm getting the following compilation error:
libtorrent/src/entry.cpp: In member function 'libtorrent::entry& libtorrent::entry::operator[](libtorrent::string_view)':
libtorrent/src/entry.cpp:86:33: error: no matching function for call to
'std::map<std::basic_string<char>, libtorrent::entry, libtorrent::aux::strview_less, std::allocator<std::pair<const std::basic_string<char>, libtorrent::entry> > >::find(libtorrent::string_view&)'
auto const i = dict().find(key);
My only guess is that the version of the cross compiler (4.9.3) is not compatible with libtorrent, because I saw in the linux-32-config.jam that it uses g++-5. Is there anything else I am missing?
You can find the modified repository in my github repositories. I am using swig/build-linux-armv7.sh for building.
that call (std::map::find()) was added in C++14 (see docs). I see you pass in -std=c++14 on the command line as well. Are you sure your GCC supports C++14? It seems a bit old for that.
The current stable branch of libtorrent only requires C++11 support, if that is the branch you're building, there may be something wrong with the compiler support detection here. If you are building from libtorrent master, it requires proper C++14 support. So in that case you may want to use the stable release.
Thanks to #Arvid I managed to compile it using the current stable branch for libtorrent (RC_1_2) and the following jam file, which you can find here.
import os ;
using gcc : arm : arm-linux-gnueabihf-g++ :
<cxxflags>-fPIC
<cxxflags>-std=c++11
<cxxflags>-fno-strict-aliasing
<cxxflags>-fvisibility=hidden
<linkflags>-static-libstdc++
<linkflags>-static-libgcc
<linkflags>"-z noexecstack"
# debug information
<cxxflags>-g
<cxxflags>-gdwarf-4
<cxxflags>-ggdb;
I have written and built an R package that depends on Rcpp and requires the C++0x standard (for using the tgamma function in C++). I have tested the package on various desktop computers and operating systems, and it always seems to install and work fine. However, I would also like to use the package on an HPC server. When I try to install the package there in my local R library tree using R CMD INSTALL test (where test is the name of the package), I get the following error message from the compiler:
/usr/include/c++/4.4.7/c++0x_warning.h(31): catastrophic error: #error directive: This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
#error This file requires compiler and library support for the upcoming \
^
compilation aborted for Metropolis_Sampler_Beta_Edgewise_Cpp_Statistics.cpp (code 4)
make: *** [Metropolis_Sampler_Beta_Edgewise_Cpp_Statistics.o] Error 4
ERROR: compilation failed for package ‘test’
It basically tells me that I should enable C++0x support when the compiler is called (as in this post). Yet, I thought adding the statement CXX_STD = CXX11 to the src/Makevars file in the R package would actually tell the compiler that this version needs to be used. And indeed that seems to be the case on various desktop computers I have tried. So my question is: how can I tell the compiler on the server that this C++ version should be used for compilation? Alternatively, how else can I install the package?
On the server, I load the module for R by entering module load math/R on the terminal before trying to install the package, and it reports back that the following modules were loaded:
Loading module dependency 'compiler/intel/13.1'.
Loading module dependency 'numlib/mkl/11.0.5'.
Edit 1: The server is a German university cluster called bwUniCluster. It is based on KITE 2.0/RHEL6.5/Lustre 2.5.2. As far as I can tell from the module message reported above, it seems to be the Intel C++ Compiler XE (ICPC) version 13.1.3. But actually I have no clue about compilers, so if you need to know anything more specific, please let me know.
Edit 2 It's also possible to execute module load compiler/gnu/4.9 on the terminal before I try to install the package. This results in the following error message (similar as the one above), which leads me to think that this is not a version problem:
/pfs/data1/software_uc1/bwhpc/common/compiler/gnu/4.9.2/bin/../include/c++/4.9.2/bits/c++0x_warning.h(32): catastrophic error: #error directive: This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
compilation aborted for Metropolis_Sampler_Beta_Edgewise_Cpp_Statistics.cpp (code 4)
make: *** [Metropolis_Sampler_Beta_Edgewise_Cpp_Statistics.o] Error 4
ERROR: compilation failed for package ‘test’
Edit 3: One of the comments suggests that both the R package and R itself need to be compiled using the same compiler version. Is this correct? R was built using g++ 4.4.7 on this machine. Does this mean that the only feasible solution is to convince the sys admin to recompile R with the other 4.9.2 compiler and provide it as a new module? I find this hard to believe, given the following sentence in the "Writing R Extensions" manual:
On these platforms, it is necessary to select a different compiler for C++11, via personal or site Makevars files.
The solution was indeed to recompile R on the server with a newer compiler, in this case Intel 14 (as discussed in Edit 3 in the original post). The sys admin was so kind to set up a new module for this R version.
I have an issue compiling amqpcpp on a centos virtual machine, But it works fine on my iMac.
when I am running make I get this error:
g++ -Wall -I/usr/local/include -L/usr/local/lib -Iinclude/ -c -o src/AMQPExchange.o
src/AMQPExchange.cpp src/AMQPExchange.cpp: In member function ‘void
AMQPExchange::sendDeclareCommand()’: src/AMQPExchange.cpp:73: error: cannot convert ‘amqp_table_t’
to ‘amqp_boolean_t’ for argument ‘7’ to ‘amqp_exchange_declare_ok_t*
amqp_exchange_declare(amqp_connection_state_t_*, amqp_channel_t,
amqp_bytes_t, amqp_bytes_t, amqp_boolean_t, amqp_boolean_t, amqp_boolean_t, amqp_boolean_t,
amqp_table_t)’
make: *** [src/AMQPExchange.o] Error 1
Github Issue Url
g++ version
g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
Unfortunately, I do not know enough of C++ or make yet to fully understand the issue. It seems that the compiler is complaining about a type cast style conversion in the code, which is confusing as it works fine on the mac.
Any ideas?
Thanks
Edit: I have downloaded the latest version of amqpcpp on both machines and re-compiled them, with the same results.
Edit 2: I realised that I installed librabbitmq-c on my mac a couple of months ago, I've just updated it to the latest version and it compains of a similar error to the centos machine, It appears that amqpcpp is not compatible with the latest changes to the librabbitmq codebase. It seems that this particular commit causes the issue:
Commit 2340b039f029f3b8101a164d3bcd547be1106906
I am going to try and update the AmqpCpp codebase to apply a fix, will post a link to pull request if it works. Otherwise, using an earlier commit when checking out the code should allow it to work.
Thanks
I finally found the cause and 2 (temporary) resolutions.
Option One.. pull the librabbitmq code before the breaking changes:
$ git clone https://github.com/alanxz/rabbitmq-c
$ cd rabbitmq-c/
$ git checkout e1746f92585d59364fc48b6305ce25d7fc86c2a4
And then compile as normal. I have tested this method and it works fine for me. Keep an eye out for future update on the AMQPCpp github page so that you know when its safe to update to the latest version.
Option Two .. Update the AMQPCPP code:
AMQPExchange.cpp:
Un-comment line 69 so that it reads:
amqp_boolean_t autodelete = (parms & AMQP_AUTODELETE) ? 1:0;
Change Line 73 so that it reads:
amqp_exchange_declare(*cnn, (amqp_channel_t) 1, exchange, exchangetype, passive, durable, autodelete, 0, args );
Then you should be able to compile without an error. BEWARE: there are more changes in the librabbitmq code than just this function, which is why I stated this is a temporary fix. The AMQPCpp project will need to be updated properly to reflect the most recent changes. This fix works for what I need it to, You may find some other functionality is broken.
I personally decided to use Option One and it's now working as expected.
Thanks
I need to install Rstan for a data analysis class. The instructions are posted here http://code.google.com/p/stan/wiki/RStanGettingStarted. I'm running Mac OS 10.5.8 and R 2.15.1 GUI 1.52 Leopard build 32-bit (6188). I just installed Xcode version 3.1.4, the Xcode c++ compiler that is compatible with leopard (I had to get a mac developer account to do this).
Per the Stan installation instruction, I entered the following code to see if my compiler was working:
library(inline)
library(Rcpp)
src <- '
std::vector<std::string> s;
s.push_back("hello");
s.push_back("world");
return Rcpp::wrap(s);
'
hellofun <- cxxfunction(body = src, includes = '', plugin = 'Rcpp', verbose = FALSE)
cat(hellofun(), '\n')
It returns the following error:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
Library/Frameworks/R.framework/Versions/2.15/Resources/library/
Rcpp/include/Rcpp/internal/export.h: In function ‘void
Rcpp::internal::export_range__dispatch(SEXPREC*, InputIterator,
Rcpp::traits::r_type_primitive_tag)’:
/Library/Frameworks/R.framework/Versions/2.15/Resources/
library/Rcpp/include/Rcpp/internal/export.h:56: internal
compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for
instructions.
make: *** [file795214e66510.o] Error 1
In addition: Warning message:
running command '/Library/Frameworks/R.framework/Resources/bin/
R CMD SHLIB file795214e66510.cpp 2>
file795214e66510.cpp.err.txt' had status 1
When I try to install stan:
install.packages('rstan', type = 'source') ]
I get this warning:
Warning message:
In install.packages("rstan", type = "source") :
installation of package ‘rstan’ had non-zero exit status
I have no idea how C++ works. All of my coding experience is in R and has not before required compiling into C++. I've been trying really hard to figure out what's wrong for the last 4 hours or so, googling these error messages over and over without much luck. Any help would be greatly appreciated and would also help about 10 other students in my class who are having identical or analogous problems. Thank you very, very much.
This looks to me like an issue with the installation of your C++ compiler or with your installation of the Rcpp package, rather than an issue with the rstan package. However, if g++ is causing an intractable problem for you, an alternative is the clang compiler, which should work with Rcpp and rstan if you create $HOME/.R/Makevars with these two lines
CC=clang
CXX=clang++
As mentioned in another answer, the first step is to get Rcpp working on your Mac (i.e,. at least pass the hello world example).
A similar issue for Rcpp previously:
https://stat.ethz.ch/pipermail/r-sig-mac/2010-July/007574.html
In addition, from this webpage http://useyourloaf.com/blog/2011/03/21/compiler-options-in-xcode-gcc-or-llvm.html, it seems that gcc 4.2 and 4.0 are both in Xcode 3.14 (not sure as it does not say it's 3.14). So try to make sure gcc 4.2.1 is used by R is important. Executing the following in a terminal will show what is the current version of gcc.
$ g++ -v
I am new to llvm.When I try to compile c programs using llvm-gcc i get following error:
$ llvm-gcc test.c
Incompatible plugin version
cc1: error: Fail to initialize plugin /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/plugin/dragonegg.so
I am using ubuntu-11.04,and llvm-gcc-4.5
Please help.
Thanks
That means your dragonegg install is broken; compile your own, and/or complain to Ubuntu.
You can use dpkg-buildpackage to build your own llvm-gcc-4.5 and dragonegg debs. Another thing you may need to remember is changing the version in the debian/changelog file.