Issues with libgmsh.so
I've been a user of gmsh for many years, which is by far the best open source mesh generator. Thanks so much for your hard work!
Since the format of the msh files is changing currently more frequently, I decided to use the gmsh api for reading the mesh files, with the bonus of being able to read other mesh formats supported by gmsh.
I'm an ubuntu 20.04 user, so that I simply installed libgmsh-dev. Adapting my code to use the api was pretty easy.
Unfortunately, linking against libgmsh had a couple of side effects. The most annoying one was that for some reason libgmsh prevented my code to run in parallel. I use #pragma omp parallel for in a couple of loops that take 99.9% of the runtime. After linking to libgmsh.a, my programs run single-threaded. Do you have any idea why? Is libgmsh setting omp_set_num_threads somewhere?
The second issue is that libgmsh.so brings in a lot of dependent shared libraries, such as fltk, x11, tbb, occ. I understand that occ (and, therefore, tbb) are necessary, but the fltk-related stuff is likely to be unnecessary for most uses such as mine. Would it be possible to split the gui-related functions to another, separate .so?
I ended up downloading the source code, running ccmake and turning almost everything off, except for ENABLE_BUILD_DYNAMIC, since I just wanted to use the library as a mesh reader. This way I worked around both issues.