CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
openBrain
Veteran
Posts: 9031
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by openBrain »

chennes wrote: Fri Apr 15, 2022 1:43 pm I think you're confusing OpenMP and OpenMPI -- although they sound similar, they are actually totally different parallelization strategies. FEM uses OpenMP (look for #pragma omp statements).
My mistake. I see now in my CMake config that OpenMP isn't used (found), so my 'ldd' had no sense. :oops:
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by waebbl »

Kunda1 wrote: Fri Apr 15, 2022 12:03 pm which openmp package are we using from this list? https://repology.org/projects/?search=o ... es_newest=
AFAIK OpenMP is mostly included with the compiler. Both current gcc and clang have support for OpenMP. Gcc through a build-time option and Clang through libomp.
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by wmayer »

My mistake. I see now in my CMake config that OpenMP isn't used (found), so my 'ldd' had no sense.
OpenMP is used in FEM in the file FemMesh.cpp: https://github.com/FreeCAD/FreeCAD/search?q=omp
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by Kunda1 »

wmayer wrote: Sat Apr 16, 2022 8:55 am OpenMP is used in FEM in the file FemMesh.cpp: https://github.com/FreeCAD/FreeCAD/search?q=omp
Is it used for Fortran in FEM ?
Kunda1 wrote: Fri Apr 15, 2022 12:03 pm which openmp package are we using from this list? https://repology.org/projects/?search=o ... es_newest=
@wmayer can you locate the package from this list?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by wmayer »

Is it used for Fortran in FEM ?
No, in FreeCAD we don't have FORTRAN code.
@wmayer can you locate the package from this list?
In none of them. As waebli already said OpenMP is directly part of the compiler and CMake's FindOpenMP.cmake file doesn't search for a 3rd party library but checks the possibilities of the compiler and returns the flags of the compiler that must be used to enable it.

So, printing a version number is not possible but in the report it could be mentioned if OpenMP is supported and optionally the name of the compiler flags.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by Kunda1 »

@wmayer can you locate the package from this list?
So, printing a version number is not possible but in the report it could be mentioned if OpenMP is supported and optionally the name of the compiler flags.
[/quote]
Indeed. A little confusing especially since it does output a version number in the CMake process. Just wondering then what is "(found version "4.5")" indicating ? What is v4.5?

I'm for adding a mention of OpenMP (that it's supported + compiler flags)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: CMake shows OpenMP installed but isn't part of PrintFinalReport.cmake

Post by wmayer »

Kunda1 wrote: Sat Apr 16, 2022 11:22 am Indeed. A little confusing especially since it does output a version number in the CMake process. Just wondering then what is "(found version "4.5")" indicating ? What is v4.5?
Obviously it's the version of the OpenMP specification: https://www.openmp.org/specifications/

However, on my system it says there is no OpenMP support (clang 6) so I can't say how the output looks on other systems.
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
Edit:
For clang 11 it finds OpenMP support
Found OpenMP_C: -fopenmp=libomp
Found OpenMP_CXX: -fopenmp=libomp
Found OpenMP: TRUE
but doesn't print a version number. Maybe a newer CMake version is required.

But anyway after all it's not the most important thing.
Post Reply