Add filter to Owned Device Discovery.
[platform/upstream/iotivity.git] / Readme.scons.txt
index d0e2458..fd0b3a0 100644 (file)
@@ -1,3 +1,33 @@
+== Quick guide: build and run IoTivity projects on Ubuntu ==
+
+1. Build
+       Go to the top directory of 'iotivity' project(Note: should always run 'scons'
+command in this directory)
+
+    Install external libraries:
+      $ sudo apt-get install libboost-dev libboost-program-options-dev libexpat1-dev libboost-thread-dev uuid-dev libssl-dev
+
+    Build release binaries:
+      $ scons
+(Note: C sdk requires tiny-cbor. Please follow the instruction in the build
+message to install tiny-cbor)
+
+    Build debug binaries:
+      $scons RELEASE=false
+
+    Help:
+      $ scons -h
+
+    Clear:
+      $ scons -c
+
+2. Run the samples
+      $ export LD_LIBRARY_PATH=<iotivity>/out/linux/x86_64/release
+      Run the c++ samples in <iotivity>/out/linux/x86_64/release/resource/examples
+      Run the c samples in <iotivity>/out/linux/x86_64/release/resource/csdk/stack/samples/linux/SimpleClientServer
+('<iotivity>' is the path to 'iotivity' project. If your device is x86, arm,
+or arm64, please change 'x86_64' to the proper arch)
+
 == How to build IoTivity projects ==
 
 IoTivity includes a series of projects. You can find all these projects here:
 == How to build IoTivity projects ==
 
 IoTivity includes a series of projects. You can find all these projects here:
@@ -8,7 +38,7 @@ Linux, Tizen, Android, Arduino, Windows, MAC OSX, IOS ...).
 The output of the build is in:
   <top directory of the project>/out/<target_os>/<target_arch>/<build_type>/
 e.g.
 The output of the build is in:
   <top directory of the project>/out/<target_os>/<target_arch>/<build_type>/
 e.g.
-       oic-resource/out/android/armeabi-v7a/release/.
+       iotivity/out/android/armeabi-v7a/release/.
 
 This document takes 'iotivity' project as example, the way to build other
 projects is almost the same.
 
 This document takes 'iotivity' project as example, the way to build other
 projects is almost the same.
@@ -26,7 +56,16 @@ information(include build options). To see the help information:
       $ scons [options] -h
 
 Note: If no value is specified for an option, the default value will be used.
       $ scons [options] -h
 
 Note: If no value is specified for an option, the default value will be used.
-The change of options value may impact the output.
+The change of options value may impact the help information and the behavior
+of the building.
+
+Generally, it's required to specify the target OS and target ARCH, that's to say
+tell Scons which OS and which ARCH you'd like build this project for. By default,
+the target OS and ARCH is the same as the host.
+
+Some more options may be required, please care the 'error' notification when build.
+For help about how to set an option, please run:
+     $ scons TARGET_OS=xxx TARGET_ARCH=yyy [XXX=zzz ...] -h
 
 
 === Prerequites ===
 
 
 === Prerequites ===
@@ -46,12 +85,12 @@ To build for Android, Andorid NDK and SDK are required.
   Android NDK: http://developer.android.com/tools/sdk/ndk/index.html
   Android SDK: http://developer.android.com/sdk/index.html
 (Note: as in some IoTivity projects, C++11 features are used, recommend Android
   Android NDK: http://developer.android.com/tools/sdk/ndk/index.html
   Android SDK: http://developer.android.com/sdk/index.html
 (Note: as in some IoTivity projects, C++11 features are used, recommend Android
- NDK >= r10, according to our test result r10c is the best one currently)
+ NDK >= r10)
 
 Arduino:
 To build for Arduino, Arduino IDE is required.
   Arduino IDE: http://arduino.cc/en/Main/Software
 
 Arduino:
 To build for Arduino, Arduino IDE is required.
   Arduino IDE: http://arduino.cc/en/Main/Software
-  (Note: recommend install Arduino IDE >=1.5.7)
+  (Note: recommend install Arduino IDE >=1.5.8)
 
 Arduino builds are dependent on latest Time library. Download it from here:
     http://www.pjrc.com/teensy/td_libs_Time.html
 
 Arduino builds are dependent on latest Time library. Download it from here:
     http://www.pjrc.com/teensy/td_libs_Time.html
@@ -76,33 +115,29 @@ Java codes, this isn't required)
 so you don't need to add it in command line each time. The build script will
 guide you to do that.)
 
 so you don't need to add it in command line each time. The build script will
 guide you to do that.)
 
