[FIXED] LmdFit does not compile on MAC [message #14687] |
Thu, 02 May 2013 12:36 |
StefanoSpataro
Messages: 2736 Registered: June 2005 Location: Torino
|
first-grade participant |
From: *to.infn.it
|
|
Dear all,
I noticed that the package LmdFit does not compile on my mac:
/.../trunk/lmd/LmdFit/ModelPar.h:28:17: error: no member named 'shared_ptr' in namespace 'std'
std::set<std::shared_ptr<ModelPar>> connections;
~~~~~^
This is due mainly to the usage of shared_ptr... it seems that under linux it is inside std::shared_ptr, while under mac it sits on std::tr1::shared_ptr. If I modify the call adding tr1 then it works on mac, but not on linux.
Another strange thing I found is that in ModelParSet the following function is private:
class ModelParSet {
private:
/**
* Small structure defining the comparison operator used in the map
* #model_par_map. Will return true only if this model parameter is equal to
* the parameter. It is used when concatenating multiple ModelPar objects to
* avoid having multiple instances of the same parameter. The check is based
* on a name comparison.
*/
struct stringcomp {
bool operator()(const std::string& lhs, const std::string& rhs) const {
return lhs.compare(rhs) < 0;
}
};
but it is used in ModelParameterHandler.cxx. In this case one has to move the function to public in order to compile.
Another problem under MAC:
[ 57%] Building CXX object lmd/CMakeFiles/Model.dir/LmdFit/Model.cxx.o
cc1plus: error: unrecognized command line option "-std=c++0x"
Is is really needed the flag c++0x? All the other packages do not have it. What's the reason?
Is it possible to fix this package so that it compiles also under Mac?
However, it seems the package does not follow the pandaroot coding rules. If this is only for group anayses maybe it would be better to put it under development so that the main compilation is not affected.
[Updated on: Thu, 04 July 2013 12:44] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: LmdFit does not compile on MAC [message #14706 is a reply to message #14705] |
Mon, 06 May 2013 09:39 |
Stefan Pflueger
Messages: 99 Registered: February 2012
|
continuous participant |
From: *superkabel.de
|
|
Hi Ralf,
at the moment I'm using things from the tr1, which I believe is not c++11, but is only supported by "newer" compilers (gcc 4.1 or later if I'm not mistaken). I guess since Fairroot already has the dependency of the boost libraries, the best way for the largest compatibility for older compilers/systems would be to use the boost shared_ptrs.
The reason for using c++11 was just that I started to develop my own modeling/fitting framework for arbitrary functions and wanted as few dependencies as possible, hence the shared_ptrs from std.
Ultimately I would like to have this modeling framework to be an external link to the svn (like genfit). I could use a boost version here and then develop a separate version in parallel, but that's kind of work overhead to keep these things synced.
Best regards,
Stefan
|
|
|