Update: I have decided to try bfgminer instead. If it fails to work, I may install cgminer on a nearby Gnu/Linux machine and run a USB extension cable.
I was curious if anybody has been successful in compiling this for FreeBSD.
[spoiler]
$ ./configure --enable-blockerupter
checking build system type... amd64-unknown-freebsd9.2
checking host system type... amd64-unknown-freebsd9.2
checking target system type... amd64-unknown-freebsd9.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) 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.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
...
checking for windres... no
checking for inline... inline
checking operating system... configure: error: unsupported operating system
configure: error: ./configure failed for compat/libusb-1.0
It says the OS is unsupported. Not sure what kind of porting would be involved.
$ ./configure --enable-blockerupter --with-system-libusb
checking build system type... amd64-unknown-freebsd9.2
checking host system type... amd64-unknown-freebsd9.2
checking target system type... amd64-unknown-freebsd9.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) 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.out
checking for suffix of executables...
checking whether we are cross compiling... no
...
checking for gcc __sync builtins... yes
checking for gcc __atomic builtins... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating jansson.pc
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/jansson_config.h
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
------------------------------------------------------------------------
cgminer 4.7.1
------------------------------------------------------------------------
Configuration Options Summary:
libcurl(GBT+getwork).: Enabled: -L/usr/local/lib -lcurl
curses.TUI...........: FOUND: -lncurses
Antminer.S1.Bitmain..: Disabled
Antminer.S2.Bitmain..: Disabled
Avalon.ASICs.........: Disabled
Avalon2.ASICs........: Disabled
BlackArrowMinion.ASIC: Disabled
BlackArrow.ASICs.....: Disabled
BFL.ASICs............: Disabled
BitForce.FPGAs.......: Disabled
BitFury.ASICs........: Disabled
BlockErupter.ASICs...: Enabled
Cointerra.ASICs......: Disabled
Spond-sp10.ASICs.....: Disabled
Spond-sp30.ASICs.....: Disabled
Bitmine-A1.ASICs.....: Disabled
Drillbit.BitFury.....: Disabled
Hashfast.ASICs.......: Disabled
Hashratio.ASICs......: Disabled
Icarus.ASICs/FPGAs...: Disabled
Klondike.ASICs.......: Disabled
KnC.ASICs............: Disabled
ModMiner.FPGAs.......: Disabled
Compilation............: make (or gmake)
CPPFLAGS.............:
CFLAGS...............: -g -O2
LDFLAGS..............: -lpthread
LDADD................: -ldl -L/usr/local/lib -lcurl compat/jansson-2.6/src/.libs/libjansson.a -lpthread -lm -lusb -lrt
Installation...........: make install (as root if needed, with 'su' or 'sudo')
prefix...............: /usr/local
$ make
make all-recursive
Making all in lib
GEN arg-nonnull.h
GEN c++defs.h
GEN warn-on-use.h
GEN signal.h
GEN stdint.h
GEN string.h
make all-recursive
CC dummy.o
CC memmem.o
AR libgnu.a
Making all in compat
Making all in jansson-2.6
"Makefile", line 860: Need an operator
make: fatal errors encountered -- cannot continue
*** [all-recursive] Error code 1
Stop in /usr/home/P2Pool/cgminer/compat.
*** [all-recursive] Error code 1
Stop in /usr/home/P2Pool/cgminer.
*** [all] Error code 1
Stop in /usr/home/P2Pool/cgminer.
If the full configure output is required, I can redirect it to a file.
Edit: forgot that "make clean" also fails:
$ make clean
Making clean in lib
test -z "" || rm -f
rm -rf .libs _libs
test -z "libgnu.a" || rm -f libgnu.a
test -z "" || rm -f
rm -f *.o
test -z "core *.stackdump arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t signal.h signal.h-t stddef.h stddef.h-t stdint.h stt
rm -f *.lo
Making clean in compat
Making clean in jansson-2.6
"Makefile", line 860: Need an operator
make: fatal errors encountered -- cannot continue
*** [clean-recursive] Error code 1
Stop in /usr/home/P2Pool/cgminer/compat.
*** [clean-recursive] Error code 1
Stop in /usr/home/P2Pool/cgminer.
Edit2: dug up this advice...testing (rerunning autogen.sh)
It's been a lot of years since I ran FreeBSD, but as I recall, the default 'make' command they use is BSD-specific and not compatible in all ways with the Gnu make that comes with GCC, so you typically have to tell it to use gmake explicitly when using some Gnu make makefiles. I think if you type 'MAKE=gmake; gmake' it will probably work.
gmake failed as well. (./configure still failed with the same error as above without system-usb)
gmake
gmake all-recursive
gmake[1]: Entering directory `/usr/home/P2Pool/cgminer'
Making all in lib
gmake[2]: Entering directory `/usr/home/P2Pool/cgminer/lib'
GEN arg-nonnull.h
GEN c++defs.h
GEN warn-on-use.h
GEN signal.h
GEN stdint.h
GEN string.h
gmake all-recursive
gmake[3]: Entering directory `/usr/home/P2Pool/cgminer/lib'
gmake[4]: Entering directory `/usr/home/P2Pool/cgminer/lib'
CC dummy.o
CC memmem.o
AR libgnu.a
gmake[4]: Leaving directory `/usr/home/P2Pool/cgminer/lib'
gmake[3]: Leaving directory `/usr/home/P2Pool/cgminer/lib'
gmake[2]: Leaving directory `/usr/home/P2Pool/cgminer/lib'
Making all in compat
gmake[2]: Entering directory `/usr/home/P2Pool/cgminer/compat'
Making all in jansson-2.6
gmake[3]: Entering directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
gmake all-recursive
gmake[4]: Entering directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
Making all in src
gmake[5]: Entering directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6/src'
CC dump.lo
CC error.lo
CC hashtable.lo
CC load.lo
CC memory.lo
CC pack_unpack.lo
CC strbuffer.lo
CC strconv.lo
CC value.lo
CCLD libjansson.la
gmake[5]: Leaving directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6/src'
gmake[5]: Entering directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
gmake[5]: Leaving directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
gmake[4]: Leaving directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
gmake[3]: Leaving directory `/usr/home/P2Pool/cgminer/compat/jansson-2.6'
gmake[3]: Entering directory `/usr/home/P2Pool/cgminer/compat'
gmake[3]: Nothing to be done for `all-am'.
gmake[3]: Leaving directory `/usr/home/P2Pool/cgminer/compat'
gmake[2]: Leaving directory `/usr/home/P2Pool/cgminer/compat'
Making all in ccan
gmake[2]: Entering directory `/usr/home/P2Pool/cgminer/ccan'
CC opt/libccan_a-helpers.o
CC opt/libccan_a-opt.o
CC opt/libccan_a-parse.o
CC opt/libccan_a-usage.o
AR libccan.a
gmake[2]: Leaving directory `/usr/home/P2Pool/cgminer/ccan'
gmake[2]: Entering directory `/usr/home/P2Pool/cgminer'
CC cgminer-cgminer.o
In file included from ./sha2.h:36,
from cgminer.c:52:
./miner.h:50:1: warning: "alloca" redefined
In file included from cgminer.c:19:
/usr/include/stdlib.h:246:1: warning: this is the location of the previous definition
gcc: -lpthread: linker input file unused because linking not done
CC cgminer-util.o
In file included from util.c:42:
miner.h:50:1: warning: "alloca" redefined
In file included from util.c:14:
/usr/include/stdlib.h:246:1: warning: this is the location of the previous definition
gcc: -lpthread: linker input file unused because linking not done
CC cgminer-sha2.o
In file included from sha2.h:36,
from sha2.c:37:
miner.h:50:1: warning: "alloca" redefined
In file included from ./compat/jansson-2.6/src/jansson.h:12,
from miner.h:10,
from sha2.h:36,
from sha2.c:37:
/usr/include/stdlib.h:246:1: warning: this is the location of the previous definition
gcc: -lpthread: linker input file unused because linking not done
CC cgminer-api.o
In file included from api.c:25:
miner.h:50:1: warning: "alloca" redefined
In file included from api.c:16:
/usr/include/stdlib.h:246:1: warning: this is the location of the previous definition
api.c: In function 'mcast':
api.c:4717: error: 'IPV6_ADD_MEMBERSHIP' undeclared (first use in this function)
api.c:4717: error: (Each undeclared identifier is reported only once
api.c:4717: error: for each function it appears in.)
gmake[2]: *** [cgminer-api.o] Error 1
gmake[2]: Leaving directory `/usr/home/P2Pool/cgminer'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/home/P2Pool/cgminer'
gmake: *** [all] Error 2
Edit:
More hints...Hi,
I try to delete -ldl switch to Makefile.
But now i have an other problem during compilation on the same object:
SNIP!
you have an idea ?
It looks like compiling cgminer on FreeBSD is not going to be a trivial task. I would be glad to help you through it, but I haven't had a FreeBSD box in some years, so I really can't. I think your options are these:
1) There may actually be a FreeBSD port for CGMiner that already exists. If so, that is clearly the best way to build it.
2) If not, download the Linux binary and run it. The FreeBSD Linux emulation is very good, and I'd be surprised if it didn't work just fine.
3) Get onto the FreeBSD ports mailing lists/forums and ask around. I would be surprised if no FreeBSD users are using cgminer, and some of them can probably help you get it compiled. Maybe you can inspire someone to create a port and add it to the ports tree.
Point 1 appears to be a "no". There is a
cpuminer in
/usr/ports/net-p2p/cpuminerfind was not accepting wildcards, so did not check other categories. (The ports list on the website appears
to miss some: like
bitcoin-daemon.)
I suppose I should try point 2.
Edit3:
$ ./cgminer -o 192.168.243.2:9332
ELF binary type "0" not known.
./cgminer: Exec format error
--looks like I actually need to install Linux binary compatibility.
--
Appears to be fedora 10Tried without installing Linux base-system (based on
these instructions).
root@casey:~ # kldload linux
root@casey:~ # kldstat
Id Refs Address Size Name
1 11 0xffffffff80200000 15b9440 kernel
2 1 0xffffffff81812000 10d97 geom_eli.ko
3 1 0xffffffff81823000 1efc1 crypto.ko
4 1 0xffffffff81842000 57bcf linux.ko
root@casey:~ # su P2Pool
$ cd
$ cd cgminer-4.7.1-x86_64-built
$ ./cgminer -o 192.168.243.2:9332
ELF binary type "0" not known.
./cgminer: Exec format error
$ brandelf -t Linux cgminer
$ ./cgminer -o 192.168.243.2:9332
ELF binary type "3" not known.
./cgminer: Exec format error
Did not appear to work even installing the fedora package:
root@casey:~ # pkg install linux_base-f10-10_7
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 packages will be affected (of 0 checked):
New packages to be INSTALLED:
linux_base-f10: 10_7
The process will require 134 MB more space.
16 MB to be downloaded.
Proceed with this action? [y/N]: y
Fetching linux_base-f10-10_7.txz: 100% 16 MB 2.9M/s 00:06
Checking integrity... done (0 conflicting)
[1/1] Installing linux_base-f10-10_7: 100%
+++ Some programs may need linprocfs, please add it to /etc/fstab! +++
Running linux ldconfig...
root@casey:~ # su P2Pool
$ cd
$ cd cgminer-4.7.1-x86_64-built
$ ./cgminer -o 192.168.243.2:9332
ELF binary type "3" not known.
./cgminer: Exec format error
$ brandelf -t Linux cgminer
$ ./cgminer -o 192.168.243.2:9332
ELF binary type "3" not known.
./cgminer: Exec format error
Edit4: does the 2.9.1 changelog mean anything?
- Changes to build prototypes to support building on FreeBSD 9.1-RC2 amd64
YAEdit: I wonder if the Linux binary compatibility only works for 32 bit binaries.
Base set of packages needed in Linux mode for i386/amd64 (Linux Fedora 10)
..so should work with amd64
[/spoiler]