herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 151 forks source link

Contribution: MSYS2 Win64 CMake built instructions #177

Closed Junhaowg closed 1 year ago

Junhaowg commented 1 year ago

Hi, I have manage to built this library using msys2 on win64 machine with CMake with the following steps.

Written on: 05/03/2023

  1. Install MSYS2 and Run MSYS2 MINGW64
  2. Install Build Tools for Visual Studio 2022 a. Select "Desktop development with C++" option under "Workloads" Tab b. Add "Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" to system PATH variables c. Create new system variable with variable name "MSYS2_PATH_TYPE" and value "inherit" d. Edit mingw64.ini in MSYS2 folder to add/uncomment the following: "MSYS2_PATH_TYPE=inherit" e. Open MSYS2 MINGW64 and enter "ml64.exe" to verify the system PATH settings f. This step is just for ml64.exe which is required by herumi/mcl CMake for Win64
  3. Install the following dependencies & build tools with the following commands a. "$ pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules" b. "$ pacman -S mingw-w64-x86_64-make" c. "$ pacman -S mingw-w64-x86_64-gdb" d. "$ pacman -S mingw-w64-x86_64-toolchain" e. "$ pacman -S mingw-w64-x86_64-clang"
  4. Git Clone https://github.com/herumi/mcl to MSYS2/home/%PROFILENAME% folder.
  5. Run the following commands to build herumi/mcl using CMake: a. "$ mkdir build" b. "$ cd build" c. "$ cmake .. -DCMAKE_CXX_COMPILER=clang++ -G"MinGW Makefiles"" d. "$ mingw32-make"

    I am sharing this in hope that it may be useful to others as well.

Junhaowg commented 1 year ago

Closed: Not stable build instructions due to: Warning: corrupt .drectve at end of def file