Building FreeRadius 2.0 on Mac OS X fails
Hi, I'm trying to build the current version of freeradius on my Mac OS X 10.5 Intel 64bit computer. First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with-mysql- include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories. Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed Any thoughts? Thanks for your help! Walter
Walter Krivanek, VividVisions wrote:
Hi,
I'm trying to build the current version of freeradius on my Mac OS X 10.5 Intel 64bit computer.
First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with-mysql-include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories.
Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed
Any thoughts?
Thanks for your help! Walter
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html CVS head fails at
_tls.c gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DDARWIN -Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -I/usr/local/src/freeradius-cvscurrent/src -I/usr/local/src/freeradius-cvscurrent/libltdl -I../.. -I../../libeap -DOPENSSL_NO_KRB5 -c rlm_eap_tls.c -fno-common -DPIC -o .libs/rlm_eap_tls.o gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DDARWIN -Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -I/usr/local/src/freeradius-cvscurrent/src -I/usr/local/src/freeradius-cvscurrent/libltdl -I../.. -I../../libeap -DOPENSSL_NO_KRB5 -c rlm_eap_tls.c -o rlm_eap_tls.o >/dev/null 2>&1 /usr/local/src/freeradius-cvscurrent/libtool --mode=link gcc -release 2.0.1-pre \ -module -export-dynamic -o rlm_eap_tls.la \ -rpath /usr/local/freeradius-cvs210108/lib rlm_eap_tls.lo rlm_eap_tls.c /usr/local/src/freeradius-cvscurrent/src/lib/libfreeradius-radius.la ../../libeap/libfreeradius-eap.la -lcrypto -lssl -lcrypto -framework DirectoryService -lresolv -lpthread rm -fr .libs/rlm_eap_tls.a .libs/rlm_eap_tls.la .libs/rlm_eap_tls.lai .libs/rlm_eap_tls.so gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/rlm_eap_tls-2.0.1-pre.so -bundle .libs/rlm_eap_tls.o /usr/local/src/freeradius-cvscurrent/src/lib/.libs/libfreeradius-radius.dylib ../../libeap/.libs/libfreeradius-eap.dylib -lssl -lcrypto -lresolv -lpthread -framework DirectoryService ld: file not found: /usr/local/freeradius-cvs100108/lib/libfreeradius-radius-2.0.0-beta.dylib collect2: ld returned 1 exit status make[9]: *** [rlm_eap_tls.la] Error 1 Can confirm the other two issues on stable 2.0.0. *** Warning: Linking the shared library rlm_perl.la against the *** static library /System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a is not portable! gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/rlm_perl-2.0.0.so -bundle .libs/rlm_perl.o /usr/local/src/freeradius-server-2.0.0/src/lib/.libs/libfreeradius-radius.dylib -L/usr/local/lib /System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a -L/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE -lperl -ldl -lm -lutil -lc -lresolv -lpthread -arch i386 -arch ppc -framework DirectoryService ld: warning in /usr/local/src/freeradius-server-2.0.0/src/lib/.libs/libfreeradius-radius.dylib, file is not of required architecture (cd .libs && rm -f rlm_perl.so && ln -s rlm_perl-2.0.0.so rlm_perl.so) ar cru .libs/rlm_perl.a /System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a rlm_perl.o /System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed make[6]: *** [rlm_perl.la] Error 1 make[5]: *** [common] Error 2 make[4]: *** [all] Error 2 make[3]: *** [common] Error 2 make[2]: *** [all] Error 2 make[1]: *** [common] Error 2 make: *** [all] Error 2 -- Arran Cudbard-Bell (A.Cudbard-Bell@sussex.ac.uk) Authentication, Authorisation and Accounting Officer Infrastructure Services | ENG1 E1-1-08 University Of Sussex, Brighton EXT:01273 873900 | INT: 3900
Arran Cudbard-Bell wrote:
CVS head fails at ... ld: file not found: /usr/local/freeradius-cvs100108/lib/libfreeradius-radius-2.0.0-beta.dylib
$ make distclean $ ./configure $ make You've done a "cvs update" in a tree that started off as 2.0.0-beta.
Can confirm the other two issues on stable 2.0.0.
*** Warning: Linking the shared library rlm_perl.la against the *** static library /System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a is not portable!
Perl is killing me. Alan DeKok.
Walter Krivanek, VividVisions wrote:
Hi,
I'm trying to build the current version of freeradius on my Mac OS X 10.5 Intel 64bit computer.
First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with-mysql-include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories.
Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed
Any thoughts?
Thanks for your help! Walter
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html I'm running 10.5.1 Leopard Server, Dual 64bit G4 PPC 1.33 Ghz
-- Arran Cudbard-Bell (A.Cudbard-Bell@sussex.ac.uk) Authentication, Authorisation and Accounting Officer Infrastructure Services | ENG1 E1-1-08 University Of Sussex, Brighton EXT:01273 873900 | INT: 3900
Hi Alan, Jim and Arran, thank you very much for your help, I finally did it. First, I had to discard rlm_perl. I haven't tried Jim's tip to install my own version of Perl. Then, I added the parameters --with-mysql-lib-dir and --with-mysql- include-dir to the configure command. Configure seems to expect the MySQL binaries to be in the PATH environment variable, which complicated things for me since I have three different versions of MySQL on my development machine. Another parameter like --with-mysql-bin-dir would be great. After a few changes this problem was solved. Then I configured FreeRadius, started it and got this error message: rlm_sql (freewave): Could not link driver rlm_sql_mysql: dlopen(/usr/ local/freeradius2/lib/rlm_sql_mysql-2.0.0.so, 9): Library not loaded: / usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib Referenced from: /usr/local/freeradius2/lib/rlm_sql_mysql-2.0.0.so Reason: image not found rlm_sql (freewave): Make sure it (and all its dependent libraries!) are in the search path of your system's ld. The reason was that FreeRadius expected the dylib file in /usr/local/ mysql/lib/mysql/ but it actually is located in /usr/local/mysql/lib/. So I simply created the directory mysql and copied the files there. A rather ugly hack but it helped. IMHO this path should also be configurable. Alan wrote:
That should be "--with-mysql-include-dir=..." What you have above is completely unsupported.
The configure script in src/modules/rlm_sql/drivers/rlm_sql_mysql/ seems to know about --with-mysql-dir. Another thing: Is there anything else to set than sqltrace and sqltracefile to get MySQL logs? Because sqltrace is set to yes and I still get no logs... :-( Thanks again, Walter
Walter Krivanek, VividVisions wrote:
Then, I added the parameters --with-mysql-lib-dir and --with-mysql-include-dir to the configure command. Configure seems to expect the MySQL binaries to be in the PATH environment variable, which complicated things for me since I have three different versions of MySQL on my development machine. Another parameter like --with-mysql-bin-dir would be great.
Setting the PATH for one run of a "configure" script is just as easy.
Then I configured FreeRadius, started it and got this error message: rlm_sql (freewave): Could not link driver rlm_sql_mysql: ... The reason was that FreeRadius expected the dylib file in /usr/local/mysql/lib/mysql/ but it actually is located in /usr/local/mysql/lib/.
No. FreeRADIUS does *not* look for libraries. The run-time linker on your system looks for libraries. FreeRADIUS just uses the features of that linker. What is happening is that the information available at compile time is different from the information available at run time. The only response is to say that your system needs to be fixed so that the linkers know where the libraries are, and that the list of libraries available at compile time is the same as what is available at run time.
Another thing: Is there anything else to set than sqltrace and sqltracefile to get MySQL logs? Because sqltrace is set to yes and I still get no logs... :-(
Run it in debugging mode, and check file permissions. Alan DeKok.
Alan DeKok wrote:
Walter Krivanek, VividVisions wrote:
Configure seems to expect the MySQL binaries to be in the PATH environment variable, which complicated things for me since I have three different versions of MySQL on my development machine. Another parameter like --with-mysql-bin-dir would be great.
Setting the PATH for one run of a "configure" script is just as easy.
Yes, but inconsistent. ;-)
The only response is to say that your system needs to be fixed so that the linkers know where the libraries are, and that the list of libraries available at compile time is the same as what is available at run time.
You're right, this seems to be a know problem with some MySQL installations. Here's a very interessting article how linking works in Mac OS X: http://www.cocoadev.com/index.pl?ApplicationLinking (mostly about Cocoa apps).
Run it in debugging mode, and check file permissions.
It works with -x but not with -X or -xx. Thanks, Walter
Walter Krivanek, VividVisions wrote:
First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with-mysql-include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories.
Can you post the errors? That might help...
Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed
If you don't need rlm_perl, then delete that entire directory. Alan DeKok.
Alan DeKok wrote:
Walter Krivanek, VividVisions wrote:
First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with-mysql-include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories.
Can you post the errors? That might help...
=== configuring in ./drivers/rlm_sql_mysql (/usr/local/install/ freeradius-server-2.0.0/src/modules/rlm_sql/./drivers/rlm_sql_mysql) configure: running /bin/sh ./configure '--prefix=/usr/local/ freeradius2' '--with-mysql-dir=/usr/local/mysql' '--enable-ltdl- install=no' --cache-file=/dev/null --srcdir=. checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for mysql_config... no checking for pthread_create in -lpthread... yes checking for mysql_init in -lmysqlclient_r... yes checking for mysql/mysql.h... no configure: WARNING: MySQL headers not found. Use --with-mysql-include- dir=<path>. configure: WARNING: silently not building rlm_sql_mysql. configure: WARNING: FAILURE: rlm_sql_mysql requires: mysql.h. And it doesn't matter if I use --with-mysql-dir or --with-mysql- include-dir. mysql.h exists in the mysql/include directory.
Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed
If you don't need rlm_perl, then delete that entire directory.
Ok, I'll try that. FYI: I'm running Perl v5.8.8. Bye, Walter
Walter Krivanek, VividVisions wrote:
configure: running /bin/sh ./configure '--prefix=/usr/local/freeradius2' '--with-mysql-dir=/usr/local/mysql'
That should be "--with-mysql-include-dir=..." What you have above is completely unsupported.
checking for mysql/mysql.h... no
Hmm... the "configure" script tries to use mysql_config, which is the preferred way to get the MySQL configuration parameters. e.g. try: $ PATH=$PATH:/usr/local/mysql/bin $ ./configure If it can find "mysql_config", it SHOULD work.
configure: WARNING: MySQL headers not found. Use --with-mysql-include-dir=<path>. configure: WARNING: silently not building rlm_sql_mysql. configure: WARNING: FAILURE: rlm_sql_mysql requires: mysql.h.
And it doesn't matter if I use --with-mysql-dir or --with-mysql-include-dir. mysql.h exists in the mysql/include directory.
Well, yes. But it's sometimes <mysql/mysql.h>, and other times <mysql.h>, depending on the MySQL version, OS, packager, time of day, moon phase, etc. The current configure script expects <mysql/mysql.h> OR, it prefers to use mysql_config. Alan DeKok.
Walter, I've overcome these problems on Tiger and offer these points in hopes it works on Leopard as well: 1] in my experience, rlm_perl doesn't like apple's perl install - haven't had the time to really figure out why, but installing my own build (tested with threaded/shared and w/o threads/static versions) of 5.8.8 and pointing to it does the trick. Once you've got your own perl installed, add this in your ./configure flags : PERL5LIB={your prefix}/lib/perl5/5.8.8/darwin-* 2] on linking to mysql, assuming you have a version 5.x.x install try : --with-mysql-lib-dir={your prefix}/lib/mysql5/mysql --with-mysql-include-dir={your prefix}/include/mysql5 Note, my installs of perl and mysql have been done via the macports system, so you'll want to double-check your paths against what i've shown here. Hope this helps! Jim P.S.: Another important thing, freeradius' default configure is set up to try to install all stable modules, but without strict dependencies. So modules that aren't necessary for basic functionality will fail (to build) silently if you're missing libraries they need (including, unixodbc, postgresql, mysql, kerberos). ___________________________________________________ James H. Graham II, Creative Director • Spark Media Group 6511 Allegheny Avenue • Takoma Park, MD 20912-4737 Tel: 301.270.4810 • Fax: 301.270.4812 • www.sparkmediagroup.com On Jan 21, 2008, at 7:32 AM, Walter Krivanek, VividVisions wrote: Hi, I'm trying to build the current version of freeradius on my Mac OS X 10.5 Intel 64bit computer. First, I have troubles with the configure script. Even if I show the script my exact location of the MySQL include files using --with- mysql-include-dir and similar, I'm getting warnings that mysql.h has not been found and that the MySQL module will be disabled. BTW: This also happens on my Debian server, where MySQL is installed in the standard directories. Then, when running make, I'm getting the following error: ranlib: archive member: .libs/rlm_perl.a(DynaLoader.a) fat file for cputype (18) cpusubtype (0) is not an object file (bad magic number) ar: internal ranlib command failed Any thoughts? Thanks for your help! Walter - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/ users.html
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Info -
Walter Krivanek, VividVisions