CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Yasser »

Hello,
I'm using msys2 (MinGW 64) on Windows 7 sp1 to compile and build FreeCAD 0.20 Beta1
i downloaded the source code then started to build
but,
i faced two errors till now one i solved (i will talk about it later) and the other not yet
As described in the picture
hdf5 library needs to be defined to cmake but how ??
i guess the library of hdf5 exists in MinGW/bin ??
>>>>>>>>>>>>>>>>>>>>> here is the error

Code: Select all

CMake Error at cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:79 (find_package):
  Could not find a package configuration file provided by "HDF5" with any of
  the following names:

    HDF5Config.cmake
    hdf5-config.cmake

  Add the installation prefix of "HDF5" to CMAKE_PREFIX_PATH or set
  "HDF5_DIR" to a directory containing one of the above files.  If "HDF5"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:58 (SetupSalomeSMESH)

-- Configuring incomplete, errors occurred!
>>>>>>>>>>>>>>>>>>>>>>
Image
Last edited by Yasser on Sat Jun 11, 2022 7:00 pm, edited 2 times in total.
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 msys2 MinGW 64

Post by adrianinsaval »

I'm not familiar with Windows compilation but wehre did you get the libraries from? I think @chennes had some experience with mingw compilation
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 msys2 MinGW 64

Post by Yasser »

adrianinsaval wrote: Sat Jun 11, 2022 1:16 pm I'm not familiar with Windows compilation but wehre did you get the libraries from? I think @chennes had some experience with mingw compilation
I did install the libraries as mentioned in freecad msys2 installation page by command "pacman -S" then the module name!!
there are a full list of libraries and its dependencies.
the link of the page:
https://wiki.freecadweb.org/Compile_on_MinGW
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by adrianinsaval »

and is hdf5 installed? Try installing mingw-w64-x86_64-hdf5
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Yasser »

adrianinsaval wrote: Sat Jun 11, 2022 11:08 pm and is hdf5 installed? Try installing mingw-w64-x86_64-hdf5
It's already installed when i installed msys2
the problem is that cmake can't see the hdf5 directory
the hdf5 exist in the libpack
so i added this line to CMakeList.txt

Code: Select all

list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/LibPack") 
and that solved the problem temporarily but other issues comes!!
thank you for your concerning.
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Kunda1 »

Yasser wrote: Mon Jun 13, 2022 7:09 am so i added this line to CMakeList.txt
Awesome! Can you update the wiki page then?
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
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by adrianinsaval »

Is the libpack meant to be used for mingw compilation? I thought that was for msvc
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Yasser »

Kunda1 wrote: Mon Jun 13, 2022 2:26 pm
Yasser wrote: Mon Jun 13, 2022 7:09 am so i added this line to CMakeList.txt
Awesome! Can you update the wiki page then?
Before any updates, Would you install msys2 with mingw 64 on windows and let us walk through this jungle together :lol:
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Yasser »

adrianinsaval wrote: Mon Jun 13, 2022 4:34 pm Is the libpack meant to be used for mingw compilation? I thought that was for msvc
True, i couldn't configure the hdf5 in MinGW_64 so i tried the LibPack, this is why i said "Temporarily", just to find out next issues.
i choosed msys2 MinGW 64 to compile freecad because that will save time when compiling at Linux later.
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: CMake HDF5 definition error during building FreeCAD on Win 7 using msys2 MinGW 64

Post by Yasser »

This is the final modification result without using LibPack
hdf5 configuration file exist in this directory so i added it to the path list
and the cmake goes flawless in cmake ../freecad without errors or warnings
if i succeeded in building freecad i'll post full detail about how it's done for the beginners.
next step cmake --build ./ is full of trouble :)

Code: Select all

list(APPEND CMAKE_PREFIX_PATH "C:/msys64/mingw64/lib/cmake")
They call me Baba, the bug master :D
Let us throw some stones into still waters
Post Reply