X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Readme.scons.txt;h=57f531e27d3aeb6ca1f1c012ae6078933b804f8e;hb=refs%2Fheads%2Faccepted%2Ftizen_3.0_common;hp=4034b6dcfe9071f9954ed5a9cde685317f1aea3e;hpb=59a91fe583495f14e05c7c7567d4f2241c9b4498;p=platform%2Fupstream%2Fiotivity.git diff --git a/Readme.scons.txt b/Readme.scons.txt index 4034b6d..57f531e 100644 --- a/Readme.scons.txt +++ b/Readme.scons.txt @@ -1,3 +1,40 @@ +== 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 build tools: + $ sudo apt-get install git-core scons ssh build-essential g++ doxygen valgrind + + Install external libraries: + $ sudo apt-get install libboost-dev libboost-program-options-dev libboost-thread-dev uuid-dev libssl-dev libtool libglib2.0-dev + + Build release binaries: + $ scons +(Note: C sdk requires tinycbor. Please follow the instruction in the build +message to install tinycbor) + + Build debug binaries: + $scons RELEASE=false + + Help: + $ scons -h + + Clear: + $ scons -c + +2. Run the samples + $ export LD_LIBRARY_PATH=/out/linux/x86_64/release + Run the c++ samples in /out/linux/x86_64/release/resource/examples + Run the c samples in /out/linux/x86_64/release/resource/csdk/stack/samples/linux/SimpleClientServer +('' is the path to 'iotivity' project. If your device is x86, arm, +or arm64, please change 'x86_64' to the proper arch) + +3. To build and test IoTivity with Security enabled (required for certification) +follow the instructions found in: + /resource/csdk/security/README-building-and-running-secure-IoTivity-stack.txt + == How to build IoTivity projects == IoTivity includes a series of projects. You can find all these projects here: @@ -8,7 +45,7 @@ Linux, Tizen, Android, Arduino, Windows, MAC OSX, IOS ...). The output of the build is in: /out//// 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. @@ -26,7 +63,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. -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 === @@ -46,12 +92,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 - 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 - (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 @@ -76,116 +122,174 @@ 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.) +Tizen: +To build for tizen platform tinycbor library is needed. +Please download tinycbor if it is not present in extlibs/tinycbor folder +by doing the following: + $ git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor + + * 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= [other options] [target] +IoTivity project depends on some external libraries, such as boost ... +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. -(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= +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. -=== Build IoTivity project on Linux(Ubuntu) === +=== Build IoTivity project === -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. +Linux: + * Possible values for are: ALL, IP, BLE -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 +1. Go to root directory + $ cd + $ sudo apt-get install libboost-dev libboost-thread-dev libssl-dev libtool -1. Build IoTivity project for Linux - $ cd - $ sudo apt-get install libboost-dev libboost-program-options-dev libexpat1-dev libboost-thread-dev - $ scons +2. Execute following command(s) to start build based on transport selection required -2. Build IoTivity project for Android - $ cd - $ scons TARGET_OS=android TARGET_ARCH=xxx -(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 - $ 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) - -4. Build Iotivity project for Tizen - $ cd - $ gbs build -A xxx --packaging-dir tools/tizen/ -(xxx can be i586 or armv7l, 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) + -> Building for all transports : + $ scons TARGET_OS=linux TARGET_TRANSPORT=ALL -=== Build IoTivity project on Windows === + -> Building for a specific transport : + $ scons TARGET_OS=linux TARGET_TRANSPORT=IP -1. Build IoTivity project for Android(It's the same as on Ubuntu) - $ cd - $ scons TARGET_OS=android TARGET_ARCH=xxx -(xxx can be x86, armeabi, armeabi-v7a, armeabi-v7a-hard ...) + -> Building for multiple transports : + $ scons TARGET_OS=linux TARGET_TRANSPORT=IP,BLE TARGET_ARCH=xxx -2. Build IoTivity project for Arduino(It's the same as on Ubuntu) - $ cd - $ 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) + -> Clean Build (all transports) : + $ scons TARGET_OS=linux TARGET_TRANSPORT=ALL -c (for clean) +Android: + * Possible values for are: ALL, IP, BT, BLE + * Possible values for are: 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 most IoTivity project doesn't support Windows, so you can't set -TARGET_OS to 'windows' except the project support Windows. +1. Go to root directory + $ cd -That's to say if the project doesn't support Windows, run: - $ scons TARGET_OS=windows .... -or run on Windows - $ scons -may always fail. +2. Execute following command(s) to start build based on transport selection required + + -> Building for all transports : + $ scons TARGET_OS=android TARGET_TRANSPORT=ALL TARGET_ARCH=xxx + -> Building for a specific transport : + $ scons TARGET_OS=android TARGET_TRANSPORT=IP TARGET_ARCH=xxx -=== Build IoTivity project on Mac OSX === + -> Building for multiple transports : + $ scons TARGET_OS=android TARGET_TRANSPORT=IP,BT,BLE TARGET_ARCH=xxx -1. Build IoTivity project for Mac OSX - $ cd - $ scons SYS_VERSION=yyy -(yyy is the OSX version, e.g. 10.9) + -> Clean Build (all transports) : + $ scons TARGET_OS=android TARGET_TRANSPORT=ALL -c (for clean) -2. Build IoTivity project for Android(It's the same as on Ubuntu) - $ cd - $ scons TARGET_OS=android TARGET_ARCH=xxx -(xxx can be x86, armeabi, armeabi-v7a, armeabi-v7a-hard) +Tizen: + * Possible values for are: ALL, IP, BT, BLE -3. Build IoTivity project for IOS - $ cd - $ scons TARGET_OS=ios TARGET_ARCH=xxx SYS_VERSION=yyy -(xxx can be i386, x86_64, armv7, armv7s, arm64, yyy is IOS version, e.g. 7.0) + 1. Go to root directory + $ cd + + 2. Execute following command(s) to start build based on transport selection required + + -> Building for all transports : + $ scons TARGET_OS=tizen TARGET_TRANSPORT=ALL + + -> Building for a specific transport : + $ scons TARGET_OS=tizen TARGET_TRANSPORT=IP + + -> Building for multiple transports : + $ scons TARGET_OS=tizen TARGET_TRANSPORT=IP,BT,BLE TARGET_ARCH=xxx + + -> Clean Build (all transports) : + $ scons TARGET_OS=tizen TARGET_TRANSPORT=ALL -c (for clean) + +(we provide the spec file required by gbs tool at toools/tizen directory. +gbs is default build tool for Tizen platform, we can refer the following +wiki to setup Tizen development environment: +https://source.tizen.org/documentation/developer-guide/getting-started-guide) + +Arduino: + * Possible values for are: IP, BLE + * Possible values for are: arv, arm + (arv: arduino due, arm: arduino mega) + * Possible values for are: arduino_due_x_dbg, arduino_due_x, mega + * Possible values for are: ETH, WIFI + (It is required in the case of the arduino due.) + + 1. Go to root directory + $ cd + $ sudo apt-get install dos2unix + + 2. Execute following command(s) to start build based on transport selection required + + -> Building for a specific transport : + $ scons TARGET_OS=arduino TARGET_ARCH=xxx BOARD=yyy SHIELD=zzz + +(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) + +Mac OSX: + * Possible values for are: OSX version, e.g. 10.9 + + 1. Go to root directory + $ cd + + 2. Execute following command(s) to start build based on transport selection required + + -> Building for a specific transport : + $ scons SYS_VERSION=yyy + +IOS: + * Possible values for are: i386, x86_64, armv7, armv7s, arm64 + * Possible values for are: IOS version, e.g. 7.0 + + 1. Go to root directory + $ cd + + 2. Execute following command(s) to start build based on transport selection required + + -> Building for a specific transport : + $ scons TARGET_OS=ios TARGET_ARCH=xxx SYS_VERSION=yyy + +Windows: + * Possible values for are: amd64 + +For convenience to build projects supported on Windows a batch file (run.bat) is provided +to run many build combinations with TARGET_OS to 'windows'. + +1. Go to root directory + $ cd +2. To clean before building: + $ run clean +3. To build debug amd64 binaries: + $ run build +See run.bat for more example usage parameters + +* Additional options + * VERBOSE=true or false (Show compilation) + * RELEASE=true or false (Build for release?) + * LOGGING=true or false (Enable stack logging) + * SECURED=1 or 0 (Build with DTLS) + * TEST=1 or 0 (Run unit tests) + * BUILD_SAMPLE=ON or OFF (Build with sample) + * ROUTING=GW or EP (Enable routing) + * WITH_TCP=true or false (Enable CoAP over TCP Transport, arduino is not supported) + * WITH_RA=true or false (Build with Remote Access module) + * RD_MODE=CLIENT or SERVER (Build including Resource Directory) + * SIMULATOR=true or false (Build with simulator module) + * Possible values for are: PUB,SUB,BROKER (Build including Message Queue) + -> PUB : publisher, SUB : subscriber, BROKER : MQ broker(not supported yet) Note: 1) for convenience, a script (auto_build.sh) is provided to run possible build at once. Following is the usage: To build: - $ auto_build.sh + $ auto_build.sh 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