mschneider / solcpp

A fast Solana and Mango Markets C++ SDK
Other
41 stars 13 forks source link

Build failure on Windows with MinGW #30

Open eternalego opened 2 years ago

eternalego commented 2 years ago

GCC version 11.3.0 installed with MinGW

running conan as following: conan install .. --build=missing -o:h boost:without_fiber=True -o:h boost:without_python=True -o:h boost:without_graph=True -o:h boost:without_math=True

It loads boost, etc, while fails while building bzip2 1.0.8

mingw32-make.exe[1]: Entering directory   
'C:/Users/asus/.conan/data/bzip2/1.0.8/_/_/build/afe2ddf847ed9b40cba062f2102b7d2359792b34/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_76583.dir/testCCompiler.c.obj  
C:\msys64_2022\mingw64\bin\gcc.exe    -o CMakeFiles\cmTC_76583.dir\testCCompiler.c.obj   -c   
C:\Users\asus\.conan\data\bzip2\1.0.8\_\_\build\afe2ddf847ed9b40cba062f2102b7d2359792b34\CMakeFiles\CMakeTmp\testCCompiler.c  
CMakeFiles\cmTC_76583.dir\build.make:84: recipe for target 'CMakeFiles/cmTC_76583.dir/testCCompiler.c.obj' failed  
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_76583.dir/testCCompiler.c.obj] Error   
mingw32-make.exe[1]: Leaving directory  
'C:/Users/asus/.conan/data/bzip2/1.0.8/_/_/build/afe2ddf847ed9b40cba062f2102b7d2359792b34/CMakeFiles/CMakeTmp' 
Makefile:140: recipe for target 'cmTC_76583/fast' failed  
mingw32-make.exe: *** [cmTC_76583/fast] Error 2  

Detailed cmake log attached:
CMakeError.log also conan build log:
build1.log

Conan default profile contains the following:

toolchain=C:\msys64_2022\mingw64\bin
target_host=x86_64-w64-mingw32
cc_compiler=gcc
cxx_compiler=g++

[env]
CONAN_CMAKE_FIND_ROOT_PATH=$toolchain
CC=$toolchain/gcc
CXX=$toolchain/g++
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib -
STRIP=$target_host-strip
RC=$target_host-windres

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
build_type=Debug
compiler.libcxx=libstdc++11
[options]
[build_requires]

Could it be another unused dependency?

mschneider commented 2 years ago

Looks like there's an issue in detecting the native architecture of your cpu, I'd try playing a bit with the gcc version under compiler.version=11 as the issue seems to be related to passing the correct cli flags to gcc.

On Tue, May 3, 2022 at 5:36 AM eternalego @.***> wrote:

GCC version 11.3.0 installed with MinGW

running conan as following: conan install .. --build=missing -o:h boost:without_fiber=True -o:h boost:without_python=True -o:h boost:without_graph=True -o:h boost:without_math=True

It loads boost, etc, while fails while building bzip2 1.0.8

mingw32-make.exe[1]: Entering directory 'C:/Users/asus/.conan/data/bzip2/1.0.8///build/afe2ddf847ed9b40cba062f2102b7d2359792b34/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_76583.dir/testCCompiler.c.obj C:\msys64_2022\mingw64\bin\gcc.exe -o CMakeFiles\cmTC76583.dir\testCCompiler.c.obj -c C:\Users\asus.conan\data\bzip2\1.0.8_\\build\afe2ddf847ed9b40cba062f2102b7d2359792b34\CMakeFiles\CMakeTmp\testCCompiler.c CMakeFiles\cmTC_76583.dir\build.make:84: recipe for target 'CMakeFiles/cmTC_76583.dir/testCCompiler.c.obj' failed mingw32-make.exe[1]: [CMakeFiles/cmTC76583.dir/testCCompiler.c.obj] Error mingw32-make.exe[1]: Leaving directory 'C:/Users/asus/.conan/data/bzip2/1.0.8//_/build/afe2ddf847ed9b40cba062f2102b7d2359792b34/CMakeFiles/CMakeTmp' Makefile:140: recipe for target 'cmTC_76583/fast' failed mingw32-make.exe: [cmTC_76583/fast] Error 2

Detailed cmake log attached: CMakeError.log https://github.com/mschneider/solcpp/files/8608147/CMakeError.log also conan build log: build1.log https://github.com/mschneider/solcpp/files/8608150/build1.log

Conan default profile contains the following:

toolchain=C:\msys64_2022\mingw64\bin target_host=x86_64-w64-mingw32 cc_compiler=gcc cxx_compiler=g++

[env] CONAN_CMAKE_FIND_ROOT_PATH=$toolchain CC=$toolchain/gcc CXX=$toolchain/g++ CHOST=$target_host AR=$target_host-ar AS=$target_host-as RANLIB=$target_host-ranlib - STRIP=$target_host-strip RC=$target_host-windres

[settings] os=Windows os_build=Windows arch=x86_64 arch_build=x86_64 compiler=gcc compiler.version=11 build_type=Debug compiler.libcxx=libstdc++11 [options] [build_requires]

Could it be another unused dependency?

— Reply to this email directly, view it on GitHub https://github.com/mschneider/solcpp/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDF7EMF6ZGZQ3LSU43S3DVICNMXANCNFSM5U5XVZUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

eternalego commented 2 years ago

That's interesting, tried to set 11.3 and conan printed me a warning that 11.3 is invalid. Only 11 / 11.1 / 11.2 are possible. Ok, will try to do something else.