-* 3. External libraries
-For Android and IOS build, most of the external libraries are provided as
-binary in oic-utilities project (https://oic-review.01.org/gerrit/oic-utilities).
-Please download it in the same directory as other IoTivity projects. If it's
-in different directory, an additional option (OIC_UITLS) will be required. The
-build command should be:
-      $ scons OIC_UITLS=<path to oic-utilities> [other options] [target]
+Tizen:
+To build for tizen platform tiny-cbor library is needed.
+Please download tiny-cbor if it is not present in extlibs/tiny-cbor folder
+by doing the following:
+       $ git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor
 
 
-(Note: for convenience, you can also add it in environment variable. So you
-don't need to add this option in command line each time.)
-  e.g.:
-      $ export OIC_UITLS=<path to oic-utilities project>
 
 
+* 3. External libraries
+IoTivity project depends on some external libraries, such as boost, expat ...
+During building, the existence of external library will be checked, if it doesn't
+exist, the build script will try to download, unpack and build the library or
+notify user to install it.
 
 
-=== Build IoTivity project on Linux(Ubuntu) ===
+Downloading and unpacking may fail due to network problem or required unpacking
+tool isn't installed. An message will be displayed, please follow the message
+to skip it.
 
 
-Generally, it's required to specify the target OS and target ARCH, that's to say
-tell Scons which OS and which ARCH you'd like build this project for. By default,
-the target OS and ARCH is the same as the host.
 
 
-Some more options may be required, please care the 'error' notification when build.
-For help about how to set an option, please run:
-       $ scons TARGET_OS=xxx TARGET_ARCH=yyy [XXX=zzz ...] -h
+=== Build IoTivity project on Linux(Ubuntu) ===
 
 1. Build IoTivity project for Linux
       $ cd <top directory of the project>
 
 1. Build IoTivity project for Linux
       $ cd <top directory of the project>
-      $ sudo apt-get install libboost-dev libboost-program-options-dev libexpat1-dev
+      $ sudo apt-get install libboost-dev libexpat1-dev libboost-thread-dev libssl-dev
       $ scons
 
 2. Build IoTivity project for Android
       $ scons
 
 2. Build IoTivity project for Android
@@ -111,38 +146,24 @@ For help about how to set an option, please run:
 (xxx can be x86, armeabi, armeabi-v7a, armeabi-v7a-hard. To see all of its
 allowed value, please execute command 'scons TARGET_OS=android -Q -h')
 
 (xxx can be x86, armeabi, armeabi-v7a, armeabi-v7a-hard. To see all of its
 allowed value, please execute command 'scons TARGET_OS=android -Q -h')
 
-Note: Currently as x86_64/arm64_v8a external library binaries aren't provided,
-you may meet link problem if build executable binary which depends on external
-library for x86_64/arm64_v8a.
-
 3. Build IoTivity project for Arduino
       $ cd <top directory of the project>
 3. Build IoTivity project for Arduino
       $ cd <top directory of the project>
-      $ scons TARGET_OS=arduino TARGET_ARCH=xxx BOARD=yyy
-(xxx can be avr, arm; yyy is the name of the board, to get its allowed value
-run: scons TARGET_OS=arduino TARGET_ARCH=xxx -h. You may see a option 'CPU' in
-the output of above command line, that's due to some boards have different
-processors, to specify the processor, add 'CPU=zzz' in the command line. If no
-'CPU' option exists, that means the board only support one kind of processor,
-it's unnecessary to specify it)
-
-
-=== Build IoTivity project on Windows ===
-
-1. Build IoTivity project for Android(It's the same as on Ubuntu)
-      $ cd <top directory of the project>
-      $ scons TARGET_OS=android TARGET_ARCH=xxx
-(xxx can be x86, armeabi, armeabi-v7a, armeabi-v7a-hard ...)
-
-2. Build IoTivity project for Arduino(It's the same as on Ubuntu)
+      $ sudo apt-get install dos2unix
+      $ scons TARGET_OS=arduino TARGET_ARCH=xxx BOARD=yyy SHIELD=zzz
+(xxx can be avr, arm; yyy is the name of the board, zzz is the shield type, to
+get allowed values run: scons TARGET_OS=arduino TARGET_ARCH=xxx SHIELD=zzz -h.
+You may see a option 'CPU' in the output of above command line, that's due to
+some boards have different processors, to specify the processor, add 'CPU=zzz'
+in the command line. If no 'CPU' option exists, that means the board only
+support one kind of processor, it's unnecessary to specify it)
+
+4. Build Iotivity project for Tizen
       $ cd <top directory of the project>
       $ cd <top directory of the project>
-      $ scons TARGET_OS=arduino TARGET_ARCH=xxx BOARD=yyy
-(xxx can be avr, arm; yyy is the name of the board, to get its allowed value
-run: scons TARGET_OS=arduino TARGET_ARCH=xxx -h. You may see a option 'CPU' in
-the output of above command line, that's due to some boards have different
-processor, to specify the processor, add 'CPU=zzz' in the command line. If no
-'CPU' option exists, that means the board only support one kind of processor,
-it's unnecessary to specify it)
-
+      $ sh gbsbuild.sh
+(we provide the spec file required by gbs tool at toools/tizen directory.
+gbs is default build tool for Tizen platfrom, we can refer the following
+wiki to setup Tizen development environment:
+https://source.tizen.org/documentation/developer-guide/getting-started-guide)
 
 Note: Currently most IoTivity project doesn't support Windows, so you can't set
 TARGET_OS to 'windows' except the project support Windows.
 
 Note: Currently most IoTivity project doesn't support Windows, so you can't set
 TARGET_OS to 'windows' except the project support Windows.
@@ -176,9 +197,6 @@ Note:
 at once. Following is the usage:
 
 To build:
 at once. Following is the usage:
 
 To build:
-     $ auto_build.sh <path-to-android-ndk> <path-to-arduino-home>
+     $ auto_build.sh <path-to-android-ndk>
 To clean:
      $ auto_build.sh -c
 To clean:
      $ auto_build.sh -c
-
-2) For Arduino build, the Time library should >=1.3. The old can only be built
-with Arduino IDE 1.0.x