Re: [Discuss-gnuradio] Help with building GNU Radio for Android

2015-09-25 Thread Schuyler St. Leger
I have made some progress, though I am having problems with running the
gr-template app on my Android device, a Nexus 6 running Android version 5.1
and API level 22.

Although, now that I think about it, there's no reason to SWIG gr-grand.
>> You'll never use that in Python on Android; we only use the c++ library
>> out, and specifically the static libgnuradio-grand.a library.
>>
>> Maybe try adding the flag -DENABLE_PYTHON=False to the cmake line?
>>
> ENABLE_PYTHON is not an available option, and there is no option to
> disable Python or SWIG (the cmake user settable variables can be listed
> using -LAH).
>
I was able to get CMake to disable SWIG by adding
-DSWIG_DIR=SWIG_DIR-NOTFOUND this will cause CMake to fail to find SWIG and
disable it.

With this I was able to successfully build GNU Radio for Android on OS X.

To summarize what I had to do to build GNU Radio for Android on OS X:
- When building boost add toolset=gcc-android as an option. I did this for
both stage and install, though I am not sure if this is necessary for
install.
- I changed -DPYTHON_EXECUTABLE=/usr/bin/python to
-DPYTHON_EXECUTABLE=/opt/local/bin/python so the correct Python version is
used. This is /opt/local/bin/python for MacPorts. UHD also needs Cheetah to
be installed to build it.
- When configuring gr-grand I disabled SWIG to fix problems with Python by
passing -DSWIG_DIR=SWIG_DIR-NOTFOUND to CMake.
- I added the -DENABLE_AIRSPY=False -DENABLE_PYTHON=False options when
configuring gr-osmosdr to disable Airspy and SWIG.

I am able to build the GrTemplate example, but when running it gets stuck
when calling FgStart() on a Nexus 6 running. This causes problems with
https://github.com/trondeau/GrTemplate/blob/master/app/src/main/java/org/gnuradio/grtemplate/GrTemplate.java#L18

This covers my problems with Ubuntu, though I have not done any more work
with this since I was able to successfully build GNU Radio for Android on
OS X.

> The real problem here is that android-toolchain/arm-linux-androideabi/bin/
> is empty and not symlinked to the tools in android-toolchain/bin/ like it
> normally is. I have tried rebuilding the toolchain multiple times, but it
> is not making the symlinks. I just copied the symlinks from OS X and it
> works on Ubuntu 14.04 (tested for FFTW).
>
I also had a similar problem when running ndk-build for libusb. I just
symlinked android-toolchain/bin/arm-arm-linux-androideabi-ld.gold to ld
 with android-toolchain/bin in the path, and was able to build libusb
successfully.

On Fri, Sep 25, 2015 at 7:01 AM, Tom Rondeau  wrote:

> Hey Schuyler,
>
> Any progress on your side of things? I've been busy with other aspects of
> the project and haven't been able to get back to this. However, I just
> picked up a new Android device, so I'm going to try to start from scratch
> with that and a VM to walk through the instructions and see what might need
> tuning or fixing. I'm on the road the next two weeks, but hope I can get
> this done when I'm settled for a bit in Dublin the week after next.
>
> Tom
>
>
> On Fri, Aug 21, 2015 at 3:34 PM, Schuyler St. Leger <
> schuyler.st.le...@gmail.com> wrote:
>
>> Although, now that I think about it, there's no reason to SWIG gr-grand.
>>> You'll never use that in Python on Android; we only use the c++ library
>>> out, and specifically the static libgnuradio-grand.a library.
>>>
>>> Maybe try adding the flag -DENABLE_PYTHON=False to the cmake line?
>>>
>> ENABLE_PYTHON is not an available option, and there is no option to
>> disable Python or SWIG (the cmake user settable variables can be listed
>> using -LAH).
>>
>>
>> Are you sure you want armv7-m? Most of what we're using is armv7-a. But
>>> you might just try "armv7" instead to use a more generic v7 architecture.
>>> Take a look at the gcc man page for a list of supported machines. This
>>> might be something you'll need to play around with.
>>>
>> I made a mistake in copying the error, here is the correct error.
>> Assembler messages:
>> Fatal error: invalid -march= option: `armv7-a'
>>
>> I was able to get Boost to build. The problem is that when
>> arm-linux-androideabi-g++ calls the assembler it looks in the path for as the
>> problem with this is that the assembler for Android is named
>> arm-linux-androideabi-as . To fix this I symlinked
>> arm-linux-androideabi-as to as and android-toolchain/bin needs to be in
>> your path (it should be from setting up the android toolchain). However
>> this must be done after running bootstrap.sh or Boost will fail to build
>> Boost.Build. Running hash -r may be required to get bash to find the
>> correct

Re: [Discuss-gnuradio] Help with building GNU Radio for Android

2015-08-21 Thread Schuyler St. Leger
>
> Although, now that I think about it, there's no reason to SWIG gr-grand.
> You'll never use that in Python on Android; we only use the c++ library
> out, and specifically the static libgnuradio-grand.a library.
>
> Maybe try adding the flag -DENABLE_PYTHON=False to the cmake line?
>
ENABLE_PYTHON is not an available option, and there is no option to disable
Python or SWIG (the cmake user settable variables can be listed using -LAH).


Are you sure you want armv7-m? Most of what we're using is armv7-a. But you
> might just try "armv7" instead to use a more generic v7 architecture. Take
> a look at the gcc man page for a list of supported machines. This might be
> something you'll need to play around with.
>
I made a mistake in copying the error, here is the correct error.
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'

I was able to get Boost to build. The problem is that when
arm-linux-androideabi-g++ calls the assembler it looks in the path for as the
problem with this is that the assembler for Android is named
arm-linux-androideabi-as . To fix this I symlinked arm-linux-androideabi-as
 to as and android-toolchain/bin needs to be in your path (it should be
from setting up the android toolchain). However this must be done after
running bootstrap.sh or Boost will fail to build Boost.Build. Running hash
-r may be required to get bash to find the correct assembler.

The real problem here is that android-toolchain/arm-linux-androideabi/bin/
is empty and not symlinked to the tools in android-toolchain/bin/ like it
normally is. I have tried rebuilding the toolchain multiple times, but it
is not making the symlinks. I just copied the symlinks from OS X and it
works on Ubuntu 14.04 (tested for FFTW).


Yeah, when this is right, you should see 'yes' for 32-bit and arm.
>
That is what I got when using OS X with Boost and specifying
toolset=gcc-android .

How hard would it be to get fosphor working on Android?

Schuyler, there might have been a change in something in Android (they
> really don't care about changing things between versions) when building the
> standalone SDK. Take a look at the options you passed when building that
> part of the project. Also, make sure you are using GCC 4.8 and NOT 4.9. We
> have other issues with 4.9.
>
I am using GCC 4.8.
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Help with building GNU Radio for Android

2015-08-18 Thread Schuyler St. Leger
I am trying to build GNU Radio for Android and am having issues with the
build process.

I first tried building GNU Radio for Android on Mac OS X 10.10.4. I was
able to follow the directions successfully until I had to build gr-grand.
When I tried to build gr-grand I got this error (see error 1). I have tried
searching for this error, but have not found any useful information from my
search. I am not sure if this is an error with the build procedure, or if
it is an error with the Android NDK and Python.

I then tried building GNU Radio for Android in a Ubuntu 14.04 64 bit VM,
but when trying to stage Boost (./b2) I get this output from Boost (see
error 2) and get an error about -march=armv7-m not being a supported
compiler flag when Boost starts compiling. I have tried adding the
toolset=gcc-android to Boost but this did not fix the problem (I had to do
this on Mac to get Boost to use the configuration in the user-config.jam
file).

I would like help getting this working, as I really want to get GNU Radio
working on Android for me.

Schuyler St. Leger

Error 1:
[ 80%] Building CXX object
swig/CMakeFiles/_grand_swig.dir/grand_swigPYTHON_wrap.cxx.o
In file included from
/opt/android-toolchain/include/python2.7/Python.h:58:0,
 from
/opt/grandroid/gr-grand/build/swig/grand_swigPYTHON_wrap.cxx:167:
/opt/android-toolchain/include/python2.7/pyport.h:1029:2: error: #error
"LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?)."
  ^
make[2]: *** [swig/CMakeFiles/_grand_swig.dir/grand_swigPYTHON_wrap.cxx.o]
Error 1
make[1]: *** [swig/CMakeFiles/_grand_swig.dir/all] Error 2
make: *** [all] Error 2

Error 2:
Performing configuration checks

- 32-bit   : no
- 64-bit   : no
- arm  : no
- mips1: no
- power: no
- sparc: no
- x86  : no
- combined : no
- has_icu builds   : no
- lockfree boost::atomic_flag : no
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Help with building GNU Radio for Android

2015-08-18 Thread Schuyler St. Leger
I am trying to build GNU Radio for Android and am having issues with the
build process.

I first tried building GNU Radio for Android on Mac OS X 10.10.4. I was
able to follow the directions successfully until I had to build gr-grand.
When I tried to build gr-grand I got this error (see error 1). I have tried
searching for this error, but have not found any useful information from my
search. I am not sure if this is an error with the build procedure, or if
it is an error with the Android NDK and Python.

I then tried building GNU Radio for Android in a Ubuntu 14.04 64 bit VM,
but when trying to stage Boost (./b2) I get this output from Boost (see
error 2) and get an error about -march=armv7-m not being a supported
compiler flag when Boost starts compiling. I have tried adding the
toolset=gcc-android to Boost but this did not fix the problem (I had to do
this on Mac to get Boost to use the configuration in the user-config.jam
file).

I would like help getting this working, as I really want to get GNU Radio
working on Android for me.

Schuyler St. Leger

Error 1:
[ 80%] Building CXX object
swig/CMakeFiles/_grand_swig.dir/grand_swigPYTHON_wrap.cxx.o
In file included from
/opt/android-toolchain/include/python2.7/Python.h:58:0,
 from
/opt/grandroid/gr-grand/build/swig/grand_swigPYTHON_wrap.cxx:167:
/opt/android-toolchain/include/python2.7/pyport.h:1029:2: error: #error
"LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?)."
  ^
make[2]: *** [swig/CMakeFiles/_grand_swig.dir/grand_swigPYTHON_wrap.cxx.o]
Error 1
make[1]: *** [swig/CMakeFiles/_grand_swig.dir/all] Error 2
make: *** [all] Error 2

Error 2:
Performing configuration checks

- 32-bit   : no
- 64-bit   : no
- arm  : no
- mips1: no
- power: no
- sparc: no
- x86  : no
- combined : no
- has_icu builds   : no
- lockfree boost::atomic_flag : no
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio