Closed t-mertz closed 6 years ago
Hi, thank you for the feedback!
Let me first see how you compiled ALPSCore libraries and CT-HYB. Did you compile ALPSCore with C++11?
We need to use the same C++ standard for the ALPSCore and CT-HYB.
Why did you set this?
set(CMAKE_CXX_STANDARD 11)
In my environments, I use C++11 or 14 to compile CT-HYB. But, I want to keep the CT-HYB compatible with C++03 as long as possible. Did you find some issue?
Hi, I didn't change anything when compiling ALPSCore. In the CMakeCache.txt it says ALPS_CXX_STD:STRING=c++03
, and this is also displayed when I run cmake
.
I have now vigorously tried to reproduce the compile error that made me use c++11, but even after removing the setting it still worked.
However, when I checkout master
instead of v1.0.2 and try to compile I get compile errors that suggest that there is something incompatible with c++03.
Namely, the problem is in src/impurity_init.ipp lines 365 and 420, where std::ifstream(std::string) is called. The solution that I found was that this is only defined in c++11 and above. In c++03 one would have to add *.c_str() as there is no constructor overload that takes std::string. This seems to be fixed in v1.0.2, but if I understand correctly not in v1.0.3.
On v1.0.2 I am now compiling without c++11 and will then check again. Am I right in assuming that one is supposed to build from on of the tags and not branch master?
Hi,
The problem was the incompatibility between the CXX standards used for compiling ALPSCore libraries and ALPSCore/CT-HYB. The CT-HYB is linked to ALPSCore libraries. So, they must be compiled with the same C++ compiler and the same C++ standard ABI compatibility.
Actually, the implementation of std::string may be different between C++03 and C++11. This is why you got a very weird crash when a std::string object was touched.
If you get any compilation errors, please post them. Then, I will help you.
Thanks a lot for the help. After cleaning and recompiling everything works now. For ALPSCore I had specified to use mpich, which invokes /usr/bin/g++ instead of /usr/bin/c++, which has been used for CT-HYB.
I installed ALPSCore v2.1.0 with Boost 1.58.0 and the newest Eigen from GitHub,
make test
passes all tests.Now I cloned CT-HYB and compiled with g++ 5.4.0, which I was only able to do by adding
set(CMAKE_CXX_STANDARD 11)
to the top ofCT-HYB/CMakeLists.txt
. Again,make test
passes both tests, although this first failed with a segfault, but somehow worked after checking out v1.0.1 and then v1.0.2 again. However, I am not overly confident with tags in git, so I may have done something weird there. Right now I getRunning the code with any one of the tutorial inputs fails immediately printing the following error message:
Does anyone know what I have done wrong?