1 (edited by SaeidM 29-07-2021 03:11:23)

Topic: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

I have tried to compile the OOFEM on our new MacOS machine (clang-1205.0.22.11).

The procedure was surprisingly easy and the compilation was successful on first try.

Nevertheless I have 2 concerns

    1) The following tests FAILED:
         56 - test_sm_con1dpm3.in (Failed)
        251 - test_fm_weakPeriodicTriangularObstacle.in (Failed)
        Errors while running CTest
        make[3]: *** [CMakeFiles/tests] Error 8
        make[2]: *** [CMakeFiles/tests.dir/all] Error 2
        make[1]: *** [CMakeFiles/tests.dir/rule] Error 2
        make: *** [tests] Error 2

I have found similar topic on test 251 failing (http://www.oofem.org/forum/viewtopic.php?id=1734) but why all of the tests were successful on Ubuntu?
       
    2) Unlike the GCC compiler, Clang generates numerous warnings and most of them are related to the coding style rather than something fundamental.
I am also wondering if there is any will or interest to resolve the warnings or they should rather be ignored?

Re: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

I am Mac user as well and test 251 - test_fm_weakPeriodicTriangularObstacle.in fails for me as well always. Since I have never worked with the fm module, I just ignored it.
For 56 - test_sm_con1dpm3.in. This test passes on my machine with Apple clang version 12.0.0 (clang-1200.0.32.21). Did you check why it fails. Is the tolerance maybe too tight?

Re: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

Hi, I checked the file con1dpm3.in. The error tolerance is 1e-1 which is rational.

#%BEGIN_CHECK% tolerance 1e-1
#ELEMENT tStep 1 number 1 gp 1 keyword 1 component 1 value -1.86961133e+07
#ELEMENT tStep 5 number 1 gp 1 keyword 1 component 1 value -4.26938378e+07
#%END_CHECK%

Once I change it to 1e0 it still fails but passes for 1e+1.
My clang compiler version is a bit different (12.0.5) and I have not pulled recent changes to OOFEM reop.

Re: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

That makes sense. It's 20 in the latest version. I think that I changed it a while ago.
Have you found a good way to debug oofem on MacOSx?

5 (edited by SaeidM 31-07-2021 08:05:14)

Re: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

Yes, we are using CLion for a while now on all platforms (requires macOS 10.13 or later). It's very convenient and reliable.
The license is very affordable but if you are using for it research and having an affiliation of educational institute you may ask for a free academic license or discount.

I wrote some concise notes for my colleagues and my own reference, if you are new to CLion might be useful;

here to clone from Git repo using CLion,
and here to run and debug OOFEM using CLion.

Re: Compiling on MacOS (11.4) - Clang compiler warnings / ctest results

Thank you. I will give it a try.