Proxmark developers community

Research, development and trades concerning the powerful Proxmark3 device! Remember sharing is caring. Bring something back to the community.

You are not logged in.

#1 2013-08-11 16:05:05

Rix
Member
Registered: 2012-09-08
Posts: 2

Note to compile Proxmark on Mac OSX

I know compiling things on OSX is suffering. This note shows my steps compiling Proxmark3 r756 on Mac OSX.

First I have a basic environment on Mac OSX Mountain Lion with Xcode Command Line Tool, and Homebrew installed.

Then you need to install all the dependencies for Proxmark3 listed in COMPILING.txt. Because there are too many
libraries on my machine, I didn't remember those are needed. If I missed something, please reply smile. OSX included
libpthread as a system library so you don't need to install. Qt4 can be downloaded here http://qt-project.org/downloads.
One thing to note that brew's readline formula didn't install it in the right place. I hope they can fix it, but I recommand
you to install from GNU source. However there are some tips you should follow when you tried in this way. Download
and extract readline from: http://git.savannah.gnu.org/cgit/readline.git/snapshot/readline-master.tar.gz

./configure –prefix=/usr/local
cd shlib
sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.good
mv Makefile.good Makefile
cd ..
make
sudo make install

Referenced from: http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion

Additionally, libusb from brew seems not compatible to Proxmark3. You need to install the libusb-compat formula as well.

brew install libusb libusb-compat --universal

Finally, you need an ARM cross-compiler, the most pains-taking thing you need to compile yourself. If you don't need to
compile bootrom, just ignore it. I recommend you to use https://github.com/jsnyder/arm-eabi-toolchain

brew install mpfr gmp libmpc libelf texinfo
git clone https://github.com/jsnyder/arm-eabi-toolchain.git
cd arm-eabi-toolchain
make install-cross

Take a snap, have some coffee… The binary is installed in ~/arm-cs-tools/bin, just add it to your PATH.

Now you are armed to compile Proxmark3. In the source folder:

make

Every thing will be done for while. In order to use the client, you need to install a 'driver' then.

cd client
sudo make install_kext
sudo kextcache -system-caches

That's it, enjoy.

Offline

#2 2013-08-13 19:41:25

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

The method was exactly the same for me, but with one difference I used Macports to install Qt4 libraries.

I used the following patch, on the Makefile inorder to compile the client on OSX 10.7+ (lion+):

--- Makefile.bak 2013-08-11 20:42:11.000000000 +0100
+++ Makefile 2013-08-11 21:34:39.000000000 +0100
@@ -21,8 +21,8 @@ CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)
QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
MOC = $(QTDIR)/bin/moc
else ifeq ($(platform),Darwin)
-CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
-QTLDLIBS = -framework QtGui -framework QtCore
+CXXFLAGS = -I/opt/local/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/opt/local/Library/Frameworks/QtCore.framework/Versions/Current/Headers
+QTLDLIBS = -lQtCore -lQtGui
MOC = moc
else
CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4

Offline

#3 2013-11-25 22:31:10

moebius
Contributor
Registered: 2011-03-10
Posts: 199

Re: Note to compile Proxmark on Mac OSX

Hello! While trying to recompile the client, I'm getting the above error. I'm running Mavericks with QT installed by the use of the bundle in their webpage... Every time I update something, like the OS, it's a pain in the 4$$ ... maybe one of you here can help me, thanks!

g++ -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers -c -o obj/proxgui.o proxgui.cpp
In file included from proxgui.cpp:12:
In file included from ./proxguiqt.h:11:
In file included from /Library/Frameworks/QtGui.framework/Versions/Current/Headers/QApplication:1:
/Library/Frameworks/QtGui.framework/Versions/Current/Headers/qapplication.h:45:10: fatal error: 'QtCore/qcoreapplication.h' file not found
#include <QtCore/qcoreapplication.h>
         ^
1 error generated.
make: *** [obj/proxgui.o] Error 1

Offline

#4 2013-11-26 00:40:00

moebius
Contributor
Registered: 2011-03-10
Posts: 199

Re: Note to compile Proxmark on Mac OSX

I will answer myself... smile

Since Mavericks, QTLibs are not "compatible" anymore... there are some issues like the one I posted... so, This is what I did to make it running..

The thing is that you need to replace, eg #include <QtCore/qcoreapplication.h> in /Library/Frameworks/QtGui.framework/Versions/Current/Headers/qapplication.h with <qcoreapplication.h>

So, I ran this command (this is just an example):

