Skip to content
This repository was archived by the owner on Jan 9, 2021. It is now read-only.

Fix compile in OSX issues#8

Open
denics wants to merge 1 commit into
nicehash:masterfrom
denics:osx
Open

Fix compile in OSX issues#8
denics wants to merge 1 commit into
nicehash:masterfrom
denics:osx

Conversation

@denics

@denics denics commented May 22, 2017

Copy link
Copy Markdown

This is a first attempt to compile on OSX Sierra. At the moment it compiles, but there are still errors when linking.

@MaximusMcCann

Copy link
Copy Markdown

This would be nice :):)

@nikbass

nikbass commented Jul 11, 2017

Copy link
Copy Markdown

Have you been able to compile it for osx? If so how? thank you in advance

@fabulouspanda

fabulouspanda commented Aug 1, 2017

Copy link
Copy Markdown

I've compiled it for 10.11+ ( http://macminer.fabulouspanda.com/commandline/sgminer/) and I used these two changes plus a minor kernel modification to skein256.cl which allowed the compiled miner to run on macOS. All I did was add parenthesis, changing this:

__constant static const int ROT256[8][4] = {
        46, 36, 19, 37,
        33, 27, 14, 42,
        17, 49, 36, 39,
        44, 9, 54, 56,
        39, 30, 34, 24,
        13, 50, 10, 17,
        25, 29, 39, 43,
        8, 35, 56, 22,
};

to this:

__constant static const int ROT256[8][4] = {
    {
        46, 36, 19, 37,
        33, 27, 14, 42,
        17, 49, 36, 39,
        44, 9, 54, 56,
        39, 30, 34, 24,
        13, 50, 10, 17,
        25, 29, 39, 43,
        8, 35, 56, 22,
    }
};

Thanks denics!

@denics

denics commented Aug 3, 2017

Copy link
Copy Markdown
Author

It works for me too! @fabulouspanda , maybe you can merge it?
thanks a lot!

@fabulouspanda

Copy link
Copy Markdown

I had a lot of trouble seemingly as I'd forked from upstream but I deleted that repo and created a pull request from a new fork with just the kernel change #9

@aphex3k

aphex3k commented Oct 17, 2017

Copy link
Copy Markdown

I'm able to compile this build on macOS but executing the binary throws a lot of errors:

Error -11: Building Program (clBuildProgram)                    
<program source>:34:26: warning: unknown OpenCL extension 'cl_amd_printf' - ignoring
#pragma OPENCL EXTENSION cl_amd_printf : enable
                         ^
In file included from <program source>:95:
/Users/michaelhenke/src/sgminer-denics/./kernel/lyra2v2.cl:75:6: warning: no previous prototype for function 'reduceDuplexf'
void reduceDuplexf(ulong4* state ,__global ulong4* DMatrix)
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/lyra2v2.cl:100:6: warning: no previous prototype for function 'reduceDuplexRowf'
void reduceDuplexRowf(uint rowIn,uint rowInOut,uint rowOut,ulong4 * state, __global ulong4 * DMatrix)
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/lyra2v2.cl:150:6: warning: no previous prototype for function 'reduceDuplexRowSetupf'
void reduceDuplexRowSetupf(uint rowIn, uint rowInOut, uint rowOut, ulong4 *state, __global ulong4* DMatrix) {
     ^
In file included from <program source>:97:
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:51:2: error: array initializer must be an initializer list
        46, 36, 19, 37,
 ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:51:6: error: array initializer must be an initializer list
        46, 36, 19, 37,
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:51:10: error: array initializer must be an initializer list
        46, 36, 19, 37,
         ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:51:14: error: array initializer must be an initializer list
        46, 36, 19, 37,
             ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:52:2: error: array initializer must be an initializer list
        33, 27, 14, 42,
 ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:52:6: error: array initializer must be an initializer list
        33, 27, 14, 42,
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:52:10: error: array initializer must be an initializer list
        33, 27, 14, 42,
         ^
/Users/michaelhenke/src/sgminer-denics/./kernel/skein256.cl:52:14: error: array initializer must be an initializer list
        33, 27, 14, 42,
             ^
In file included from <program source>:99:
/Users/michaelhenke/src/sgminer-denics/./kernel/bmw256.cl:56:6: warning: no previous prototype for function 'expand32_1'
uint expand32_1(int i, uint *M32, uint *H, uint *Q)
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/bmw256.cl:68:6: warning: no previous prototype for function 'expand32_2'
uint expand32_2(int i, uint *M32, uint *H, uint *Q)
     ^
/Users/michaelhenke/src/sgminer-denics/./kernel/bmw256.cl:79:6: warning: no previous prototype for function 'Compression256'
void Compression256(uint *M32, uint *H)
     ^
<program source>:205:8: warning: unused variable 'gid'
  uint gid = get_global_id(0);
       ^
<program source>:232:7: warning: unused variable 'gid'
        uint gid = get_global_id(0);
      ^
<program source>:287:7: warning: unused variable 'gid'
 uint gid = get_global_id(0);
      ^
<program source>:359:7: warning: unused variable 'gid'
 uint gid = get_global_id(0);
      ^
<program source>:433:7: warning: unused variable 'gid'
        uint gid = get_global_id(0);
      ^
                    
[16:40:47] Failed to init GPU thread 1, disabling device 1                    
[16:40:47] thread_prepare failed for thread 1                    
Segmentation fault: 11

@fabulouspanda

Copy link
Copy Markdown

@aphex3k See my comment from Aug 1st which solves those issues. There are plenty of others to fix though!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants