如何在Linux上安装C ++库 [英] How to install c++ library on linux

查看:250
本文介绍了如何在Linux上安装C ++库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux环境中是菜鸟.
我正在使用ubuntu 13.10,我想安装 Armadillo .自述文件说,我应该首先安装其他三个库,LAPACK,BLAS和ATLAS.

I am a noob in Linux environment.
I am using ubuntu 13.10 and I want to install Armadillo. The readme file said that I should install three other libraries first, LAPACK, BLAS and ATLAS.

我下载了lapack-3.5.0,但我不知道如何安装(我只知道apt-get install进行安装).我在自述文件中找到安装步骤,如下所示:

I downloaded lapack-3.5.0, but I don't know how to install it(I only know apt-get install for installation). I found the installation steps inside the readme file as:

  • LAPACK可以与make一起安装.必须在 make.inc文件.运行GNU编译器的Linux机器的make.inc.example 在主目录中给出.一些特定的make.inc也可以在 安装目录
  • LAPACK还包括CMAKE构建.您将需要安装CMAKE 在您的计算机上(CMAKE可从 http://www.cmake.org/获得). CMAKE将允许 在Windows机器上轻松安装

  • LAPACK can be installed with make. Configuration have to be set in the make.inc file. A make.inc.example for a Linux machine running GNU compilers is given in the main directory. Some specific make.inc are also available in the INSTALL directory
  • LAPACK includes also the CMAKE build. You will need to have CMAKE installed on your machine (CMAKE is available at http://www.cmake.org/). CMAKE will allow an easy installation on a Windows Machine

我已经安装了make和cmake,但是下一步该怎么做?
我想对这种安装概念以及安装步骤有一个大的了解(从源代码编译?我不确定这是否是正确的描述).
我对安装的理解仅来自在Windows中安装游戏,该游戏指定路径,然后输入安装命令,然后完成.这类似于这种情况吗?

I have installed make and cmake but what should I do next?
I would like to ask for a big picture about this kind(compile from source? I am not sure is this the correct discription) of installation concept and also steps for installation.
My understanding about installation is only come from installing a game in Windows that is specifying a path and then input install command and then finish. Is that similar to this case?

推荐答案

  1. 在控制台的Linux终端中,输入sudo synaptic

Synaptic基本上是围绕apt-get和相关命令构建的GUI.

Synaptic is basically a GUI built around apt-get and related commands.

将出现一个窗口,如下所示:

A window will appear, like this one:

在快速过滤器"框中,输入每个包装以查找包装,如果未选中,请选中各个包装.您可能希望-dev版本获取C/C ++头文件,以及-doc软件包获取手册页以及主软件包:

In the "Quick filter" box, enter each of these to seach for packages and then checkbox select the various packages if they are unselected. You probably want the -dev versions to get the C/C++ headers and the -doc packages to get the man pages, as well as the main package:

  • libblas
  • liblapack
  • libatlas

注意:有时人们需要最新的库来进行错误修复和其他功能,但是从您的正式Linux发行档案中可以通过synaptic获得的库会更旧.如果存在某个带有最新代码的ppa存储库,并且您知道其名称/地址,则可以使用add-apt-repository命令添加ppa存储库来解决此问题.

Note: sometimes people need the very latest libraries, for bugfixes, extra features, but the ones available through synaptic will be older, from your official linux distribution archive. This can be fixed by adding ppa repositories with the add-apt-repository command, if there is a ppa repository with the latest code somewhere and you know its name/address.

如果您需要在文本模式下通过ssh在VPS上执行此操作,并且无法使突触运行,则可以返回apt-get.如果您可以在本地运行突触,则可以使用它来搜索软件包名称.或者,您可以使用apt-cache search blas | less搜索包含字符串"blas"的软件包说明.

If you need to do this on a VPS over ssh in text mode, and you can't get synaptic running, you can go back to apt-get. If you can run synaptic locally, you can use it to scout the package names. Or, you can use apt-cache search blas | less to search for package descriptions containing the string "blas".

这篇关于如何在Linux上安装C ++库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