3 title: Building and Running Your Service Natively
5 https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/host-configuration-developer-guides-devguides-book.yml -->
10 # Building and Running Your Service Natively
12 The next step in the binder development process is to build your
13 binder and run it using your native Linux system.
15 **NOTE:** This section assumes using the `helloworld-service` example
16 and completion of the previous steps in this
17 "[Building Microservices Natively](./0-build-microservice-overview.html)"
20 ## Building the Service
22 Move to the cloned `helloworld-service` repository and build the service
23 using either of the following methods:
27 ./conf.d/autobuild/linux/autobuild package
38 ## Running the Service
40 You use the Application Framework Binder Daemon (`afb-daemon`) to
41 bind one instance of an application or service to the rest of the system.
42 In this example, you are binding an instance of `helloworld-service`
43 to the rest of the system:
46 afb-daemon --binding helloworld.so --port 3333 --token ''
49 The previous command starts `afb-daemon` and loads the `helloworld.so`
51 The daemon is now listening on port 3333 of the `localhost`.
53 ## Testing the Service
56 [AGL Test Framework](../../apis_services/#agl-test-framework) topic in the
57 "APIs & Services" topic.
58 You can test your `helloworld-service` binding using the `afm-test` tool.
60 Examine the generic example describing how to launch the tests suite
61 [here](../../apis_services/reference/afb-test/3_Launch_the_tests.html).
62 This example can help you understand how to test your helloworld binding
65 ## Using Optional Tools
67 Once you have built and run your micro-service successfully using your
68 native Linux system, you should consider using some additional
69 development tools: X(Cross) Development System (XDS) and
70 the Controller Area Network (CAN) Development Studio (CANdevStudio).
72 * **XDS:** Cross-compiles and ports your AGL image to your target hardware.
73 For information on XDS, see the
74 "[X(cross) Development System: User's Guide](../reference/xds/part-1/xds-overview.html)"
77 * **CANdevStudio:** Simulates CAN signals such as ignition status,
78 doors status, or reverse gear by every automotive developer.
79 For information on CANdevStudio, see the
80 "[CANdevStudio Quickstart](../../apis_services/reference/candevstudio/1_Usage.html)"
85 ### systemd and/or libmicrohttpd
87 If you encounter an error message similar to the following,
88 you need to make some changes to your `cmake` file:
91 -- Checking for module 'libmicrohttpd>=0.9.60'
92 -- No package 'libmicrohttpd' found
93 CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message):
94 A required package was not found
95 Call Stack (most recent call first):
96 /usr/share/cmake/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
97 conf.d/app-templates/cmake/cmake.d/01-build_options.cmake:92 (PKG_CHECK_MODULES)
98 conf.d/app-templates/cmake/common.cmake:77 (include)
99 conf.d/cmake/config.cmake:184 (include)
100 CMakeLists.txt:3 (include)
103 Open the `config.cmake` file located in `helloworld-service/conf.d/cmake/` directory
104 and add a hash character (i.e. #) to the beginning of the "libsystemd>=222"
105 and "libmicrohttpd>=0.9.60" strings.
106 Following is an example of the edits:
109 set (PKG_REQUIRED_LIST
113 #libmicrohttpd>=0.9.60
117 After making these changes, rebuild the service again as described in the
118 "[Building the Service](./4-getting-source-files.html#building-the-service)"
119 section previously on this page.