Installing gammu on Mac OS X
This mini tutorial will explain howto install gammu on Mac OS X, i’m using Mac OS X 10.5.8 and gammu 1.28.0.
To install gammu, you need cmake, and i’m using cmake 2.8.2, i installed it using Homebrew package manager.
To install Homebrew:
$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
Then, you can install cmake with:
$ brew install cmake
Download gammu 1.28.0 here
Next, extract and install it:
$ ./configure$ make
If you got errors like this:
Scanning dependencies of target array-test
[ 35%] Building C object tests/CMakeFiles/array-test.dir/array-test.o
Linking C executable array-test
[ 35%] Built target array-test
Scanning dependencies of target at-charset
[ 35%] Building C object tests/CMakeFiles/at-charset.dir/at-charset.o
Linking C executable at-charset
Undefined symbols:
“_iconv_open”, referenced from:
_IconvDecode in libGammu.a(coding.o)
_IconvEncode in libGammu.a(coding.o)
“_iconv_close”, referenced from:
_IconvDecode in libGammu.a(coding.o)
_IconvEncode in libGammu.a(coding.o)
“_iconv”, referenced from:
_IconvDecode in libGammu.a(coding.o)
_IconvEncode in libGammu.a(coding.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [tests/at-charset] Error 1
make[2]: *** [tests/CMakeFiles/at-charset.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
Then you’ve to configure cmake build to disable libiconv
$ mkdir build$ cd build$ cmake -DWITH_Iconv=OFF ..$ make$ sudo make install
Now, let’s connect the modem, i’m using Sierra USB Connect 881, and i got this information on /var/log/system.log:
Jul 16 22:34:10 macbooks-macbook kernel[0]: SierraSwitch: Version number – 1.2.1
Jul 16 22:34:10 macbooks-macbook kernel[0]: SierraSwitch: Driver Mode is 2 (Force Modem)
Jul 16 22:34:10 macbooks-macbook kernel[0]: SierraSwitch: Device version information for Mac OS:
Jul 16 22:34:10 macbooks-macbook kernel[0]: SierraSwitch: Revision = 0, SIPC = 24577(6001), SI Version = 1(1), CDPC = 0, CD Version = 0.0.0
Jul 16 22:34:10 macbooks-macbook kernel[0]: USBF: 41970.457 IOUSBInterface[0x418a700]::joinPMtree – could not find the hub device
Jul 16 22:34:13 macbooks-macbook kernel[0]: 0 0 SierraSupport: start – Default, suspend enabled for this device
Jul 16 22:34:13 macbooks-macbook kernel[0]: SierraSupport: Version number – 1.4.7, Input buffers 16, Output buffers 24
Unfortunately, it does not show where the modem attached on /dev/, because we need it to gammu configuration. So, i search it manually:
$ ls -la /dev | grep sierra
And it shows:
crw-rw-rw- 1 root wheel 17, 9 Jul 16 22:34 cu.sierra001
crw-rw-rw- 1 root wheel 17, 13 Jul 16 22:34 cu.sierra05
crw-rw-rw- 1 root wheel 17, 11 Jul 16 22:34 cu.sierracntl
crw-rw-rw- 1 root wheel 17, 8 Jul 16 22:34 tty.sierra001
crw-rw-rw- 1 root wheel 17, 12 Jul 17 01:04 tty.sierra05
crw-rw-rw- 1 root wheel 17, 10 Jul 17 01:04 tty.sierracntl
Now, let’s create gammu config:
$ cp /usr/local/share/doc/gammu/examples/config/gammurc ~/.gammurc
Mine is something like this:
[gammu]
device = /dev/tty.sierra05
connection = at115200
Finally, test the connection:
===============================
Add MySQL support
===============================
For example, i’ve smsdrc (gammu-smsd config file) like this:
[gammu]
device = /dev/tty.sierra05
connection = at115200[smsd]
service = MYSQL
PIN = 1234
logfile = /Users/White/.smsdlog
debuglevel = 255
Then i run gammu-smsd and it throws error:
macbooks-macbook:~ White$ gammu-smsd -c /Users/White/.smsdrc
Log filename is “/Users/White/.smsdlog”
gammu-smsd[97218]: MYSQL service was not compiled in!
gammu-smsd[97218]: Failed to setup SMSD service: Desired functionality has been disabled on compile time. (DISABLED[62])
Failed to run SMSD: Desired functionality has been disabled on compile time.
gammu-smsd[97218]: MYSQL service was not compiled in!
It’s because gammu can’t find mysql header library when you compile it.
To add MySQL support to gammu-smsd you need mysql installed, for example i use xampp for Mac OS X, and i’m using 1.7.3 version. All you need to do is download and install the XAMPP itself and the Developer package, cause it contains the header library we need.
.
Now, let’s compile gammu with mysql support, extract gammu as usual, edit cmake/FindMySQL.cmake, add your XAMPP mysql path, it should be look like this:
find_program(MYSQL_CONFIG mysql_config
${MYSQL_CONFIG_PREFER_PATH}
/usr/local/mysql/bin/
/usr/local/bin/
/usr/bin/
/Applications/XAMPP/xamppfiles/bin/
)
Then, let’s configure cmake:
$ mkdir build$ cd build$ cmake -DMYSQL_LIBRARIES=/Applications/XAMPP/xamppfiles/lib/mysql/libmysqlclient_r.dylib ..
If everything OK, then it should be show something like this one:
– Configuring Gammu 1.28.0
– Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
– Using mysql-config: /Applications/XAMPP/xamppfiles/bin/mysql_config
– Found MySQL: /Applications/XAMPP/xamppfiles/include/mysql, /Applications/XAMPP/xamppfiles/lib/mysql/libmysqlclient_r.dylib
– Could not find PostgreSQL
Then make and make install:
$ make$ sudo make install
Finally, run gammu-smsd again, if it doesn’t throw errors, then you’ve succeded, congrats
Have fun with gammu and gammu-smsd
Categories: Open Source
gammu, mac os x



Hi, I have the problem similiar with you, my linux (open suse 11.0) can’t found MYSQL support during running ./configure. After that, I download libmysqlclient-dev but only improve in line “Using mysql-config: /usr/bin/mysql_config” but “MySql not found” still there. My question is, what is realy ./configure search in Mysql support file, because all of header file (*.h) from Mysql already in usr/include/mysql and library file also available in usr/lib/mysql (those both path writen in FimdMySql.cmake. Another question is your command “cmake -DMYSQL_LIBRARIES=/Applications/XAMPP/xamppfiles/lib/mysql/libmysqlclient_r.dylib ..” means that only dynamic library with name “xxx_r” will be linked an the others was not?
Thanks
Hi
The ./configure command is looking for the mysql.h file, located somewhere on your filesystem. Mine is on /Applications/XAMPP/xamppfiles/include/mysql.
If you run mysql_config command, you’ll see where is your mysql working path.
libmysqlclient is the dynamic/shared library that gammmu need to get Mysql support, i believe linux comes up with .so extension.
I think you should try to build with custom cmake, not just ./configure, like i did on the post.
Hi Azhari, I’m currently trying compile this at Mac too. Do we need XCode from Apple Development ? Because at my Mac OS (10.6.4) the latest one, after I brew install cmake, comment “Xcode is not installed! Builds may fail!”.
Please advise dude
Hi, have you try to compile it (without the xcode)?
I’m using Xcode 3.1.4.
This link may help you.
http://webcache.googleusercontent.com/search?q=cache:Zy0cgp0rjZAJ:www.gammu.org/wiki/index.php%3Ftitle%3DGammu:Compiling/installing_on_Mac_OS_X%26redirect%3Dno+http://www.gammu.org/wiki/index.php%3Ftitle%3DGammu:Compiling/installing_on_Mac_OS_X&cd=8&hl=en&ct=clnk
no, this comment appeared when i try to run command ” brew install cmake”
gak paham deh klau pake Mac OS x
hello,
i’ve the same problem with you, even though i’ve done configuring the FimdMySql.cmake just like you did, and also recompile gammu.
any idea?
mysql_config said that it is on /usr/bin/mysql_config
thx
@mollie: Are you using xampp or mysql on Mac? All you need to do is find mysql.h header file, and libmysqlclient_r.dylib dynamic library to get gammu with mysql support.
azhari, i can’t run $ cp /usr/local/share/doc/gammu/examples/config/gammurc ~/.gammurc
notification : not such file or directory
really need help.. please
im using bandluxe modem n Xampp n osx 10.6.5
@bakhtiar: Have you run the “make install” command? Otherwise, why not create it (gammurc) manually? it’s a sample config provided by gammu, you can create it by yourself.
im really n00b on this command line things, so where i have to place the gammurc file? coz, seem like my gammu was install on download folder..
hey, I have some error, after I type ./configure. I thought its because I dont have Cmake, but I already install it in may Mac. anybody know how to solve this error??
Wrapper script for configuring CMake for Gammu.
This provides limited compatibility with configure, if you want full
configuration control, use directly CMake. More information about CMake
is available at .
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/Users/tr_mbil/Downloads/gammu-1.29.0/build-configure/CMakeFiles/CMakeCCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!
@trimbil: it’s look like you missed the “make” command. You can install it from Developer Tools
Thank Azhari, I’m make it, but I have another issue. when I am trying to configuration my device with command : gammu-config, I got message:
“You need dialog, cdialog or whiptail installed to make this work”
( I am using that command on my Ubuntu and that works but not in mac)
I have trying to find dialog or cdialog or whiptail on google but I can’t found anygood source for my mac. Do you any solution for this.
thanks for your answer.
@trimbil: gammu-config is just a tool to generate gammu configuration. You can just copy your gammu configuration from ubuntu to mac. Or you can create it manually, the configuration is not so hard. But, if you insist, try to install dialog from macports.
thanks for your answer, I got it now.
have you ever succeed making a call from gammu?
I am using gammu for sms gateway for long time ago but only for SMS gateway under windows but now I am trying to making call from gammu under linux and mac.
maybe you have any suggestion or advice for me? literature or tutorial.
thank in advance.
@trimbil: Never tried it out, but this link could help
http://wammu.eu/docs/manual/gammu/index.html#call-commands
Sorry, but I am come back with another problem
I am trying to connect ma nokia to the Mac and I am trying to identify the phone from system.log. but I just got this message from the system “May 9 16:57:21 remote191-125 pcscd[542]: Non-smartcard device launched pcscd [Vendor: 0X67B, Product: 0X2303]“.
do you know how to solve this? bytheway I am using Nokia 3310.
thank in advance
@trimbil: Not sure, maybe the pcscd somehow messed up your system. Try to turn it off.
Thanks kang, sukses dah walau sempet bingung.. ternyata folder /Applications/XAMPP/xamppfiles/include/mysql yg ga ada, solusinya install xampp-macosx-1.7.3-dev.dmg soalnya ane ga baca kalo ente bilang “All you need to do is download and install the XAMPP itself and the Developer package”
nice to meet u’r blog.can i ask?
how to configure gammu with mysql from macport?
@dean: I’m not sure because never try it, but i believe all binary and library from macports located on /opt/local. All you have to do is looking all required library and path, then install it just like i showed on the post.
Hi Azhary, i have an error like this after ” $ make ” from your instruction,
Linking C executable smsd
ld: warning: ignoring file /Applications/XAMPP/xamppfiles/lib/mysql/libmysqlclient.dylib, missing required architecture x86_64 in file
Undefined symbols for architecture x86_64:
“_mysql_close”, referenced from:
_SMSDMySQL_Free in libgsmsd.a(mysql.o)
_SMSDMySQL_Init in libgsmsd.a(mysql.o)
…
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[3]: *** [tests/smsd] Error 1
make[2]: *** [tests/CMakeFiles/smsd.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
can you figure it out?
thanks
I’m not sure but it’s looks like arch issue, you might want to set specific arch when running cmake (http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_build_universal_binaries_on_Mac_OS_X.3F)
Hello there im trying to compile but throws me this error:
[ 0%] Building C object helper/CMakeFiles/string.dir/string.o
In file included from /Users/nieldm/Documents/Github/gammu/helper/string.c:1:
/Users/nieldm/Documents/Github/gammu/helper/string.h:14:20: error: string.h: No such file or directory
In file included from /Users/nieldm/Documents/Github/gammu/helper/string.c:1:
/Users/nieldm/Documents/Github/gammu/helper/string.h:39: error: expected declaration specifiers or ‘…’ before ‘size_t’
/Users/nieldm/Documents/Github/gammu/helper/string.h:39: warning: conflicting types for built-in function ‘strncasecmp’
/Users/nieldm/Documents/Github/gammu/helper/string.h:58: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘towlower’
In file included from /Users/nieldm/Documents/Github/gammu/helper/string.c:3:
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:18:19: error: wchar.h: No such file or directory
In file included from /Users/nieldm/Documents/Github/gammu/helper/string.c:3:
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘UnicodeLength’
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:102: error: expected declaration specifiers or ‘…’ before ‘wchar_t’
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:109: error: expected declaration specifiers or ‘…’ before ‘size_t’
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:116: error: expected declaration specifiers or ‘…’ before ‘size_t’
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:164: error: expected declaration specifiers or ‘…’ before ‘wchar_t’
/Users/nieldm/Documents/Github/gammu/build/helper/../include/gammu-unicode.h:169: error: expected ‘)’ before ‘value’
/Users/nieldm/Documents/Github/gammu/helper/string.c:5:19: error: ctype.h: No such file or directory
/Users/nieldm/Documents/Github/gammu/helper/string.c: In function ‘strcasestr’:
/Users/nieldm/Documents/Github/gammu/helper/string.c:15: error: ‘size_t’ undeclared (first use in this function)
/Users/nieldm/Documents/Github/gammu/helper/string.c:15: error: (Each undeclared identifier is reported only once
/Users/nieldm/Documents/Github/gammu/helper/string.c:15: error: for each function it appears in.)
/Users/nieldm/Documents/Github/gammu/helper/string.c:15: error: expected ‘;’ before ‘len’
/Users/nieldm/Documents/Github/gammu/helper/string.c:19: error: ‘len’ undeclared (first use in this function)
/Users/nieldm/Documents/Github/gammu/helper/string.c:19: warning: incompatible implicit declaration of built-in function ‘strlen’
/Users/nieldm/Documents/Github/gammu/helper/string.c:23: error: ‘NULL’ undeclared (first use in this function)
/Users/nieldm/Documents/Github/gammu/helper/string.c:25: error: too many arguments to function ‘strncasecmp’
/Users/nieldm/Documents/Github/gammu/helper/string.c: In function ‘strchrnul’:
/Users/nieldm/Documents/Github/gammu/helper/string.c:36: warning: incompatible implicit declaration of built-in function ‘strchr’
/Users/nieldm/Documents/Github/gammu/helper/string.c:37: error: ‘NULL’ undeclared (first use in this function)
/Users/nieldm/Documents/Github/gammu/helper/string.c:37: warning: incompatible implicit declaration of built-in function ‘strlen’
/Users/nieldm/Documents/Github/gammu/helper/string.c: At top level:
/Users/nieldm/Documents/Github/gammu/helper/string.c:49: error: expected declaration specifiers or ‘…’ before ‘size_t’
/Users/nieldm/Documents/Github/gammu/helper/string.c: In function ‘strncasecmp’:
/Users/nieldm/Documents/Github/gammu/helper/string.c:55: error: ‘n’ undeclared (first use in this function)
/Users/nieldm/Documents/Github/gammu/helper/string.c: At top level:
/Users/nieldm/Documents/Github/gammu/helper/string.c:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘towlower’
make[2]: *** [helper/CMakeFiles/string.dir/string.o] Error 1
make[1]: *** [helper/CMakeFiles/string.dir/all] Error 2
make: *** [all] Error 2
thanks
Are you installing gammu from git repository? Please try the latest stable source instead.
yes i just clone from this git repository
git clone git://gitorious.org/gammu/mainline.git gammu
I got that error running just
./configure
make
And we i follow the guide i get the same error using the cmake
thanks
I suggest you to report to gammu mailing list (http://wammu.eu/support/lists/)