oxen-core icon indicating copy to clipboard operation
oxen-core copied to clipboard

Windows build using MSYS

Open zaptariz opened this issue 3 years ago • 5 comments

Andoyn@LAPTOP-CPFVLD9Q MSYS /c/Users/Andoyn/Desktop/windows_build/oxen-core $ make release-static-win64 mkdir -p build/"MSYS_NT-10.0-22000/dev"/release cd build/"MSYS_NT-10.0-22000/dev"/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=../../../../cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=C:/msys64/ ../../../.. && make /bin/sh: line 1: cmake: command not found make: *** [Makefile:159: release-static-win64] Error 127

zaptariz avatar Nov 29 '21 13:11 zaptariz

You have to install some dependencies before running make. cmake can be installed with MSYS. I'd like to see a complete build order list of instructions myself including the dependencies. Redoing the steps for MSYS in Windows build and will make a DOC to be PR into oxen core.

mechanator avatar Dec 18 '21 20:12 mechanator

Here's my stab at MSYS2 building in Windows for oxen core. Similar instructions to other cryptonight coins.

Open the MSYS shell via the MSYS2 MSYS shortcut at Menu Start

Update packages using pacman:

$ pacman -Syu

Exit the MSYS shell using Alt+F4 or by clicking X at top-right corner. It is Very Important to do not exit to shell!!.

Start MSYS2 MINGW64 from Menu Start

Update packages again using pacman:

$ pacman -Syu

Install dependencies:

To build for 64-bit Windows:

$ pacman -S git mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi automake autoconf binutils patch pacman -S git mingw-w64-x86_64-zeromq mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-unbound then: $ pacman -Syu

Close and reopen the MSYS MinGW shell via MSYS2 MinGW 64-bit shortcut on 64-bit Windows or MSYS2 MinGW 32-bit shortcut on 32-bit Windows. Note that if you are running 64-bit Windows, you will have both 64-bit and 32-bit MinGW shells.

Cloning

To git clone, run:

$ git clone --recursive https://github.com/oxen-io/oxen-core.git Building

Change to the cloned directory, run:

cd oxen-core If you would like a specific version/tag, do a git checkout for that version. eg. 'v5.1.2'. If you don't care about the version and just want binaries from master, skip this step:

If you are on a 64-bit system, run: Activate and update submodules: $ git submodule init && git submodule update If you are on a 64-bit system, run: $ USE_SINGLE_BUILDDIR=1 make release-static-win $ make release-static-win64

Optional: to build Windows binaries suitable for debugging on a 64-bit system, run:

$ make debug-static-win

The resulting executables can be found in build/debug/bin

However the compiler stops since there are flags and settings missing in the makefiles file. Making the 32 bit builds is not recommended. I doubt it would be worthwhile anymore.

mechanator avatar Dec 19 '21 16:12 mechanator

Trying the Linux subsystem for Windows 10 to cross compile for md5 checksum comparison against release. This might work better.

mechanator avatar Dec 19 '21 16:12 mechanator

I actually dont know if deterministic builds work or not.

majestrate avatar Dec 19 '21 16:12 majestrate

They don't build on Windows 10 Linux Subsystem (Ubuntu 18.04 version) Starting with an attempt of build instructions listed on oxen-core. The makefile reports several dependencies missing on "make -j4" and even installing them still bombs out on the CXX compile as error 1. The compiler never starts. I started with a brand new installation.
I think the problem is that the devs are elbow deep in new dependencies used, and didn't update the documentation. However I see the CI automated builds are working. So there is a disconnect.

mechanator avatar Dec 21 '21 19:12 mechanator