thelfer / tfel

Main repository of TFEL/MFront project
https://thelfer.github.io/tfel/web/index.html
Other
87 stars 40 forks source link

Systematic error on tests #604

Closed Irvise closed 1 month ago

Irvise commented 1 month ago

Hi Thomas,

I was building the latest MFront (both master and the 4.2.1 release) and when I run make test I am getting thousands of error messages. They are all related to the generic section of tests. The error message is always an exception, here is the manual run of CTest with the output of the test:

          Start  362: brickGursonTvergaardNeedleman1982-test2_GursonTvergaardNeedleman1982_Tridimensional_DownWard_generic_mtest
  16/6133 Test  #362: brickGursonTvergaardNeedleman1982-test2_GursonTvergaardNeedleman1982_Tridimensional_DownWard_generic_mtest .................................Subprocess aborted***Exception:   0.09 sec
terminate called after throwing an instance of 'std::runtime_error'
  what():  SingleStructureSchemeParser::SingleStructureScheme : error while parsing file '/home/fernando/Build/tfel/mfront/tests/behaviours/bricks/StandardElastoViscoPlasticity/generic/GursonTvergaardNeedleman1982-test2.mtest' at line '3'.
ExternalLibraryManager::loadLibrary: library '/home/fernando/Build/tfel/mfront/tests/behaviours/bricks/StandardElastoViscoPlasticity/generic/libMFrontStandardElastoViscoPlasticityBrickBehaviours.so' could not be loaded, (/home/fernando/Build/tfel/mfront/tests/behaviours/bricks/StandardElastoViscoPlasticity/generic/libMFrontStandardElastoViscoPlasticityBrickBehaviours.so: cannot open shared object file: No such file or directory)

All tests fail with basically the same error libMFrontStandardElastoViscoPlasticityBrickBehaviours.so or more commonly, the libMFrontGenericBehaviours.so library cannot be found:

          Start    8: pymtest_behaviours_small-strain-tridimensional-behaviour-wrapper_py
   6/6133 Test    #8: pymtest_behaviours_small-strain-tridimensional-behaviour-wrapper_py ........................................................................***Failed    0.03 sec
EE
======================================================================
ERROR: test (__main__.SmallStrainTridimensionalBehaviourWrapper.test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fernando/Build/tfel/bindings/python/tests/small-strain-tridimensional-behaviour-wrapper.py", line 13, in test
    b = mtest.Behaviour(
        ^^^^^^^^^^^^^^^^
RuntimeError: ExternalLibraryManager::loadLibrary: library '/home/fernando/Build/tfel/mfront/tests/behaviours/generic/libMFrontGenericBehaviours.so' could not be loaded, (/home/fernando/Build/tfel/mfront/tests/behaviours/generic/libMFrontGenericBehaviours.so: cannot open shared object file: No such file or directory)

======================================================================
ERROR: test2 (__main__.SmallStrainTridimensionalBehaviourWrapper.test2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fernando/Build/tfel/bindings/python/tests/small-strain-tridimensional-behaviour-wrapper.py", line 23, in test2
    b = mtest.Behaviour(
        ^^^^^^^^^^^^^^^^
RuntimeError: ExternalLibraryManager::loadLibrary: library '/home/fernando/Build/tfel/mfront/tests/behaviours/generic/libMFrontGenericBehaviours.so' could not be loaded, (/home/fernando/Build/tfel/mfront/tests/behaviours/generic/libMFrontGenericBehaviours.so: cannot open shared object file: No such file or directory)

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (errors=2)

Basically, all tests fail in this manner, they cannot find one or another library, mainly libMFrontGenericBehaviours.so. I grep and find my way to try and find what is going on. I saw that libMFrontGenericBehaviours.so had a final "s" at the end, which the .cxx file does not. I sed all GenericBehaviours to GenericBehaviour and tried recompiling MFront, but that did not fix the issue. I also tried to see if either libMFrontGenericBehaviours.so or libMFrontGenericBehaviour.so where somewhere to be found after compiling MFront, but that is not the case, the shared libraries are nowhere to be found... There are also libraries named libMFrontGenericBehaviours3.so and similar...

All this leads me to believe there is some kind of issue with CMake/CMakeFiles, which are not generating or compiling the required libraries and correctly setting up the LIBRARY_PATH for them to be used... Maybe it is related to my setup, to the options I am using, to a typo/mistake in the naming of libraries within MFront...

What do you think?

Here is the information regarding my compilation setup:

During CMake config, I see a line/config that says

/CMakeCache.txt://The directory containing a CMake configuration file for boost_python-py311.
./CMakeCache.txt:boost_python-py311_DIR:PATH=boost_python-py311_DIR-NOTFOUND

Maybe it is related?

Thank you for your help.

Edit 1: added reference to the ccmake command.

Edit 2: added boost_python info

thelfer commented 1 month ago

Hi @Irvise, The correct way to launch the test is to use make check that will first build all the libraries required for the tests and then run make test`: see here for details. I have installed OpenSUSE Tumbleweed in a virtualbox, I hope to confirm soon that everything is ok. If so, I will send you the packages that I had to install. Best, Thomas

Irvise commented 1 month ago

Hi @thelfer,

thank you very much for your quick answer. You are 100% right and I should have read the documentation with a bit more care, make check did indeed build the test dependencies and ran the tests. I just defaulted mentally to the standard UNIX make test... Here are the wonderful results!

[...]
7593/7593 Test #7593: ComputePK1DerivativeTest ...................................................................................................................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 7593

Total Test time (real) = 144.33 sec
[100%] Built target check

Also, thank you for allowing the @Data entry for @MaterialProperty in 5.0. Tabulated data is quite common in engineering codes!

Best regards, Fer

P.S.: I am back again playing with MFront as I saw that ASME BPVC III Div. 5 (High temperature nuclear reactors code) 2023 edition added an accepted behaviour model for 316 Stainless Steel (HBB-Z appendix) and I wanted to see if I could code it. After playing around with @MaterialProperty I think it will not be practical to create several files/@MaterialProperty entries and I will see if the Chaboche model described in ASME (it includes viscosity and damage) can be used directly with the ElastoViscoPlastic Brick + some damage calculation/post-processing.

thelfer commented 1 month ago

Hi @Irvise,

Great !

I am back again playing with MFront as I saw that ASME BPVC III Div. 5 (High temperature nuclear reactors code) 2023 edition added an accepted behaviour model for 316 Stainless Steel (HBB-Z appendix) and I wanted to see if I could code it.

Seems interesting.

I will see if the Chaboche model described in ASME (it includes viscosity and damage) can be used directly with the ElastoViscoPlastic Brick + some damage calculation/post-processing.

The damage part could be tricky. Do not hesitate to ask for help !