Page 1 of 1

installing on Mac OS 10.9, 64-bit

Posted: Thu Oct 31, 2013 8:37 pm
by richardb
Hey all, I am trying to install the software on my MacBook Pro running 10.9. I am running through the instructions in the Wiki, but I keep getting an error on the make step:

Code: Select all

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [output/libbladeRF.0.dylib] Error 1
make[1]: *** [libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/all] Error 2
make: *** [all] Error 2
I assume this is because it is running under a 64-bit OS. How can I make this work?

Re: installing on Mac OS 10.9, 64-bit

Posted: Sat Nov 23, 2013 2:08 pm
by lvbernal
Hi! I think the main error during the installation on Mavericks is the change in the function "clock_gettime": now its called "clock_get_time".

/bladeRF/host/utilities/bladeRF-cli/src/cmd/rxtx.c:703:18: error:
implicit declaration of function 'clock_gettime' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
status = clock_gettime(CLOCK_REALTIME, &timeout_abs);
^
/bladeRF/host/utilities/bladeRF-cli/src/cmd/rxtx.c:703:32: error:
use of undeclared identifier 'CLOCK_REALTIME'
status = clock_gettime(CLOCK_REALTIME, &timeout_abs);
^
/bladeRF/host/utilities/bladeRF-cli/src/cmd/rxtx.c:773:33: error:
use of undeclared identifier 'CLOCK_REALTIME'
status = clock_gettime(CLOCK_REALTIME, &timeout_abs);

There's a fix needed on the source code: https://gist.github.com/jbenet/1087739

Re: installing on Mac OS 10.9, 64-bit

Posted: Sat Nov 23, 2013 5:13 pm
by lvbernal
This worked for me, hope it helps you. I modified the source code of rxtx.c and added the function current_time:

Code: Select all

int current_time(struct timespec *ts) // from https://gist.github.com/jbenet/1087739

{
    
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
    clock_serv_t cclock;
    mach_timespec_t mts;
    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
    int status = clock_get_time(cclock, &mts);
    mach_port_deallocate(mach_task_self(), cclock);
    ts->tv_sec = mts.tv_sec;
    ts->tv_nsec = mts.tv_nsec;
    return status;
#else
    int status = clock_gettime(CLOCK_REALTIME, ts);
    return status;
#endif
    
}
Then I renamed the variable NSEC_PER_SEC to NSEC_PER_SEC_MOD (in the whole document), because there's a global variable with the same name but different type.

Finally I modified the calls to clock_gettime:

Code: Select all

//status = clock_gettime(CLOCK_REALTIME, &timeout_abs);
status = current_time(&timeout_abs);

Re: installing on Mac OS 10.9, 64-bit

Posted: Sun Nov 24, 2013 5:33 pm
by lvbernal
The latest master branch works great, thank you.