luke-jr / bfgminer

Modular ASIC/FPGA miner written in C, featuring overclocking, monitoring, fan speed control and remote interface capabilities.
http://luke.dashjr.org/programs/bitcoin/files/bfgminer/
Other
1.83k stars 811 forks source link

windows build (mingw, windows7) failed #331

Open rickyteng opened 10 years ago

rickyteng commented 10 years ago

I followed instructions in windows-build.txt. Build failed when make try to build "libblkmaker", "libsse2cpuminer_a-sha256_4way"

Log as following:

make[2]: Entering directory C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker'
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I. -O2 -msse2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c -o base58.lo base58.c
Xbase58.Tpo -c -o base58.lo base58.lo
libtool: compile: warning: libobj namebase58.Tpo -c -o base58.lo base58.lo' may not contain shell special characters.
rm: invalid option -- c
Try `rm --help' for more information.
libtool: compile: gcc -std=gnu99 "-DPACKAGE_NAME=\libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\libblkmaker 0.1\"" "-DPACKAGE_BUGREPORT=\luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I. -O2 -msse2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c -o base58.lo base58.c" -DDLL_EXPORT -DPIC -o .libs/base58.Tpo -c -o base58.lo base58.o
gcc.exe: base58.o: No such file or directory
gcc.exe: no input files

I try to change the file bfgminer/libblkmaker/Makefile about line 398

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<

To

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<

I don't know exactly what the line means because I don't understand Makefile well. I just copy the idea from line

libblkmaker_jansson_0.1_la-blkmaker_jansson.lo: blkmaker_jansson.c
    $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libblkmaker_jansson_0.1_la_CFLAGS) $(CFLAGS) -MT libblkmaker_jansson_0.1_la-blkmaker_jansson.lo -MD -MP -MF $(DEPDIR)/libblkmaker_jansson_0.1_la-blkmaker_jansson.Tpo -c -o libblkmaker_jansson_0.1_la-blkmaker_jansson.lo `test -f 'blkmaker_jansson.c' || echo '$(srcdir)/'`blkmaker_jansson.c

I enter the folder libblkmaker/, redo ./configure, change the line, then make. From the log, it looks like libblkmaker build successfully. I continued to make under bfgminer/

~/bfgminer/libblkmaker
$ cd ..
~/bfgminer
$ make > make.log 2>&1

I got another error:

make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
CC libsse2cpuminer_a-sha256_4way.o
In file included from driver-cpu.h:16:0,
from sha256_4way.c:10:
miner.h:31:22: fatal error: blkmaker.h: No such file or directory
compilation terminated.
gcc.exe: unrecognized option '-pthread'
make[2]: *** [libsse2cpuminer_a-sha256_4way.o] Error 1

Can anyone help?

complete log:

ricky@ricky ~/bfgminer
$ ./autogen.sh

Getting submodules...
Running autoreconf -if...
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Makefile.am:70: variable `EXTRA_bfgminer_DEPENDENCIES' is defined but no program
 or
Makefile.am:70: library has `EXTRA_bfgminer' as canonical name (possible typo)

============================================

ricky@ricky ~/bfgminer
$ CFLAGS="-O2 -msse2" ./configure --enable-cpumining > configure.log 2>&1

Following is content of configure.log...

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether to disable maintainer-specific portions of Makefiles... yes
checking for gcc option to accept ISO C99... -std=gnu99
checking for ranlib... ranlib
checking whether gcc -std=gnu99 needs -traditional... no
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
checking for ranlib... (cached) ranlib
checking how to run the C preprocessor... gcc -E
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for mprotect... yes
checking for sigaction... no
checking for sigaltstack... no
checking for siginterrupt... no
checking for mmap... no
checking whether memchr works... yes
checking whether memmem is declared... no
checking for memmem... no
checking for C/C++ restrict keyword... __restrict
checking for uid_t in sys/types.h... no
checking for inline... inline
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for wchar_t... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking whether stdint.h conforms to C99... yes
checking whether memmem is declared without a macro... no
checking whether mempcpy is declared without a macro... no
checking whether memrchr is declared without a macro... no
checking whether rawmemchr is declared without a macro... no
checking whether stpcpy is declared without a macro... no
checking whether stpncpy is declared without a macro... no
checking whether strchrnul is declared without a macro... no
checking whether strdup is declared without a macro... yes
checking whether strncat is declared without a macro... yes
checking whether strndup is declared without a macro... no
checking whether strnlen is declared without a macro... no
checking whether strpbrk is declared without a macro... yes
checking whether strsep is declared without a macro... no
checking whether strcasestr is declared without a macro... no
checking whether strtok_r is declared without a macro... no
checking whether strerror_r is declared without a macro... no
checking whether strsignal is declared without a macro... no
checking whether strverscmp is declared without a macro... no
checking whether strtok_r is declared... no
checking for memmem... (cached) no
checking for siginfo_t... no
checking for volatile sig_atomic_t... yes
checking for sighandler_t... no
checking whether sigaction is declared without a macro... no
checking whether sigaddset is declared without a macro... no
checking whether sigdelset is declared without a macro... no
checking whether sigemptyset is declared without a macro... no
checking whether sigfillset is declared without a macro... no
checking whether sigismember is declared without a macro... no
checking whether sigpending is declared without a macro... no
checking whether sigprocmask is declared without a macro... no
checking for sigset_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking for strtok_r... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for ANSI C header files... (cached) yes
checking syslog.h usability... no
checking syslog.h presence... no
checking for syslog.h... no
checking sys/epoll.h usability... no
checking sys/epoll.h presence... no
checking for sys/epoll.h... no
checking sys/prctl.h usability... no
checking sys/prctl.h presence... no
checking for sys/prctl.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking linux/spi/spidev.h usability... no
checking linux/spi/spidev.h presence... no
checking for linux/spi/spidev.h... no
checking for sys/file.h... (cached) yes
checking for struct i2c_msg.buf... no
checking for struct i2c_msg.len... no
checking pwd.h usability... no
checking pwd.h presence... no
checking for pwd.h... no
checking for chroot... no
checking for sleep... no
checking for working alloca.h... no
checking for alloca... yes
checking whether HASH_ITER is declared... yes
checking whether DL_CONCAT is declared... yes
checking for pthread_cancel... with -pthread -lpthread
checking for nanosleep... no
checking for pkg-config... /mingw/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANSSON... yes
checking for libmicrohttpd... no
configure: WARNING: libmicrohttpd 0.9.5+ not found; getwork proxy will be unavailable
checking for libevent... no
configure: WARNING: libevent 2.0.3+ not found; stratum proxy will be unavailable
checking for pkg-config... (cached) /mingw/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB... no
checking for libusb_init in -lusb-1.0... no
checking for libusb_init in -lusb... no
configure: WARNING: Could not find libusb, required for Klondike support
configure: WARNING: Could not find libusb, required for X6500 support
configure: WARNING: Could not find libusb, required for ZTEX support
checking for hidapi... no
checking for hidapi... no
checking for hidapi... no
checking for usbiodef.h... no
checking for ddk/usbiodef.h... yes
checking for best native curses library... none?
checking for library containing addstr... -lpdcursesw
checking for curses header subdirectory... none found
checking whether curses library supports wide characters... yes
checking whether the linker recognizes the -zorigin option... no
checking for i686-pc-mingw32-ldconfig... no
checking for ldconfig... no
checking for yasm... /mingw/bin/yasm
checking if yasm version is greater than 1.0.1... yes
checking if SSE2 code compiles... yes
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
checking for LIBCURL... yes
configure: WARNING: Your libcurl pkgconfig file is broken, applying workaround
checking for setrlimit... no
checking for bswap_* functions... no
checking for __builtin_bswap* functions... no
checking for __bswap_* functions... no
checking for __swap* functions... no
checking for swap* functions... no
checking for OSSwapInt* functions... no
checking for platform endian... little endian (sys/param.h)
checking if GNU format attribute compiles... yes
checking for clock_gettime(CLOCK_MONOTONIC)... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating x86_64/Makefile
config.status: creating x86_32/Makefile
config.status: creating ccan/Makefile
config.status: creating lib/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
=== configuring in libblkmaker (/home/ricky/bfgminer/libblkmaker)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  '--enable-cpumining' 'CFLAGS=-O2 -msse2' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw/bin/nm
checking the name lister (/mingw/bin/nm) interface... BSD nm
checking whether ln -s works... no, using cp -p
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format... func_convert_file_msys_to_w32
checking how to convert i686-pc-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw/bin/nm output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for pkg-config... /mingw/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANSSON... yes
checking for strchr in -lws2_32... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libblkmaker_jansson-0.1.pc
config.status: executing depfiles commands
config.status: executing libtool commands

------------------------------------------------------------------------
bfgminer 3.6.0 configuration options summary
------------------------------------------------------------------------

  CFLAGS...............: -I -pthread -O2 -msse2 -IC:/MinGW/include -pthread -Ilibblkmaker
  LDFLAGS..............: -lsetupapi -pthread -Llibblkmaker/.libs -Wl,-rpath,\$$ORIGIN/libblkmaker/.libs -lpthread -LC:/MinGW/lib -lcurl -lcurldll -LC:/MinGW/lib -ljansson -lpdcursesw -lws2_32 -lm -lblkmaker_jansson-0.1 -lblkmaker-0.1
  Installation.prefix..: /usr/local

  Enabled..Drivers.....: avalon bigpic bitforce bitfury_gpio cairnsmore cpu cpu:asm cpu:sse2 erupter icarus littlefury modminer 
  Disabled.Drivers.....: bfsb hashbuster klondike knc metabank nanofury opencl proxy x6500 ztex 
    To enable proxy, install libmicrohttpd 0.9.5+ (getwork) or libevent 2.0.3+ (stratum)
    To enable klondike, install libusb 1.0+
    To enable x6500, install libusb 1.0+
    To enable ztex, install libusb 1.0+
    To enable nanofury, install hidapi
    To enable hashbuster, install hidapi
  Enabled..Algorithms..: SHA256d 
  Disabled.Algorithms..: scrypt 
  Enabled..Options.....: pdcursesw 
  Disabled.Options.....: 

================================================================

ricky@ricky ~/bfgminer
$ make > make.log 2>&1

Following is content of make.log...

C:/MinGW/bin/make  all-recursive
make[1]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
Making all in lib
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
  GEN    signal.h
  GEN    string.h
C:/MinGW/bin/make  all-recursive
make[3]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[4]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
  CC     memmem.o
  CC     sigaction.o
  CC     sigprocmask.o
  CC     strtok_r.o
  AR     libgnu.a
make[4]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[3]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
Making all in ccan
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/ccan'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/ccan'
Making all in libblkmaker
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker'
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.     -O2 -msse2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c -o base58.lo base58.c
Xbase58.Tpo -c -o base58.lo base58.lo
libtool: compile: warning: libobj name `base58.Tpo -c -o base58.lo base58.lo' may not contain shell special characters.
rm: invalid option -- c
Try `rm --help' for more information.
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\\libblkmaker 0.1\"" "-DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I. -O2 -msse2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c -o base58.lo base58.c"  -DDLL_EXPORT -DPIC -o .libs/base58.Tpo -c -o base58.lo base58.o
gcc.exe: base58.o: No such file or directory
gcc.exe: no input files
make[2]: *** [base58.lo] Error 1
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
make: *** [all] Error 2

================================================================

ricky@ricky ~/bfgminer
$ cd libblkmaker

ricky@ricky ~/bfgminer/libblkmaker
$ make clean

ricky@ricky ~/bfgminer/libblkmaker
$ ./configure

ricky@ricky ~/bfgminer/libblkmaker
$ make > make.log 2>&1

Following is content of make.log...

C:/MinGW/msys/1.0/bin/sh.exe ./libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.    -IC:/MinGW/include   -g -O2 -MT libblkmaker_jansson_0.1_la-blkmaker_jansson.lo -MD -MP -MF .deps/libblkmaker_jansson_0.1_la-blkmaker_jansson.Tpo -c -o libblkmaker_jansson_0.1_la-blkmaker_jansson.lo `test -f 'blkmaker_jansson.c' || echo './'`blkmaker_jansson.c
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\\ -DPACKAGE_TARNAME=\\libblkmaker\\ -DPACKAGE_VERSION=\\0.1\\ -DPACKAGE_STRING=\\libblkmaker 0.1\\ -DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\\ -DPACKAGE_URL=\\http://gitorious.org/bitcoin/libblkmaker\\ -DPACKAGE=\\libblkmaker\\ -DVERSION=\\0.1\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_LIBWS2_32=1" -I. -IC:/MinGW/include -g -O2 -MT libblkmaker_jansson_0.1_la-blkmaker_jansson.lo -MD -MP -MF .deps/libblkmaker_jansson_0.1_la-blkmaker_jansson.Tpo -c blkmaker_jansson.c  -DDLL_EXPORT -DPIC -o .libs/libblkmaker_jansson_0.1_la-blkmaker_jansson.o
mv -f .deps/libblkmaker_jansson_0.1_la-blkmaker_jansson.Tpo .deps/libblkmaker_jansson_0.1_la-blkmaker_jansson.Plo
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.     -g -O2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c -o base58.lo `test -f 'base58.c' || echo './'`base58.c
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\\ -DPACKAGE_TARNAME=\\libblkmaker\\ -DPACKAGE_VERSION=\\0.1\\ -DPACKAGE_STRING=\\libblkmaker 0.1\\ -DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\\ -DPACKAGE_URL=\\http://gitorious.org/bitcoin/libblkmaker\\ -DPACKAGE=\\libblkmaker\\ -DVERSION=\\0.1\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_LIBWS2_32=1" -I. -g -O2 -MT base58.lo -MD -MP -MF .deps/base58.Tpo -c base58.c  -DDLL_EXPORT -DPIC -o .libs/base58.o
mv -f .deps/base58.Tpo .deps/base58.Plo
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.     -g -O2 -MT blkmaker.lo -MD -MP -MF .deps/blkmaker.Tpo -c -o blkmaker.lo `test -f 'blkmaker.c' || echo './'`blkmaker.c
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\\ -DPACKAGE_TARNAME=\\libblkmaker\\ -DPACKAGE_VERSION=\\0.1\\ -DPACKAGE_STRING=\\libblkmaker 0.1\\ -DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\\ -DPACKAGE_URL=\\http://gitorious.org/bitcoin/libblkmaker\\ -DPACKAGE=\\libblkmaker\\ -DVERSION=\\0.1\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_LIBWS2_32=1" -I. -g -O2 -MT blkmaker.lo -MD -MP -MF .deps/blkmaker.Tpo -c blkmaker.c  -DDLL_EXPORT -DPIC -o .libs/blkmaker.o
mv -f .deps/blkmaker.Tpo .deps/blkmaker.Plo
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.     -g -O2 -MT blktemplate.lo -MD -MP -MF .deps/blktemplate.Tpo -c -o blktemplate.lo `test -f 'blktemplate.c' || echo './'`blktemplate.c
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\\ -DPACKAGE_TARNAME=\\libblkmaker\\ -DPACKAGE_VERSION=\\0.1\\ -DPACKAGE_STRING=\\libblkmaker 0.1\\ -DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\\ -DPACKAGE_URL=\\http://gitorious.org/bitcoin/libblkmaker\\ -DPACKAGE=\\libblkmaker\\ -DVERSION=\\0.1\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_LIBWS2_32=1" -I. -g -O2 -MT blktemplate.lo -MD -MP -MF .deps/blktemplate.Tpo -c blktemplate.c  -DDLL_EXPORT -DPIC -o .libs/blktemplate.o
mv -f .deps/blktemplate.Tpo .deps/blktemplate.Plo
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc -std=gnu99 -DPACKAGE_NAME=\"libblkmaker\" -DPACKAGE_TARNAME=\"libblkmaker\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"libblkmaker\ 0.1\" -DPACKAGE_BUGREPORT=\"luke_libblkmaker@dashjr.org\" -DPACKAGE_URL=\"http://gitorious.org/bitcoin/libblkmaker\" -DPACKAGE=\"libblkmaker\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBWS2_32=1 -I.     -g -O2 -MT hex.lo -MD -MP -MF .deps/hex.Tpo -c -o hex.lo `test -f 'hex.c' || echo './'`hex.c
libtool: compile:  gcc -std=gnu99 "-DPACKAGE_NAME=\\libblkmaker\\ -DPACKAGE_TARNAME=\\libblkmaker\\ -DPACKAGE_VERSION=\\0.1\\ -DPACKAGE_STRING=\\libblkmaker 0.1\\ -DPACKAGE_BUGREPORT=\\luke_libblkmaker@dashjr.org\\ -DPACKAGE_URL=\\http://gitorious.org/bitcoin/libblkmaker\\ -DPACKAGE=\\libblkmaker\\ -DVERSION=\\0.1\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_LIBWS2_32=1" -I. -g -O2 -MT hex.lo -MD -MP -MF .deps/hex.Tpo -c hex.c  -DDLL_EXPORT -DPIC -o .libs/hex.o
mv -f .deps/hex.Tpo .deps/hex.Plo
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=link gcc -std=gnu99  -g -O2 -version-info 4:1:4 -no-undefined  -o libblkmaker-0.1.la -rpath /usr/local/lib base58.lo blkmaker.lo blktemplate.lo hex.lo  -lws2_32 
libtool: link: gcc -std=gnu99 -shared  .libs/base58.o .libs/blkmaker.o .libs/blktemplate.o .libs/hex.o   -lws2_32  -O2   -o .libs/libblkmaker-0.1-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libblkmaker-0.1.dll.a
Creating library file: .libs/libblkmaker-0.1.dll.a
libtool: link: ( cd ".libs" && rm -f "libblkmaker-0.1.la" && cp -p "../libblkmaker-0.1.la" "libblkmaker-0.1.la" )
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=link gcc -std=gnu99 -IC:/MinGW/include   -g -O2 -L.libs -lblkmaker-0.1 -LC:/MinGW/lib -ljansson   -no-undefined -version-info 4:1:4  -o libblkmaker_jansson-0.1.la -rpath /usr/local/lib libblkmaker_jansson_0.1_la-blkmaker_jansson.lo  -lws2_32 
libtool: link: gcc -std=gnu99 -shared  .libs/libblkmaker_jansson_0.1_la-blkmaker_jansson.o   -L.libs C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker/.libs/libblkmaker-0.1.dll.a -LC:/MinGW/lib /MinGW/lib/libjansson.dll.a -lws2_32  -O2   -o .libs/libblkmaker_jansson-0.1-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libblkmaker_jansson-0.1.dll.a
Creating library file: .libs/libblkmaker_jansson-0.1.dll.a
libtool: link: ( cd ".libs" && rm -f "libblkmaker_jansson-0.1.la" && cp -p "../libblkmaker_jansson-0.1.la" "libblkmaker_jansson-0.1.la" )

================================================================

ricky@ricky ~/bfgminer/libblkmaker
$ cd ..

ricky@ricky  ~/bfgminer
$ make > make.log 2>&1

Following is content of make.log...

C:/MinGW/bin/make  all-recursive
make[1]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
Making all in lib
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
C:/MinGW/bin/make  all-recursive
make[3]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[4]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[3]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/lib'
Making all in ccan
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/ccan'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/ccan'
Making all in libblkmaker
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/libblkmaker'
Making all in x86_32
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/x86_32'
/mingw/bin/yasm -f coff sha256_xmm.asm
  AR     libx8632.a
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer/x86_32'
make[2]: Entering directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
  CC     libsse2cpuminer_a-sha256_4way.o
In file included from driver-cpu.h:16:0,
                 from sha256_4way.c:10:
miner.h:31:22: fatal error: blkmaker.h: No such file or directory
compilation terminated.
gcc.exe: unrecognized option '-pthread'
make[2]: *** [libsse2cpuminer_a-sha256_4way.o] Error 1
make[2]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `C:/MinGW/msys/1.0/home/ricky/bfgminer'
make: *** [all] Error 2

