Menu

#251 Mfront and mingw (gcc 10.2)

3.3
closed
None
2020-11-13
2020-10-26
No

Hi,

I wanted to recompile MFront (new gcc 10.2) but it has compilation errors:

C:/msys64/mingw64/include/c++/10.2.0/system_error:262:5: note:   template argument deduction/substitution failed:
C:/msys64/usr/local/tfel-TFEL-3.3.0/mfront/src/SecondBroydenSolver.cxx:182:12: note:   cannot convert '"this->updateMaterialPropertiesDependantOnStateVariables();\012"' (type 'const char [60]') to type 'const std::error_code&'
  182 |     out << "this->updateMaterialPropertiesDependantOnStateVariables();\n"
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [mfront/src/CMakeFiles/TFELMFront.dir/build.make:1070: mfront/src/CMakeFiles/TFELMFront.dir/BroydenSolvers.obj] Błąd 1
make[2]: *** [mfront/src/CMakeFiles/TFELMFront.dir/build.make:1083: mfront/src/CMakeFiles/TFELMFront.dir/SecondBroydenSolver.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:3166: mfront/src/CMakeFiles/TFELMFront.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

or

C:/msys64/usr/local/tfel-TFEL-3.3.0/mfront/src/SecondBroydenSolver.cxx:182:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [60]')
  182 |     out << "this->updateMaterialPropertiesDependantOnStateVariables();\n"
      |     ~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     |      |
      |     |      const char [60]
      |     std::ostream {aka std::basic_ostream<char>}
In file included from C:/msys64/mingw64/include/c++/10.2.0/memory:84,
                 from C:/msys64/usr/local/tfel-TFEL-3.3.0/mfront/include/MFront/BehaviourDescription.hxx:19,

Best regars
Rafal

Discussion

  • Helfer Thomas

    Helfer Thomas - 2020-10-26

    Hi Rafal,
    Thanks for reporting. I believe that's a duplicate of Ticket #239: https://sourceforge.net/p/tfel/tickets/239/
    Would you try to compile the current rliv-3.3 branch ?
    Go here : https://github.com/thelfer/tfel/tree/rliv-3.3, then Code then Download ZIP
    Regards,
    Thomas

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-26

    Hi,

    Now is OK.

    I try make msys package (makepkg base o ninja), but I have this error:

    C:/msys64/usr/local/pkg_mfront/src/tfel-TFEL-3.3.0/mfront/src/MohrCoulombStressCriterion.cxx:162:68: error: 'cn' was not declared in this scope; did you mean 'c'?
      162 |         code += "computeMohrCoulombStressCriterionNormal(this->" + cn + ", s" +
          |                                                                    ^~
          |                                                                    c
    [282/473] Building CXX object mfront/src/CMakeFiles/TFELMFront.dir/Hill1948StressCriterion.obj
    [283/473] Building CXX object mfront/src/CMakeFiles/TFELMFront.dir/Cazacu2004IsotropicStressCriterion.obj
    

    Best regards
    Rafal

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-26

    Hi, I find fix in master branch.

    162 |         code += "computeMohrCoulombStressCriterionNormal(this->" + cn + ", s" +
    
    162 |         code += "computeMohrCoulombStressCriterionNormal(this->" + pn + ", s" +
    
     
    • Helfer Thomas

      Helfer Thomas - 2020-10-26

      Hi @rav-exdin,
      I am suprised, it seems fixed in the rliv-3.3 branch, isn't it ?
      Best,
      Thomas

       
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-27

    Hi,
    The rliv-3.3 is OK, the bug is from the main version 3.3.

     
    • Helfer Thomas

      Helfer Thomas - 2020-10-27

      Hi@rav-exdin,
      This is a duplicate of : https://sourceforge.net/p/tfel/tickets/228/
      However, I am quite surprise that you compile MFront in C++-17. Is this your choice or somehow the new default of gcc-10.2 ?
      Best,
      Thomas

       

      Last edit: Helfer Thomas 2020-10-27
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-27

    Hi,

    If I add:

          -Denable-python=ON \
          -Denable-python-bindings=ON \
    

    I have this error (main 3.3 branch):

    -mingw32/src/Glossary   -LC:/msys64/usr/local/pkg_mfront/src/build-x86_64-w64-mingw32/src/Tests -lboost_python38-mt  -lpython3.8  src/System/libTFELSystem.dll.a  src/Exception/libTFELException.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bindings/python/tfel/CMakeFiles/py_tfel_system.dir/system.obj:system.cxx:(.text+0xf): undefined reference to `declareExternalMaterialPropertyDescription()'
    collect2.exe: error: ld returned 1 exit status
    [162/547] Building CXX object bindings/python/mfront/CMakeFiles/py_mfront__mfront.dir/FileDescription.obj
    In file included from C:/msys64/mingw64/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                     from C:/msys64/mingw64/include/boost/smart_ptr/detail/yield_k.hpp:23,
    

    Best regards
    Rafal

     

    Last edit: Rafał Brzegowy 2020-10-27
    • Helfer Thomas

      Helfer Thomas - 2020-10-27

      Hi Rafal,

      I never tried to build the python bindings with mingw as the official python package is build with Visual Studio.

      Currently, the build of the ExternalMaterialPropertyDescription.cxx is excluded from the build under WIN32 in the CMakeLists.txt file (in bindings/python/tfel. I don't remember if it's on purpose or just a mistake and can't give it a try right now.

      Would you help and try to change those lines

      else(NOT WIN32)
        tfel_python_module(system system.cxx
          LibraryInformation.cxx
          ExternalLibraryManager.cxx
          ExternalBehaviourDescription.cxx)
      endif(NOT WIN32)
      

      by

      else(NOT WIN32)
        tfel_python_module(system system.cxx
          LibraryInformation.cxx
          ExternalLibraryManager.cxx
          ExternalBehaviourDescription.cxx
          ExternalMaterialPropertyDescription.cxx)
      endif(NOT WIN32)
      

      Thanks in advance,
      Thomas

       
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-27

    Hi,

    Now i OK, compilation pass 100%

     
  • Helfer Thomas

    Helfer Thomas - 2020-10-27

    Great,
    I'll fix that next week. !
    Does the python modules work ?

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-10-27

    I don't know, can I check it quickly somehow?

     
  • Helfer Thomas

    Helfer Thomas - 2020-11-01

    Hi @rav-exdin,

    Sorry, I did not see your reply. The idea would be to do the following:

    $ python -c "import mfront"
    

    You probably have to update appropriately your PATH and PYTHONPATH environment variables.

    Thanks,

    Thomas

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-11-02

    I made a tfel installation package for mingw64 but I have file conflicts:

    1. /mingw64/bin/python3.8 is in the file system
    2. The name "mtest" also appears in the pametis library

    The basic version of mfront works (as an installation package): https://github.com/msys2/MINGW-packages/pull/7178

     

    Last edit: Rafał Brzegowy 2020-11-02
  • Helfer Thomas

    Helfer Thomas - 2020-11-02

    I don't understand the first error
    For the second, you may want to add the -DTFEL_APPEND_VERSION=ON option to the call to cmake. See http://tfel.sourceforge.net/install.html
    Let me know when your pull-request is accepted, so we can advice users !

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-11-02

    I try to install new packages (with python support), but I have error. It it seems that install packages have to copy "bin" folder with python3.8 (folder) but in the mingw64/bin there is a file with the same name as this folder and i guess that is doing a conflict.

    The base Mfront is aledy acceptet, now I want to add python support.

     
  • Helfer Thomas

    Helfer Thomas - 2020-11-02

    I am not an user of the mingw64 package manager. Do you have any idea where other pacakges install their python modules ?

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-11-02
     
    • Helfer Thomas

      Helfer Thomas - 2020-11-02

      Ok, so it seems that the python module shall be installed in lib rather than in bin (for mingw). Could you try to modify the python_lib_module (code below) in cmake/module/tfel.cmake and change bin to lib (at two places) ?

      function(python_lib_module name package)
        python_module_base(${package}_${name} ${name} ${ARGN})
        if(TFEL_APPEND_SUFFIX)
          if(WIN32)
            install(TARGETS py_${package}_${name}
              DESTINATION bin/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${package}_${TFEL_SUFFIX_FOR_PYTHON_MODULES}
              COMPONENT python_bindings)
          else(WIN32)
            install(TARGETS py_${package}_${name}
              DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${package}_${TFEL_SUFFIX_FOR_PYTHON_MODULES}
              COMPONENT python_bindings)
          endif(WIN32)
        else(TFEL_APPEND_SUFFIX)
          if(WIN32)
            install(TARGETS py_${package}_${name}
              DESTINATION bin/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${package}
              COMPONENT python_bindings)
          else(WIN32)
            install(TARGETS py_${package}_${name}        DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${package}
              COMPONENT python_bindings)
          endif(WIN32)
        endif(TFEL_APPEND_SUFFIX)
      endfunction(python_lib_module)
      
       
      • Rafał Brzegowy

        Rafał Brzegowy - 2020-11-02

        Now I have python3.8 in bin and lib folder, in bin are .py files but in lib folder .pyd files.

         
  • Helfer Thomas

    Helfer Thomas - 2020-11-02

    Could you also modify the tfel_python_script_base function in the same file ?

     
    • Rafał Brzegowy

      Rafał Brzegowy - 2020-11-02

      Now instalation is OK, for:

      $ python -c "import mfront"

      I have:

      $ python -c "import mfront"
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
      ModuleNotFoundError: No module named 'mfront'
      
       
  • Helfer Thomas

    Helfer Thomas - 2020-11-02

    Is the PYTHONPATH variable set correctly ?

     
  • Rafał Brzegowy

    Rafał Brzegowy - 2020-11-02

    I think it's set up correctly because the python command calls the python console

    I am surprised by the command:

    python -c "import mfront_3_3_0"
    
     

    Last edit: Rafał Brzegowy 2020-11-02
    • Helfer Thomas

      Helfer Thomas - 2020-11-02

      I am surprised by the command:

      python -c "import mfront_3_3_0"

      I seems quite ok for me. The idea was to be able to install two versions of TFEL at the same location.

      So the python bindings are working ? Great !

       
  • Helfer Thomas

    Helfer Thomas - 2020-11-13
    • status: open --> closed
    • assigned_to: Helfer Thomas
     

Log in to post a comment.

MongoDB Logo MongoDB