Author

Topic: CGMiner & OSX (Read 2005 times)

member
Activity: 96
Merit: 10
April 15, 2013, 11:30:03 PM
#14
OK, here's the issue with ADL_SDK and cgminer on os x:
- the adl_sdk.h uses __stdcall which isn't supported with clang on os x, removing that fixes compilation

Great catch! I installed a different buildchain (gcc47), and deleting the reference to « __stdcall » but compiling still didn't work:

Code:
In file included from miner.h:106:0,
                 from cgminer.c:44:
ADL_SDK/adl_sdk.h:22:27: error: expected ')' before '*' token
make[2]: *** [cgminer-cgminer.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

HOWEVER, once it compiles you will get link errors because the AMD libs/driver for OS X simply don't have the required ADL layer compiled in... so no use trying.

Is there anyway to install the necessary layers?
newbie
Activity: 36
Merit: 0
April 12, 2013, 06:57:55 PM
#13
Any news on this... I was working on this myself. But since my knowledge base is fairly limited to rooting my phone, most of this seems foreign. I appreciate everyone taking their time to share their findings and info.
newbie
Activity: 13
Merit: 0
April 10, 2013, 07:05:40 AM
#12
OK, here's the issue with ADL_SDK and cgminer on os x:
- the adl_sdk.h uses __stdcall which isn't supported with clang on os x, removing that fixes compilation

HOWEVER, once it compiles you will get link errors because the AMD libs/driver for OS X simply don't have the required ADL layer compiled in... so no use trying.

Also "-mnative" is a bogus flag, don't use it.
newbie
Activity: 13
Merit: 0
April 04, 2013, 01:00:21 PM
#11
Try the following:
Update your Xcode to the latest and install command line tools/update.
If that doesn't work, you might try an alternative toolchain via brew.
member
Activity: 96
Merit: 10
April 04, 2013, 11:41:07 AM
#10
compiling without ADL works just fine, my question was ADL specific Smiley
newbie
Activity: 13
Merit: 0
April 04, 2013, 07:41:55 AM
#9
I would have posted this to the official cgminer thread, but I'm still a newb...

I can get vanilla cgminer to compile and mine on OSX with openCL support, but building with the ADL_SDK includes via « ./autogen.sh && make » results in the following compile error:

Code:

  AR       libccan.a
  CC       cgminer-cgminer.o
In file included from miner.h:106,
                 from cgminer.c:44:
ADL_SDK/adl_sdk.h:26: error: expected ‘)’ before ‘*’ token
make[2]: *** [cgminer-cgminer.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Likewise, « ./autogen.sh && CFLAGS="-O2 -Wall -march=native" ./configure » fails with

Code:

checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/kentdavis/numismatics/cgminer':
configure: error: C compiler cannot create executables

I'd be happy to start maintaining an OSX fork if I can get some help sorting this out...

I am guessing -mnative does not make sense to your compiler so the compiler check failed. Did you want -m32 or -m64?
newbie
Activity: 13
Merit: 0
April 04, 2013, 07:34:59 AM
#8
P.S. You need to have the latest Xcode installed.
Also, from Xcode go to Preferences/Downloads and install the command line tools in order to have gcc/make outside of Xcode.

You could run using "xcrun..." but that's a whole other story.
newbie
Activity: 13
Merit: 0
April 04, 2013, 07:31:10 AM
#7
I've actually compiled this yesterday hassle free.

I am a developer but it wasn't a challenge, no matter your level.

What you need:
1 .hombrew: http://brew.sh (ruby should be installed already)

Once brew is installed do a 'brew update' in the console
Now, I am not sure what packages are needed because I have lots of them already installed but the configure script will let you know what you are missing Smiley.

2. Install git if needed (on Mountain Lion I think it comes preinstalled, check if you already have it)

3. Do a 'git clone https://github.com/ckolivas/cgminer.git'

This creates a cgminer folder in your current folder (console)

Now, automake scripts use pkg-config which doesn't automatically pick up brew packages so you need to do this export:
export PKG_CONFIG_PATH=/usr/local/Library/ENV/pkgconfig/10.8/
(for OS X 10.Cool

I put mine in /etc/bashrc so it's always there.

4. After doing the export in the previous section run "./autogen.sh" from cgminer folder
If you're missing stuff install them via 'brew install'

5. Do a './configure CFLAGS="-O3"'

6. Do a sudo make install to build it and copy it in your bin folder

Umm... that's it.

Unlike other ppl I am not gonna beg for a penny for this very basic info Smiley
Would post anywhere else but I a "newbie"
lbr
sr. member
Activity: 423
Merit: 254
April 04, 2013, 02:15:52 AM
#5
checking for gcc... gcc
checking whether the C compiler works... no
^^
This makes me think that you are using llvm-gcc or some old gcc.
lbr
sr. member
Activity: 423
Merit: 254
April 04, 2013, 02:04:29 AM
#4
Successfully compiled latest cgminer on
Mac Mini, Mac OS X 10.6.x, xCode installed(whether xCode installed or not affects brew installation paths)

Install "home brew"
Install missing libraries via "brew install"
F.e. - "brew install autoconf automake libtool"
I've also installed latest gcc

Had to tamper with autotools-
"
eval `brew --config | grep HOMEBREW_PREFIX | sed 's/: /=/'`
sudo bash -c 'echo '$HOMEBREW_PREFIX/share/aclocal5' >> `aclocal --print-ac-dir`/dirlist'
"
Essentially you want to make sure that in "dirlist" every m4 paths are written.


I've used following flags-
export CC="gcc-4.8"
export CFLAGS="-O3 -pipe -march=core2 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -fPIC -mmacosx-version-min=10.6.8"
export CXXFLAGS="${CFLAGS}"
export ARCHFLAGS="-arch i386-apple-darwin11.2.0 -arch x86_64-apple-darwin11.2.0"

Flags were detected automatically by gcc -
$ echo "" | gcc -march=native -v -E - 2>&1 | grep cc1
http://en.gentoo-wiki.com/wiki/Hardware_CFLAGS though this page is offline atm

./autogen.sh --enable-cpumining --enable-scrypt --build=x86_64-apple-darwin11.2.0
Without specifying --build it all was going very wrong.

Also I had to force yasm to produce macho64 and not elf
/usr/local/bin/yasm -f macho64 x86_64/sha256_xmm_amd64.asm
Or you can manually change "Makefile"
change
    $(YASM) -f elf64 $<
to
    $(YASM) -f macho64 $<
member
Activity: 79
Merit: 10
April 04, 2013, 01:33:05 AM
#3
This was the page I used to help compile it.

http://dblamb.com/meh/compiling-cgminer-on-mac-os-x/

My problem was some missing ports, especially readlink - read the post comments.



newbie
Activity: 42
Merit: 0
April 04, 2013, 01:22:32 AM
#2
for your second message, drop -march=native from your CFLAGS. Should compile then.

for the first, I've also had to pull the ADL_SDK to get it to compile. Not sure why just yet.
member
Activity: 96
Merit: 10
March 27, 2013, 10:06:04 PM
#1
I would have posted this to the official cgminer thread, but I'm still a newb...

I can get vanilla cgminer to compile and mine on OSX with openCL support, but building with the ADL_SDK includes via « ./autogen.sh && make » results in the following compile error:

Code:

  AR       libccan.a
  CC       cgminer-cgminer.o
In file included from miner.h:106,
                 from cgminer.c:44:
ADL_SDK/adl_sdk.h:26: error: expected ‘)’ before ‘*’ token
make[2]: *** [cgminer-cgminer.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Likewise, « ./autogen.sh && CFLAGS="-O2 -Wall -march=native" ./configure » fails with

Code:

checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/user/numismatics/cgminer':
configure: error: C compiler cannot create executables

I'd be happy to start maintaining an OSX fork if I can get some help sorting this out...
Jump to: