[Gmsh] building of gmsh on mingw64
Christophe Geuzaine
cgeuzaine at uliege.be
Tue Sep 22 21:16:32 CEST 2020
Hi Walter,
ENABLE_OCC_STATIC should actually not be needed anymore. Can you try the latest Git master, in which CMAKE_FIND_LIBRARY_SUFFIXES and PATH_SUFFIXES have been modified? If it doesn't work let's try to understand why and open an issue in our Gitlab about it.
Christophe
> On 22 Sep 2020, at 20:03, walter <steffe at tiscali.it> wrote:
>
> Hello,
> I am used to build my application (EmCAD) and gmsh on Msys2/MINGW64 platform.
>
> Today I made a small change to the main CMakeLists.txt file of gmsh-4.6.0-source.
> This change fixes the following problem:
> cmake/configure is not able to find the OCC libraries on Msys2/MINGW64 platform even if CASROOT is properly set.
>
> This problem arises because:
> 1) on Msys2/MINGW64 platform the OCC libraries are located in the following folders
>
> $CASROOT/${OCC_SYS_NAME}/gcc/lib >> dll.a libraries
> $CASROOT/${OCC_SYS_NAME}/gcc/bin >> dll libraries
>
>
> So I made the following small changes:
>
>
> line 12179 to 1273
> if(ENABLE_OCC_STATIC)
> set(LIBNAME lib${OCC}.a)
> else()
> set(LIBNAME ${OCC})
> endif()
>
> is replaced by:
> if(ENABLE_OCC_STATIC)
> if(MINGW)
> set(LIBNAME lib${OCC}.dll.a)
> else()
> set(LIBNAME lib${OCC}.a)
> endif()
> else()
> set(LIBNAME ${OCC})
> endif()
>
>
> line 1284 to 1285:
> find_library(OCC_LIB ${LIBNAME} HINTS ENV CASROOT PATH_SUFFIXES
> lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
>
> is replaced by:
> find_library(OCC_LIB ${LIBNAME} HINTS ENV CASROOT PATH_SUFFIXES lib bin
> lib ${OCC_SYS_NAME} ${OCC_SYS_NAME}/vc8 ${OCC_SYS_NAME}/gcc )
>
>
> line 1306 to 1307:
> find_library(OCC_CAF_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
> lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
>
> is replaced by:
> find_library(OCC_CAF_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES lib bin
> lib ${OCC_SYS_NAME} ${OCC_SYS_NAME}/vc8 ${OCC_SYS_NAME}/gcc)
>
>
> -bin has been added to PATH_SUFFIXES in both calls to find_library.
> -${OCC_SYS_NAME}/gcc subfolder explitely added to ${OCC_SYS_NAME}/vc8
> -lib was removed from some explicit subfolders because it is already appended by PATH_SUFFIXES
>
> With this change, when the option ENABLE_OCC_STATIC is activated on a Msys2/MINGW64 platform, gmsh is linked with libTKernel.dll.a ...
>
> libTKernel.dll.a is an import library in the microsoft world.
> I think that this kind of library is meant to import the libTKernel.dll library placed in the gcc/bin folder.
> I do not know if it make any difference with direct linkage to the dll.
>
>
> Walter
>
>
>
>
>
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh
—
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
More information about the gmsh
mailing list