简体   繁体   English

在Linux平台上构建C ++项目(或者更具体地说:在Ubuntu 9.10上构建CLIPS)

[英]building a C++ project on Linux platform (or more specifically: building CLIPS on Ubuntu 9.10)

I'm in the process of moving from XP to Linux. 我正在从XP迁移到Linux。 (I'm new to Linux) (我是Linux的新手)

I have succesfully installed CLIPs on Ubuntu, using the SPM. 我已经使用SPM在Ubuntu上成功安装了CLIP。 I would however, like to build CLIPS from the sources - since I will be extending its current functionality. 但是,我想从源代码构建CLIPS - 因为我将扩展其当前的功能。

I have downloaded the CLIPS sources (v6.2.4) from http://sourceforge.net/projects/clipsrules/files/CLIPS/ 我从http://sourceforge.net/projects/clipsrules/files/CLIPS/下载了CLIPS源代码(v6.2.4)

in to my /home/morpheous/projects/CLIPS folder, and I now want to build it. 在我的/ home / morpheous / projects / CLIPS文件夹中,我现在想要构建它。 However, I am new to the gnu build tools and make (I have already run sudo aptitude install build-essential). 但是,我是gnu构建工具和make的新手(我已经运行了sudo aptitude install build-essential)。

Can anyone offer any help/instructions on how I may build CLIPS (I suspect that I may need to build the X11 interface as well - but that is a lower priority for now) 任何人都可以提供有关我如何构建CLIPS的任何帮助/说明(我怀疑我可能还需要构建X11接口 - 但现在这是一个较低的优先级)

Typically you use the make program to build the app from sources, nearly all C/C++ apps provide a makefile that describes what, and how, to build. 通常,您使用make程序从源代码构建应用程序,几乎所有C / C ++应用程序都提供描述构建内容和方式的makefile。

In general, you'd type 一般来说,你打字

./configure
make
make install

These will: 这些将:

  • run the configure shell script that sets up your build environment, setting things like which CPU and OS you're using. 运行configure shell脚本来设置构建环境,设置您正在使用的CPU和OS。
  • use the standard-named makefile that comes with the project to build the source code. 使用项目附带的标准命名的makefile来构建源代码。
  • use the special 'install' target in the makefile to copy the necessary files to their final resting places. 使用makefile中的特殊'install'目标将必要的文件复制到最终的休息位置。

Edit: Here's a brief description of the process from the Linux Documentation Project. 编辑: 以下是 Linux文档项目中对该过程的简要描述

BTW, with regard to dependant projects, I would try to install them directly from your package repository (ie yum or apt-get) because you often do not need to build them, just to use them. 顺便说一句,关于依赖项目,我会尝试直接从你的软件包库(即yum或apt-get)安装它们,因为你经常不需要构建它们,只是为了使用它们。 You may need to get the development sources (eg the header files and libs) sometimes, but you can get these from the repos too - they will be called something like xxx-devel, eg. 有时您可能需要获取开发源(例如头文件和库),但您也可以从repos中获取这些源 - 它们将被称为xxx-devel,例如。 "kernel-devel", so yum install kernel-devel will get you what you need to develop kernel modules without having to build the kernel itself. “kernel-devel”,所以yum install kernel-devel将为您提供开发内核模块所需的内容,而无需构建内核本身。

The Ubuntu (Debian) way to do this is as follows: Ubuntu(Debian)的方法如下:

apt-get source clips
apt-get build-dep clips
cd clips-6.24
dpkg-buildpackage

Typically if you want to use the non patched source you: 通常,如果您想使用未修补的源代码,您:

./configure
make install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM