Author Topic: [SOLVED] C++11 string Error  (Read 3367 times)

philippb

  • Newbie
  • *
  • Posts: 9
[SOLVED] C++11 string Error
« on: April 04, 2016, 11:29:40 AM »
Hi Guys,

I have a problem with running Kratos. The error message is the following:
Code: [Select]
|  /           |             
 ' /   __| _` | __|  _ \   __|
 . \  |   (   | |   (   |\__ \
_|\_\_|  \__,_|\__|\___/ ____/
           Multi-Physics 3.3.0
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    model_part = ModelPart("a")
Boost.Python.ArgumentError: Python argument types in
    ModelPart.__init__(ModelPart, str)
did not match C++ signature:
    __init__(_object*)
    __init__(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
    __init__(_object*)

The input file is just a dummy input file.
It looks to me like the error is c++11 related.
The compilation of Kratos and all of the modules worked without any problems.

Thanks for your help and best regards,
Philipp
« Last Edit: May 05, 2016, 09:17:37 PM by Miguel Angel Celigueta »

vmataix

  • Newbie
  • *
  • Posts: 31
Re: C++11 string Error
« Reply #1 on: April 04, 2016, 11:41:44 AM »
Hi,

Recently we moved to C++11, not officially, but we are moving there step by step. Did you included the comment in configure.sh for the C++11?:

Code: [Select]
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11"         \
Remember that Boost should be compiled with C++11 too.

Additional questions:

  • Which version of gcc are you using?
  • Which version of Boost are you using? Rememeber that we are just supporting until Boost 1.59

philippb

  • Newbie
  • *
  • Posts: 9
Re: C++11 string Error
« Reply #2 on: April 04, 2016, 01:31:50 PM »
Hi,
Thanks for your reply!
I recompiled Boost (Version 1.55) and Kratos with C++11 enabled, but unfortunately I still get the same error.
GCC is version 5.3.0

Do you have another idea?

Best regards,
Philipp

vmataix

  • Newbie
  • *
  • Posts: 31
Re: C++11 string Error
« Reply #3 on: April 04, 2016, 02:29:46 PM »
Try with Boost 1.59 and tell me.

riccardo

  • Global Moderator
  • Newbie
  • *****
  • Posts: 47
Re: C++11 string Error
« Reply #4 on: April 04, 2016, 06:11:07 PM »
mmm

version 1.55 is already pretty recent i don't think that the error comes from that.

be sure to remove the whole /libs directory when you compile/install
Riccardo

philippb

  • Newbie
  • *
  • Posts: 9
Re: C++11 string Error
« Reply #5 on: April 06, 2016, 10:01:41 AM »
Recompiling boost (1.55) with C++11 and recompiling kratos (with deleted /libs directory) did the trick.
Thanks for your help!