perl -pi -e 's/QtCore\///g' /Library/Frameworks/QtGui.framework/Versions/Current/Headers/*.h

and replace every QtCore\ with <blank>... you'll need to do the same for QtGui\ with <blank>

The same for /Frameworks/QtCore.framework/...

and then, modify the Makefile, find QTLDLIBS flag and remove the options...

Well, that's all, maybe in some new versiones, we have everything running out of the box again smile

Cheers!

Last edited by moebius (2013-11-26 00:43:22)

Offline

#5 2013-12-30 12:45:01

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

QT is finally working in Mavericks again

Mavericks Client Patch (Worked for me):

client\Makefile

--- Makefile.old	2013-12-30 11:45:50.000000000 +0000
+++ Makefile	2013-12-30 09:35:08.000000000 +0000
@@ -24,9 +24,9 @@ QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQt
 MOC = $(QTDIR)/bin/moc
 LUAPLATFORM = mingw
 else ifeq ($(platform),Darwin)
-CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
-QTLDLIBS = -framework QtGui -framework QtCore
-MOC = moc 
+CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
+QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+MOC = $(shell pkg-config --variable=moc_location QtCore)
 LUAPLATFORM = macosx
 else
 CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4

Offline

#6 2014-02-04 00:51:18

Omikron
Contributor
Registered: 2010-02-12
Posts: 76

Re: Note to compile Proxmark on Mac OSX

midnitesnake wrote:

QT is finally working in Mavericks again

Mavericks Client Patch (Worked for me):

client\Makefile

--- Makefile.old	2013-12-30 11:45:50.000000000 +0000
+++ Makefile	2013-12-30 09:35:08.000000000 +0000
@@ -24,9 +24,9 @@ QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQt
 MOC = $(QTDIR)/bin/moc
 LUAPLATFORM = mingw
 else ifeq ($(platform),Darwin)
-CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
-QTLDLIBS = -framework QtGui -framework QtCore
-MOC = moc 
+CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
+QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+MOC = $(shell pkg-config --variable=moc_location QtCore)
 LUAPLATFORM = macosx
 else
 CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4

I followed all of the instructions in the OP and also have applied this patch, but I am getting the following error when I try to compile the environment in 10.9.1:

g++  -Wall -O4 obj/proxmark3.o obj/uart.o obj/util.o obj/sleep.o obj/nonce2key/crapto1.o obj/nonce2key/crypto1.o obj/nonce2key/nonce2key.o obj/mifarehost.o obj/crc16.o obj/iso14443crc.o obj/iso15693tools.o obj/data.o obj/graph.o obj/ui.o obj/cmddata.o obj/cmdhf.o obj/cmdhf14a.o obj/cmdhf14b.o obj/cmdhf15.o obj/cmdhfepa.o obj/cmdhflegic.o obj/cmdhficlass.o obj/cmdhfmf.o obj/cmdhw.o obj/cmdlf.o obj/cmdlfhid.o obj/cmdlfem4x.o obj/cmdlfhitag.o obj/cmdlfti.o obj/cmdparser.o obj/cmdmain.o obj/cmdlft55xx.o obj/cmdlfpcf7931.o obj/pm3_binlib.o obj/scripting.o obj/cmdscript.o obj/pm3_bitlib.o guidummy.o -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread ../liblua/liblua.a  -o proxmark3
ld: warning: directory not found for option '-L/opt/local/lib'
ld: '_rl_redisplay' in /usr/local/lib/libreadline.a(display.o) contains undefined reference for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [proxmark3] Error 1
make: *** [client/all] Error 2

Any thoughts on how to remedy this?  My Google-Fu is weak today and I'm not sure what's going on.

Offline

#7 2014-02-04 01:28:07

Omikron
Contributor
Registered: 2010-02-12
Posts: 76

Re: Note to compile Proxmark on Mac OSX

Assuming it's relevant, I also have Xcode 5 installed.

Offline

#8 2014-02-04 21:35:18

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

What happens when you run the following?

pkg-config --cflags QtCore QtGui
pkg-config --libs QtCore QtGui

have you remembered to run the following after upgrading macports?

xcode-select --install

Offline

#9 2014-02-05 01:34:00

Omikron
Contributor
Registered: 2010-02-12
Posts: 76

Re: Note to compile Proxmark on Mac OSX

midnitesnake wrote:

What happens when you run the following?

pkg-config --cflags QtCore QtGui
pkg-config --libs QtCore QtGui

have you remembered to run the following after upgrading macports?

xcode-select --install

Here's the output from the first commands:

Last login:  on ttys000
MBP-2:~ User$ pkg-config --cflags QtCore QtGui
-DQT_SHARED -I/usr/local/Cellar/qt/4.8.5/include -I/usr/local/Cellar/qt/4.8.5/include/QtGui -I/usr/local/Cellar/qt/4.8.5/include -I/usr/local/Cellar/qt/4.8.5/include/QtCore 
MBP-2:~ User$ pkg-config --libs QtCore QtGui
-F/usr/local/Cellar/qt/4.8.5/lib -framework QtGui -F/usr/local/Cellar/qt/4.8.5/lib -framework QtCore 
MBP-2:~ User$ 

As far as the second command, when I run it I get a dialog box asking if I want to install the command-line tools from the App Store, which of course I do.  However, after doing so I get an error that says "Can't install the software because it is not currently available from the Software Update server."

I do already have Xcode 5 installed.

Regardless, I manually grabbed the DMG package from https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#

It installed successfully, but the errors I get when attempting to compile are still the same.

Offline

#10 2014-02-08 20:57:35

moebius
Contributor
Registered: 2011-03-10
Posts: 199

Re: Note to compile Proxmark on Mac OSX

hey, while running "data plot" I get: "No GUI in this build!".... I just don't know how to get this fixed!

anyone?

I'm running on Mavericks, svn 844.

Thanks!

Offline

#11 2014-02-11 21:06:28

jonor
Contributor
Registered: 2009-09-17
Posts: 95

Re: Note to compile Proxmark on Mac OSX

Omikron wrote:
g++  -Wall -O4 obj/proxmark3.o obj/uart.o obj/util.o obj/sleep.o obj/nonce2key/crapto1.o obj/nonce2key/crypto1.o obj/nonce2key/nonce2key.o obj/mifarehost.o obj/crc16.o obj/iso14443crc.o obj/iso15693tools.o obj/data.o obj/graph.o obj/ui.o obj/cmddata.o obj/cmdhf.o obj/cmdhf14a.o obj/cmdhf14b.o obj/cmdhf15.o obj/cmdhfepa.o obj/cmdhflegic.o obj/cmdhficlass.o obj/cmdhfmf.o obj/cmdhw.o obj/cmdlf.o obj/cmdlfhid.o obj/cmdlfem4x.o obj/cmdlfhitag.o obj/cmdlfti.o obj/cmdparser.o obj/cmdmain.o obj/cmdlft55xx.o obj/cmdlfpcf7931.o obj/pm3_binlib.o obj/scripting.o obj/cmdscript.o obj/pm3_bitlib.o guidummy.o -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread ../liblua/liblua.a  -o proxmark3
ld: warning: directory not found for option '-L/opt/local/lib'
ld: '_rl_redisplay' in /usr/local/lib/libreadline.a(display.o) contains undefined reference for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [proxmark3] Error 1
make: *** [client/all] Error 2

I don't have a MacOSX for test. Could you try to find if you have some other libreadline.a in your system?

g++  -Wall -O4 obj/proxmark3.o obj/uart.o obj/util.o obj/sleep.o obj/nonce2key/crapto1.o obj/nonce2key/crypto1.o obj/nonce2key/nonce2key.o obj/mifarehost.o obj/crc16.o obj/iso14443crc.o obj/iso15693tools.o obj/data.o obj/graph.o obj/ui.o obj/cmddata.o obj/cmdhf.o obj/cmdhf14a.o obj/cmdhf14b.o obj/cmdhf15.o obj/cmdhfepa.o obj/cmdhflegic.o obj/cmdhficlass.o obj/cmdhfmf.o obj/cmdhw.o obj/cmdlf.o obj/cmdlfhid.o obj/cmdlfem4x.o obj/cmdlfhitag.o obj/cmdlfti.o obj/cmdparser.o obj/cmdmain.o obj/cmdlft55xx.o obj/cmdlfpcf7931.o obj/pm3_binlib.o obj/scripting.o obj/cmdscript.o obj/pm3_bitlib.o guidummy.o -lreadline -lpthread ../liblua/liblua.a  -o proxmark3

Can you try this command? I have removed all path of libraries. Maybe you got a "can't find libreadline"

Offline

#12 2014-02-12 08:20:13

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

Omikron , not sure what has happened to your makefile - looks like it has become corrupt

if you run the g++ command manually you need to swap -L/opt/local/lib -L/usr/local/lib for -L/usr/local/Cellar/  you may have to do it for other libraries like libreadline. 

I would consult the brew documentation/forums for help!

Offline

#13 2014-02-12 08:22:49

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

moebius wrote:

hey, while running "data plot" I get: "No GUI in this build!".... I just don't know how to get this fixed!

anyone?

I'm running on Mavericks, svn 844.

Thanks!

Sounds like you may have stripped the QT parts out of your makefile ; I had to do this temporarily until Mavericks finally got around to solving the QT problem. 

QT has worked fine with me on the proxmark since somewhere around svn 804, just a matter of getting the Makefile to recognise where your libraries are installed on your build.

I found it easy with macports, I know others use brew and are still having issues.

Offline

#14 2014-02-14 00:06:00

Omikron
Contributor
Registered: 2010-02-12
Posts: 76

Re: Note to compile Proxmark on Mac OSX

midnitesnake wrote:

Omikron , not sure what has happened to your makefile - looks like it has become corrupt

if you run the g++ command manually you need to swap -L/opt/local/lib -L/usr/local/lib for -L/usr/local/Cellar/  you may have to do it for other libraries like libreadline. 

I would consult the brew documentation/forums for help!

How can you tell it has become corrupted?  I haven't touched or modified it.  It's the same one that I grabbed via SVN.

Offline

#15 2014-03-14 21:49:26

Omikron
Contributor
Registered: 2010-02-12
Posts: 76

Re: Note to compile Proxmark on Mac OSX

Omikron wrote:
midnitesnake wrote:

Omikron , not sure what has happened to your makefile - looks like it has become corrupt

if you run the g++ command manually you need to swap -L/opt/local/lib -L/usr/local/lib for -L/usr/local/Cellar/  you may have to do it for other libraries like libreadline. 

I would consult the brew documentation/forums for help!

How can you tell it has become corrupted?  I haven't touched or modified it.  It's the same one that I grabbed via SVN.

I suppose the only modification I made was the aforementioned QT patch for Mavericks.  Prior to applying the patch, I would observe QT errors.  After applying the patch, the behavior is as described.

Any further thoughts from anyone who's successfully compiled under Mavericks?

Offline

#16 2014-03-25 19:56:12

camilojaraba
Member
Registered: 2014-03-25
Posts: 4

Re: Note to compile Proxmark on Mac OSX

Hello Everybody, I just finally get the recent (r852) from svn compiled without errors.

The thing is I'm on MacOSX Mavericks 10.9.2, Xcode 5.1 (5B130a).

When I plug the proxmark3 on the USB it is recognized by the system, but it does not map any port under /dev/tty(ANYTHING) or something.

Under the system it appears as Serial Number ChangeMe with VendorID: 9AC4 and ProductID: 4B8F

When trying to run the client, it doesn't find the device:

MacBook-Pro:client User$ ./proxmark3
syntax: ./proxmark3 <port>

Can anyone please give some light?

Thanks in advance.

Offline

#17 2014-03-25 20:02:50

asper
Contributor
Registered: 2008-08-24
Posts: 1,408

Re: Note to compile Proxmark on Mac OSX

You must write proxmark3 followed by com port.

Offline

#18 2014-03-25 20:41:10

camilojaraba
Member
Registered: 2014-03-25
Posts: 4

Re: Note to compile Proxmark on Mac OSX

Thanks for reply, that's the thing. how can i know the com port? it doesn't map anything over /dev/tty*** or any other.

Thanks a lot.

Offline

#19 2014-03-25 23:35:18

asper
Contributor
Registered: 2008-08-24
Posts: 1,408

Re: Note to compile Proxmark on Mac OSX

Unfortunately i don't know how mac maps serial ports.

Offline

#20 2014-03-26 00:02:47

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

Under the system it appears as Serial Number ChangeMe with VendorID: 9AC4 and ProductID: 4B8F

Doesn't sound right? Have you updated the boot loader?

Offline

#21 2014-03-26 01:52:46

camilojaraba
Member
Registered: 2014-03-25
Posts: 4

Re: Note to compile Proxmark on Mac OSX

midnitesnake wrote:

Under the system it appears as Serial Number ChangeMe with VendorID: 9AC4 and ProductID: 4B8F

Doesn't sound right? Have you updated the boot loader?

Thank you for answer.

I'm just new with it, I just bought it from proxmark3.com
Download code from svn googlecode, compile with no errors (after correcting the client/Makefile)

Then plug the USB but it don't map like docs says /dev/ttyACM0 or something like that.

Thank you for your help.

Offline

#22 2014-03-26 02:15:44

camilojaraba
Member
Registered: 2014-03-25
Posts: 4

Re: Note to compile Proxmark on Mac OSX

Ok after reading again the docs, it says my new board is HID not com port anymore.

it's revision r651

On ubuntu I got :

root@ubuntuvm:~/proxmark3# ./proxmark3

Connected units:
    1. SN: ChangeMe [001/003]
proxmark3> hw version
#db# Prox/RFID mark3 RFID instrument                 
#db# bootrom: svn 486-unclean 2011-08-28 18:52:03                 
#db# os: svn 651-suspect 2013-01-25 15:52:19                 
#db# FPGA image built on 2012/ 1/ 6 at 15:27:56                 
proxmark3>

Anyway over the Mac OSX even compiling the same r651 version, it ask me for the COM port.

Any suggestion?
Thanks again.

Offline

#23 2014-03-26 08:15:27

midnitesnake
Contributor
Registered: 2012-05-11
Posts: 151

Re: Note to compile Proxmark on Mac OSX

bootrom: svn 486-unclean 2011-08-28 18:52:03

think you need to upgrade at least the bootrom, using an old flasher with a newer bootrom, then upgrade the entire os or full image and then everything should fall into place.

Offline

Board footer

Powered by FluxBB