You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm unsure how actively the C++ version of BAT is still being maintained. Basically, I run Ubuntu 22.04 on WSL2. I installed ROOT version 6.28/10 without problems. After downloading and extracting BAT-1.0.0, I ran ./configure --enable-parallel --with-cuba=download without errors.
When trying to run make, I get the following error message:
BCIntegrate.cxx:36:19: error: ‘ROOT::Math::Util’ has not been declared
36 | using ROOT::Math::Util::ToString;
| ^~~~
In file included from ../BAT/BCEngineMCMC.h:28,
from ../BAT/BCIntegrate.h:26,
from BCIntegrate.cxx:12:
BCIntegrate.cxx: In member function ‘void BCMinimizer::Wrapper::Init(const std::vector<double>&, int)’:
BCIntegrate.cxx:114:74: error: ‘ToString’ was not declared in this scope; did you mean ‘TString’?
114 | BCLOG_ERROR(std::string("Cannot add fixed parameter ") + ToString(i) + " to minuit");
| ^~~~~~~~
../BAT/BCLog.h:31:50: note: in definition of macro ‘BCLOG_INTERNAL_OUT’
31 | (std::string(__PRETTY_FUNCTION__) + ": " + s); \
| ^
BCIntegrate.cxx:114:17: note: in expansion of macro ‘BCLOG_ERROR’
114 | BCLOG_ERROR(std::string("Cannot add fixed parameter ") + ToString(i) + " to minuit");
| ^~~~~~~~~~~
BCIntegrate.cxx:122:68: error: ‘ToString’ was not declared in this scope; did you mean ‘TString’?
122 | BCLOG_ERROR(std::string("Cannot add parameter ") + ToString(i) + " to minuit");
| ^~~~~~~~
../BAT/BCLog.h:31:50: note: in definition of macro ‘BCLOG_INTERNAL_OUT’
31 | (std::string(__PRETTY_FUNCTION__) + ": " + s); \
| ^
BCIntegrate.cxx:122:17: note: in expansion of macro ‘BCLOG_ERROR’
122 | BCLOG_ERROR(std::string("Cannot add parameter ") + ToString(i) + " to minuit");
| ^~~~~~~~~~~
i add #include <Math/Util.h> in src/BCIntegrate.cxx to fix it and a new error occur:
/usr/bin/ld: /opt/BAT/external/Cuba/lib/libcuba.a(Suave.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
BAT (written in C++) ist not very actively maintained anymore, though pull requests to fix build issues and similar are of course welcome.
We suggest to use it's successor BAT.jl (written in Julia), it has a lot more sampling algorithms and other new features. I'm happy to assist with porting use cases over to BAT.jl.
We suggest to use it's successor BAT.jl (written in Julia), it has a lot more sampling algorithms and other new features. I'm happy to assist with porting use cases over to BAT.jl.
thanks for your advice. I have an old project needed in C++ environment. I will try BAT.jl in the future.
i add #include <Math/Util.h> in src/BCIntegrate.cxx to fix it and a new error occur:
now i try the following steps and fix it:
download cuba (in my pc is Cuba-4.2.2)
export CFLAGS="-fPIC"
cd to Cuba source directory, and run ./configure --prefix=/path/to/Cuba
make and make install
add #include <Math/Util.h> in src/BCIntegrate.cxx
cd to BAT source directory, and run configure, make and make install
Thanks for the information @YiHui-Liu - would you like to make a pull request with your changes to BAT?
The same situation happened in Ubuntu 22.04 (not in WSL), so maybe this issue is related to the ubuntu version. I don't have an old version of ubuntu so that I can't verify it. I'm not sure if it will cause new problem when i remove the -f option in other version, so people who have problems can refer to my solution without submitting a PR.
Activity
YiHui-Liu commentedon Jul 15, 2024
i have the same question in WSL2 + Ubuntu 22.04
YiHui-Liu commentedon Jul 15, 2024
I remove the
-foption and got:i add
#include <Math/Util.h>insrc/BCIntegrate.cxxto fix it and a new error occur:oschulz commentedon Jul 15, 2024
BAT (written in C++) ist not very actively maintained anymore, though pull requests to fix build issues and similar are of course welcome.
We suggest to use it's successor BAT.jl (written in Julia), it has a lot more sampling algorithms and other new features. I'm happy to assist with porting use cases over to BAT.jl.
YiHui-Liu commentedon Jul 16, 2024
thanks for your advice. I have an old project needed in C++ environment. I will try BAT.jl in the future.
now i try the following steps and fix it:
export CFLAGS="-fPIC"./configure --prefix=/path/to/Cubamakeandmake install#include <Math/Util.h>insrc/BCIntegrate.cxxconfigure,makeandmake installoschulz commentedon Jul 16, 2024
Thanks for the information @YiHui-Liu - would you like to make a pull request with your changes to BAT?
YiHui-Liu commentedon Aug 16, 2024
The same situation happened in Ubuntu 22.04 (not in WSL), so maybe this issue is related to the ubuntu version. I don't have an old version of ubuntu so that I can't verify it. I'm not sure if it will cause new problem when i remove the -f option in other version, so people who have problems can refer to my solution without submitting a PR.
oschulz commentedon Aug 16, 2024
Yes, the significant work load of maintaining the build system across multiple Linux versions and OS-X was a major factor in moving to Julia (https://github.com/bat/BAT.jl).