joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 15, 2016, 02:22:35 PM Last edit: May 15, 2016, 02:45:43 PM by joblo |
|
I still have a lot to learn about c/c++. I got burned by pointer arithmetic this week. It seemed only logical to me that "p + n" would be a byte offset while "p[ i ]" would be scaled. Surprise, the're both scaled.
My next issue is how to consolidate the definitions of frequently used text strings. In my native language it's a simple matter of defining the strings in a header file and referencing them in many source files. This approach causes multi-def warnings in c/c++.
I often see #define macros but they result in the strings being copied by every reference.
Does anyone know of a way in c/c++ to have one definition with multiple references that don't make copies?
|
|
|
|
pallas
Legendary
Offline
Activity: 2716
Merit: 1094
Black Belt Developer
|
|
May 15, 2016, 03:13:51 PM |
|
I still have a lot to learn about c/c++. I got burned by pointer arithmetic this week. It seemed only logical to me that "p + n" would be a byte offset while "p[ i ]" would be scaled. Surprise, the're both scaled.
My next issue is how to consolidate the definitions of frequently used text strings. In my native language it's a simple matter of defining the strings in a header file and referencing them in many source files. This approach causes multi-def warnings in c/c++.
I often see #define macros but they result in the strings being copied by every reference.
Does anyone know of a way in c/c++ to have one definition with multiple references that don't make copies?
-fmerge-constants Attempt to merge identical constants (string constants and floating-point constants) across compilation units. This option is the default for optimized compilation if the assembler and linker support it. Use -fno-merge-constants to inhibit this behavior. Enabled at levels -O, -O2, -O3, -Os.
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 15, 2016, 04:13:52 PM |
|
I still have a lot to learn about c/c++. I got burned by pointer arithmetic this week. It seemed only logical to me that "p + n" would be a byte offset while "p[ i ]" would be scaled. Surprise, the're both scaled.
My next issue is how to consolidate the definitions of frequently used text strings. In my native language it's a simple matter of defining the strings in a header file and referencing them in many source files. This approach causes multi-def warnings in c/c++.
I often see #define macros but they result in the strings being copied by every reference.
Does anyone know of a way in c/c++ to have one definition with multiple references that don't make copies?
-fmerge-constants Attempt to merge identical constants (string constants and floating-point constants) across compilation units. This option is the default for optimized compilation if the assembler and linker support it. Use -fno-merge-constants to inhibit this behavior. Enabled at levels -O, -O2, -O3, -Os. Thanks Pallas. The description of this option indicates it tries to merge multiple explicit definitions of the same constant which means I'm worrying about nothing. I'm trying to merge explicitly defined identical constants by making a single definition while it seems the compiler will do it transparently. Outsmarted by the compiler again, I just wish things wouldn't break when the compiler overrides my code.
|
|
|
|
|
Ayers
Legendary
Offline
Activity: 2758
Merit: 1024
Vave.com - Crypto Casino
|
|
May 19, 2016, 05:49:00 AM |
|
is this better than the wolfo version for hodl and esper?
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 19, 2016, 01:28:52 PM Last edit: May 19, 2016, 02:43:30 PM by joblo |
|
is this better than the wolfo version for hodl and esper?
It should be equal to Wolf0 on hodl and esper is not implemented yet. Edit: I'm taking a look at espers and i think I can improve it.
|
|
|
|
|
monoxide
|
|
May 19, 2016, 09:25:57 PM |
|
Is there a way to get windows version?
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 19, 2016, 09:33:53 PM |
|
Is there a way to get windows version? You can use Virtualbox to create a virtual Linux machine, same performance if you allocate all CPUs to the VM.
|
|
|
|
Dabs
Legendary
Offline
Activity: 3416
Merit: 1912
The Concierge of Crypto
|
|
May 19, 2016, 11:26:01 PM |
|
What do you need to know? Everything should be in the README.md file. Debian should be no problem, nor any other major distro. I didn't mention it because I assumed most Windows users would find Ubuntu less intimidating.
So, here's the tentative plan: 1. set up a new VM with all cores and 4 or 8 GB of RAM 2. install Debian on it, probably a net install of Debian 8 3. run build.sh 4. install whatever coin wallet software and set it up so I can mine to localhost. This is almost what I do with my Windows VM; installed Win 10 on it, downloaded the wallet software, and ran three different versions of cpuminer on it. (I come from the ESPERS thread, there have been 3 versions of cpuminers there I think.) I run Windows Server 2012 R2, so I use Hyper-V on one of my little boxes. I got it cheap, used, something like $600 USD for a dual quad core 48 GB ram rack server.
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 19, 2016, 11:52:53 PM |
|
What do you need to know? Everything should be in the README.md file. Debian should be no problem, nor any other major distro. I didn't mention it because I assumed most Windows users would find Ubuntu less intimidating.
So, here's the tentative plan: 1. set up a new VM with all cores and 4 or 8 GB of RAM 2. install Debian on it, probably a net install of Debian 8 3. run build.sh 4. install whatever coin wallet software and set it up so I can mine to localhost. This is almost what I do with my Windows VM; installed Win 10 on it, downloaded the wallet software, and ran three different versions of cpuminer on it. (I come from the ESPERS thread, there have been 3 versions of cpuminers there I think.) I run Windows Server 2012 R2, so I use Hyper-V on one of my little boxes. I got it cheap, used, something like $600 USD for a dual quad core 48 GB ram rack server. Only stratum has been tested so I have no idea how it will behave if you try anything else.
|
|
|
|
Dabs
Legendary
Offline
Activity: 3416
Merit: 1912
The Concierge of Crypto
|
|
May 20, 2016, 01:24:00 AM |
|
The miners I tried used getwork gbt version 112. This fork should work similarly. I'm willing to do the testing. I've been solo mining ESPERS.
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 20, 2016, 01:41:54 AM |
|
The miners I tried used getwork gbt version 112. This fork should work similarly. I'm willing to do the testing. I've been solo mining ESPERS.
I appreciate your offer to test. Looking forward to your results. I hope I haven't broken anything.
|
|
|
|
ljglug
|
|
May 20, 2016, 03:21:49 PM |
|
How to compile ??
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 20, 2016, 03:27:22 PM |
|
How to compile ??
./autogen.sh ./configure CFLAGS="-O3 -march=native" --with-crypto --with-curl make
|
|
|
|
ljglug
|
|
May 20, 2016, 03:48:49 PM |
|
To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.
ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$ ./autogen.sh ./autogen.sh: 8: ./autogen.sh: aclocal: not found ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$ ./configure CFLAGS="-O3 -march=native" --with-crypto --with-curl checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no 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 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 whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for gcc option to accept ISO C99... none needed 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 whether gcc needs -traditional... no checking dependency style of gcc... gcc3 checking for ranlib... ranlib checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 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 sys/endian.h usability... no checking sys/endian.h presence... no checking for sys/endian.h... no checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for sys/sysctl.h... yes checking whether be32dec is declared... no checking whether le32dec is declared... no checking whether be32enc is declared... no checking whether le32enc is declared... no checking whether le16dec is declared... no checking whether le16enc is declared... no checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for getopt_long... yes checking whether we can compile AVX code... yes checking whether we can compile XOP code... yes checking whether we can compile AVX2 code... yes checking for json_loads in -ljansson... no checking for pthread_create in -lpthread... yes checking whether __uint128_t is supported... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating compat/Makefile config.status: creating compat/jansson/Makefile config.status: creating cpuminer-config.h config.status: executing depfiles commands ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$ make make all-recursive make[1]: Entering directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Making all in compat make[2]: Entering directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat' Making all in jansson make[3]: Entering directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat/jansson' depbase=`echo dump.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT dump.o -MD -MP -MF $depbase.Tpo -c -o dump.o dump.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo error.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT error.o -MD -MP -MF $depbase.Tpo -c -o error.o error.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo hashtable.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT hashtable.o -MD -MP -MF $depbase.Tpo -c -o hashtable.o hashtable.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo load.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT load.o -MD -MP -MF $depbase.Tpo -c -o load.o load.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo memory.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT memory.o -MD -MP -MF $depbase.Tpo -c -o memory.o memory.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo pack_unpack.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT pack_unpack.o -MD -MP -MF $depbase.Tpo -c -o pack_unpack.o pack_unpack.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo strbuffer.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT strbuffer.o -MD -MP -MF $depbase.Tpo -c -o strbuffer.o strbuffer.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo strconv.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT strconv.o -MD -MP -MF $depbase.Tpo -c -o strconv.o strconv.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo utf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT utf.o -MD -MP -MF $depbase.Tpo -c -o utf.o utf.c &&\ mv -f $depbase.Tpo $depbase.Po depbase=`echo value.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DHAVE_CONFIG_H -I. -I../.. -Iyes/include -Iyes/include -O3 -march=native -Iyes/include -Iyes/include -MT value.o -MD -MP -MF $depbase.Tpo -c -o value.o value.c &&\ mv -f $depbase.Tpo $depbase.Po rm -f libjansson.a ar cru libjansson.a dump.o error.o hashtable.o load.o memory.o pack_unpack.o strbuffer.o strconv.o utf.o value.o ar: `u' 修饰符被忽略,因为 `D' 为默认(参见 `U') ranlib libjansson.a make[3]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat/jansson' make[3]: Entering directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat' make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4/compat' make[2]: Entering directory '/home/ljg/桌面/cpuminer-opt-3.2.4' gcc -DHAVE_CONFIG_H -I. -Iyes/include -Iyes/include -fno-strict-aliasing -I./compat/jansson -I. -Iyes/include -Iyes/include -Wno-pointer-sign -Wno-pointer-to-int-cast -O3 -march=native -Iyes/include -Iyes/include -MT cpuminer-cpu-miner.o -MD -MP -MF .deps/cpuminer-cpu-miner.Tpo -c -o cpuminer-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c cpu-miner.c:38:23: fatal error: curl/curl.h: 没有那个文件或目录 compilation terminated. Makefile:1632: recipe for target 'cpuminer-cpu-miner.o' failed make[2]: *** [cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:3307: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:645: recipe for target 'all' failed make: *** [all] Error 2 ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 20, 2016, 03:57:45 PM |
|
cpu-miner.c:38:23: fatal error: curl/curl.h: 没有那个文件或目录 compilation terminated. Makefile:1632: recipe for target 'cpuminer-cpu-miner.o' failed make[2]: *** [cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:3307: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:645: recipe for target 'all' failed make: *** [all] Error 2 ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$
I presume the error is file not found. Please translate for me in the future. You need to install libcurl4-openssl-dev.
|
|
|
|
ljglug
|
|
May 20, 2016, 04:01:33 PM |
|
cpu-miner.c:38:23: fatal error: curl/curl.h: 没有那个文件或目录 compilation terminated. Makefile:1632: recipe for target 'cpuminer-cpu-miner.o' failed make[2]: *** [cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:3307: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:645: recipe for target 'all' failed make: *** [all] Error 2 ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$
I presume the error is file not found. Please translate for me in the future. You need to install libcurl4-openssl-dev. Yes, there is no file and directory.
|
|
|
|
ljglug
|
|
May 20, 2016, 04:11:08 PM |
|
cpu-miner.c:38:23: fatal error: curl/curl.h: 没有那个文件或目录 compilation terminated. Makefile:1632: recipe for target 'cpuminer-cpu-miner.o' failed make[2]: *** [cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:3307: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:645: recipe for target 'all' failed make: *** [all] Error 2 ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$
I presume the error is file not found. Please translate for me in the future. You need to install libcurl4-openssl-dev. Yes, there is no file and directory. curl/curl.h: 没有那个文件或目录 Yes, there is no file and directory
|
|
|
|
joblo (OP)
Legendary
Offline
Activity: 1470
Merit: 1114
|
|
May 20, 2016, 04:50:43 PM |
|
cpu-miner.c:38:23: fatal error: curl/curl.h: 没有那个文件或目录 compilation terminated. Makefile:1632: recipe for target 'cpuminer-cpu-miner.o' failed make[2]: *** [cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:3307: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ljg/桌面/cpuminer-opt-3.2.4' Makefile:645: recipe for target 'all' failed make: *** [all] Error 2 ljg@ljg-TBD:~/桌面/cpuminer-opt-3.2.4$
I presume the error is file not found. Please translate for me in the future. You need to install libcurl4-openssl-dev.Yes, there is no file and directory. curl/curl.h: 没有那个文件或目录 Yes, there is no file and directory My response was only 2 lines but you still managed to miss the most important part. Go back and read it again.
|
|
|
|
|