Uploaded image for project: 'hicn'
  1. hicn
  2. HICN-407

Add CMake option to compile CLI version of hICN utilities on Android

XMLWordPrintable

      The following command allows to compile a CLI version of hICN utilities such as hiperf, hicn-ping{client,server}, hicn-light-control, hicnctrl, etc.

      ```
      cmake .. -DWITH_ANDROID_CLI=ON

      ```

      Those utilities prove useful for debugging.

      Example native ANDROID:

      Cross compile the software using the android sdk (https://github.com/icn-team/android-sdk.git).

      ```
      git clone https://github.com/icn-team/android-sdk.git
      cd android-sdk

      bash ./compileAll.sh
      ```

      Copy the output folder usr_aarch64 in the phone using adb:

       

      ```

      adb push ./usr_aarch64 /data/local/tmp/
      ```

       

      Access the phone with adb shell:

       

      ```

      adb shell

      ```

       

      Go inside the copied folder and run hicn apps:

      ```
      cd  /data/local/tmp/usr_aarch64/bin

      chmod +x hicn-light-daemon

      ./hicn-light-daemon
      ```

      Example using TERMUX:

      Install the termux application from the playstore, then run the following  
      commands within the proposed shell:
      ```
      apt update
      apt install openssh git cmake libevent libconfig
      passwd
      sshd
      ```

      You can then connect through ssh to the termux shell on port 8022, and  
      eventually install your public key (NOTE: USER is ignored, and you can retrieve  
      your IP address using ifconfig):
      ```
      ssh-copy-id USER@IP_ADDRESS -p 8022
      ```

      You can then download and build the hICN codebase:

      ```
      git clone https://gerrit.fd.io/r/cicn
      cd cicn
      git checkout cframework/master
      cd libparc
      mkdir build
      cd build
      cmake .. -DCMAKE_SYSTEM_NAME="Linux" -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr
      make -j 8

      1. You might face two errors where a define is missing, related to cacheline size, just replace it with 64...
        make install
        cd
        git clone https://github.com/chriskohlhoff/asio.git
        cd asio
        git checkout tags/asio-1-12-2
        cp -r asio/include/asio.hpp /data/data/com.termux/files/usr/include/
        cp -r asio/include/asio /data/data/com.termux/files/usr/include/

      cd
      git clone https://gerrit.fd.io/r/hicn
      cd hicn
      mkdir build
      cd build
      cmake .. -DWITH_ANDROID_CLI=ON
      make -j 8
      ```

      All binaries should now be available in the ./build-root/bin/ folder.

      You can then use the binaries through adb shell by adding the folder /data/data/com.termux/files/home/hicn/build/build-root/bin/ to your path.

            jordan.auge Jordan Augé
            jordan.auge Jordan Augé
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: