The GRS macros have been a pain for me since day 1. I had to make changes so they could be included in
multiple algos. It looks like LTO likes them as much as I do. The problem is they're faster than the SPH versions.
Do the errors occur only with -flto or do they also occur with gcc 5.4.0 with my build.sh options? This code is only
compiled for SSE2 builds, I may have to drop support for it or degrade performance by using SPH functions in the future.
With your build.sh, without messing with LTO, I haven't seen any problem. But that was on avx/avx2 cpus. On non-avx cpu I compiled only today and that was straight with LTO. So now I did just that - downloaded 3.4.0 and ran the untouched build.sh. No error. But look at the remarkable speed difference when I compare it with 3.4.0 built with tpruvot's uncommented (LTO enabled) build.sh:
root@xxx:~/z/cpuminer-opt-3.4.0# ./cpuminer -a lyra2re --benchmark
********** cpuminer-multi 1.2-dev ***********
A CPU miner with multi algo support and optimized for CPUs
with AES_NI and AVX extensions.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
Forked from TPruvot's cpuminer-multi with credits
to Lucas Jones, elmad, palmd, djm34, pooler, ig0tik3d,
Wolf0, Jeff Garzik and Optiminer.
CPU: Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
CPU features: SSE2
SW built on Aug 5 2016 with GCC 5.4.0
SW features: SSE2
Algo features: SSE2 AES AVX AVX2
AES not available, starting mining with SSE2 optimizations...
[2016-08-05 19:03:55] 16 miner threads started, using 'lyra2re' algorithm.
[2016-08-05 19:03:56] Total: 983.04 kH, 872.93 kH/s
[2016-08-05 19:04:00] Total: 3218.22 kH, 927.88 kH/s
[2016-08-05 19:04:06] Total: 4515.37 kH, 896.32 kH/s
[2016-08-05 19:04:10] Total: 4143.24 kH, 907.80 kH/s
root@xxx:~/cpuminer-opt-sse# ./cpuminer -a lyra2re --benchmark
********** cpuminer-multi 1.2-dev ***********
A CPU miner with multi algo support and optimized for CPUs
with AES_NI and AVX extensions.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
Forked from TPruvot's cpuminer-multi with credits
to Lucas Jones, elmad, palmd, djm34, pooler, ig0tik3d,
Wolf0, Jeff Garzik and Optiminer.
CPU: Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
CPU features: SSE2
SW built on Aug 5 2016 with GCC 5.4.0
SW features: SSE2
Algo features: SSE2 AES AVX AVX2
AES not available, starting mining with SSE2 optimizations...
[2016-08-05 19:04:33] 16 miner threads started, using 'lyra2re' algorithm.
[2016-08-05 19:04:34] Total: 786.43 kH, 753.31 kH/s
[2016-08-05 19:04:38] Total: 3006.12 kH, 993.53 kH/s
[2016-08-05 19:04:43] Total: 4691.35 kH, 988.85 kH/s
[2016-08-05 19:04:48] Total: 4694.50 kH, 994.89 kH/s
[2016-08-05 19:04:53] Total: 4881.65 kH, 998.29 kH/s
it's pity you are not using a versioning system where you would have your improvements on top of tpruvot's. If you used github you could have had automatic linux/windows building done on travis-ci after every commit, including an automatic publishing of the binaries on github.
I can't figure out how to get my code into github. It must be simple but I haven't figured it out. I have an account and played with
it using the tutorial but I'm stuck.
I also want to make a gradual transition so I don't get bogged down trying to figure out github when I'm trying to focus
on the miner. The first phase is to continue development offline and upload releases.
I think this should be of help:
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/. Or, to make you feel better, you can always do what I did when I didn't know how to do this same thing: I created an empty repo on github, then
git clone it locally, then copied all the files into the directory, then
git add it and then just
git push it back to github
If I remember correctly when you try to push it the first time it will setup your github credentials, if you don't want it to ask you for your password every single time you can use
git config credential.helper store and it will save it and remember.
As for travis, it requires .travis.yml file to be present. This file already exists and it's quite self-explanatory if you look into it. Travis for public opensource projects is free and if you hook it up it will then automatically build after every commit you make. Those builds, for linux, are excellent in that they independently confirm your code is compilable (which you already knew anyway, but still..) but I wouldn't try to gather and publish the binaries, though. I wouldn't publish binaries for linux at all, you would just get into troubles and people are already used to compile themselves. But you can also setup building with win64 target using mingw and those I would publish so that you (the people) don't rely on some unknown third party. I don't want to spread paranoia or anything but you never know what did they do to the code, if they added something..
You can also get an .edu email for $2 from here:
https://bitcointalksearch.org/topic/vouchededu-email-2paypal-acceptedmany-promoshero-sellertons-of-vouches-1321638 which will (among others) allow you to get a github student pack for free, which in turn will (among others) give you access to travis-ci.com (as opposite to travis-ci.org) which is for private building (normally it would cost money, this way it would be free) and that you could use as a sandbox maybe..
But if you are serious about github there is one crucial decision you will have to make, not necessarily now. Whether you want to keep working on top of years old tpruvot's code and keep ignoring all changes and possible improvements he has done ever since you took his code and he will keep doing in the future, or if you actually extract all your changes from the old code you took, fork his repo and put them on top of it. That way you will stay in sync with him and will keep your changes being reapplied after every his commit. This would require quite a lot of work, the part where you extract your changes, it's just about making a diff, fast-forward his code to the recent and reapplying the diff. Maybe someone young and enthusiastic could do that? Unfortunately I am old and tired so I am out of the game.
Theoretically yes if there exists any earlier executed code that contained compiler produced AVX2 instructions from regular source.
That isn't likely since the capabilities check is done ealy in main.
Let's not forget that we ask gcc to compile and
optimize (all those -O2 -O3 -Ofast) for the cpu it's being run on. So regardless whether you actually include any explicit AVX/AVX2 assembler in the code, even a simple
printf("hi"); may produce AVX2 instruction(s) if the compiler feels like it. That's the whole point of the compiler compiling for the given cpu (-march=native) - it's allowed to use all the capabilities (and thus instruction sets) of the cpu.
EDIT: oh, Fuzzbawls was faster. Btw, Fuzzbawls, you wouldn't get by "ok" with strictly using the github website, you would commit a suicide. Editing file directly via the github website is possible but it's so painful, don't even try it. Let alone everytime you click on "save", of every file you changed, it creates a new commit, so then you can't even review your changes easily. Horrible, terrible. But for non-commandline people many IDEs have git integrated so you don't have to use git but you really would very hardly survive by using just the github website.