Written with StackEdit.

luke-jr commented 10 years ago

Unfortunately, I think windows-build.txt has suffered some bitrot as MinGW changes their stuff. :(

Hopefully someone who uses Windows can update it soon.

rickyteng commented 10 years ago

Maybe I can help. It will take time. First I need to understand Makefile? or something? Would you please give me a direction to the manual for Makefile? I think I have found first problem that is cause by Makefile. I just don't know how to fixed it. Everytime I run ./configure, Makefile inside libblkmaker/ is restored. The second one is that blkmaker.h is actually in libblkmaker/. Thanks

rickyteng commented 10 years ago

I builded bfgminer under windows 7 with mingw successfully. Because I don't have any ASIC, FPGA, GPU, I only build with following command CFLAGS="-O2 -msse2" ./configure --enable-cpumining --disable-ztex --disable-x6500

Then I manually change the file bfgminer/libblkmaker/Makefile about line 398

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<

To

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<

Then copy some files to folder "bfgminer/" for compilation:

blkmaker.h  # from bfgminer/libblkmaker
usbioctl.h  # from C:\MinGW\include\ddk\
ntddk.h  # from C:\MinGW\include\ddk\
ntstatus.h  # from C:\MinGW\include\ddk\
winddk.h  # from C:\MinGW\include\ddk\
winxp.h  # from C:\MinGW\include\ddk\
win2k.h  # from C:\MinGW\include\ddk\
winnt4.h  # from C:\MinGW\include\ddk\
usb100.h  # from C:\MinGW\include\ddk\
usbiodef.h  # from C:\MinGW\include\ddk\

After compile completed, it's time to copy build files to somewhere. Some files described by windows-build.txt are missing:

pthreadGC2.dll  from \MinGW\bin   # I can run without this dll
libjansson-X.dll    from \MinGW\msys\1.0\local\bin  # not in \MinGW\msys\1.0\local\bin but \MinGW\bin

I still don't know how to write automake or autoconf. So I just write my procedure here.