44. Building Your Own Application

44. Building Your Own Application

44.1. Compiling a Sample Application in the Development Kit Directory

        在编译示例应用程序(例如hello world)时,必须设置以下的环境变量:RTE_SDK和RTE_TARGET。

~/DPDK$ cd examples/helloworld/
~/DPDK/examples/helloworld$ export RTE_SDK=/home/user/DPDK
~/DPDK/examples/helloworld$ export RTE_TARGET=x86_64-native-linuxapp-gcc
~/DPDK/examples/helloworld$ make
    CC main.o
    LD helloworld
    INSTALL-APP helloworld
    INSTALL-MAP helloworld.map
        默认情况下,生成的二进制文件在build文件夹下面:

~/DPDK/examples/helloworld$ ls build/app
helloworld helloworld.map
44.2. Build Your Own Application Outside the Development Kit

        示例应用程序(Hello World)可以被复制到一个新目录,以此作为开发的起点:

ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif

# Default target, can be overriden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-gcc

include $(RTE_SDK)/mk/rte.vars.mk

# binary name
APP = helloworld

# all source are stored in SRCS-y
SRCS-y := main.c

CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)

include $(RTE_SDK)/mk/rte.extapp.mk

~$ cp -r DPDK/examples/helloworld my_rte_app
~$ cd my_rte_app/
~/my_rte_app$ export RTE_SDK=/home/user/DPDK
~/my_rte_app$ export RTE_TARGET=x86_64-native-linuxapp-gcc
~/my_rte_app$ make
    CC main.o
    LD helloworld
    INSTALL-APP helloworld
    INSTALL-MAP helloworld.map
44.3. Customizing Makefiles

        Hello World示例应用程序提供的默认makefile是一个很好的起点。它包括:

  • 在开始处,$(RTE_SDK)/mk/rte.vars.mk 
  • 在末尾处,$(RTE_SDK)/mk/rte.extapp.mk 
        用户必须定义几个变量:
  • APP:应用程序的名字。
  • SRCS-y:源文件列表(*.c,*.S)。
44.3.2. Library Makefile
        也可以用同样的方法构建库:
  • 在开始处,$(RTE_SDK)/mk/rte.vars.mk 。
  • 在末尾处,$(RTE_SDK)/mk/rte.extlib.mk 。
        唯一的区别是,变量APP被LIB代替,它包含了库的名称。例如,libfoo.a。
44.3.3. Customize Makefile Actions
        可以定义一些变量来定制Makefile操作。最常见的如下所示。参考 Development Kit Build System Makefile Description
详细章节:
  • VPATH:用于构建系统搜索源的路径列表,默认情况下,RTE_SRCDIR将包含在VPATH中。
  • CFLAGS_my_file.o:用于编译my_file.c的指定标志。
  • CFLAGS:用于编译的C文件的标志。上面的是针对某个文件,这个是所有文件。
  • LDFLAGS:链接相关的标志。
  • CPPFLAGS:C预处理相关标志(仅使用.s文件时设置)。
  • LDLIBS:链接库清单,eg,-L /path/to/libfoo - lfoo。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Use new features of PHP 7 to solve practical, real-world problems faced by PHP developers like yourself every day PHP is a great language for developing web applications. It is essentially a server-side scripting language. PHP 7 is the latest version, providing major backward-compatibility breaks and focusing on improved performance and speed. This course follows a learning path which is divided into three modules. Each module is a mini course in its own right, taking your basic PHP programing skills to the next level by showing you intermediate to advanced PHP techniques with a focus on PHP 7. This way, get you equipped with the tools and skills required to develop professional and efficient applications for your websites and enterprises. The first module of the book is a programming cookbook that consists over 80 recipes! Each recipe is designed to solve practical, real-world problems faced by PHP developers like yourself every day. This course also covers new ways of writing PHP code made possible only in version 7. The second module of the course is designed to improve the performance and productivity of your application. We’ll introduce you to the concepts of Object-Oriented Programming (OOP) in PHP 7, then shed some light on how to improve the performance of your PHP 7 applications and database. Throughout this module you will be introduced to benchmarking tools. With all important concepts of PHP covered up you will move on to third module. In this module you will gain a deep insight into the modular programming paradigm and how to achieve modularity in your PHP code. Modular design techniques help you build readable, manageable, reusable, and more efficient codes. PHP 7, which is a popular open source scripting language, is used to build modular functions for your software. Table of Contents Module 1: PHP 7 Programming Cookbook Chapter 1: Building a Foundation Chapter 2: Using PHP 7 High Performance Features Chapter 3: Working with PHP Functions Chapter 4: Working with PHP Object-Oriented Programming Chapter 5: Interacting with a Database Chapter 6: Building Scalable Websites Chapter 7: Accessing Web Services Chapter 8: Working with Date/Time and International Aspects Chapter 9: Developing Middleware Chapter 10: Looking at Advanced Algorithms Chapter 11: Implementing Software Design Patterns Chapter 12: Improving Web Security Chapter 13: Best Practices, Testing, and Debugging Chapter 14: Defining PSR-7 Classes Module 2: Learning PHP 7 High Performance Chapter 1: Setting Up the Environment Chapter 2: New Features in PHP 7 Chapter 3: Improving PHP 7 Application Performance Chapter 4: Improving Database Performance Chapter 5: Debugging and Profiling Chapter 6: Stress/Load Testing PHP Applications Chapter 7: Best Practices in PHP Programming Appendix A: Tools to Make Life Easy Appendix B: MVC and Frameworks Module 3: Modular Programming with PHP 7 Chapter 1: Ecosystem Overview Chapter 2: GoF Design Patterns Chapter 3: SOLID Design Principles Chapter 4: Requirement Specification for a Modular Web Shop App Chapter 5: Symfony at a Glance Chapter 6: Building the Core Module Chapter 7: Building the Catalog Module Chapter 8: Building the Customer Module Chapter 9: Building the Payment Module Chapter 10: Building the Shipment Module Chapter 11: Building the Sales Module Chapter 12: Integrating and Distributing Modules
For your next project on GitHub, take advantage of the service’s powerful API to meet your unique development requirements. This practical guide shows you how to build your own software tools for customizing the GitHub workflow. Each hands-on chapter is a compelling story that walks you through the tradeoffs and considerations for building applications on top of various GitHub technologies. If you’re an experienced programmer familiar with GitHub, you’ll learn how to build tools with the GitHub API and related open source technologies such as Jekyll (site builder), Hubot (NodeJS chat robot), and Gollum (wiki). Build a simple Ruby server with Gist API command-line tools and Ruby’s "Octokit" API client Use the Gollum command-line tool to build an image management application Build a GUI tool to search GitHub with Python Document interactions between third-party tools and your code Use Jekyll to create a fully-featured blog from material in your GitHub repository Create an Android mobile application that reads and writes information into a Jekyll repository Host an entire single-page JavaScript application on GitHub Use Hubot to automate pull request reviews Table of Contents Chapter 1. The Unclad GitHub API Chapter 2. Gists and the Gist API Chapter 3. GitHub Wikis with Gollum Chapter 4. Python and the Search API Chapter 5. .NET and the Commit Status API Chapter 6. Ruby and Jekyll Chapter 7. Android and the Git Data API Chapter 8. CoffeeScript, Hubot, and the Activity API Chapter 9. JavaScript and the Git Data API Appendix A. GitHub Enterprise Appendix B. Ruby, NodeJS, (and the Shell) at GitHub

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值