Boost installation in Linux - linux

According to Boost download instructions for Linux http://www.boost.org/doc/libs/1_42_0/more/getting_started/unix-variants.html I should extract the Boost library to some directory on my computer. I am working with Ubuntu, Eclipse and CDT.
What is right directory to install Boost? Somewhere in /usr or in my home directory?

Boost is also available in the Ubuntu repositories -- for example,
sudo apt-get install libboost1.40-dev will install the development files for boost. This is probably the best option if you don't need the absolute most recent version (looks like the latest available on Ubuntu 9.10 is 1.40).

You should extract it to your home directory so you can build those libraries that need building (if you want to do a full install). IIRC bjam install defaults to somewhere in /usr or /usr/local (sorry, can't remember) but I'm pretty sure you can override the exact location on the command line.
I'd put it somewhere where it's unlikely to clash with a system-wide install of boost. If you're the only developer on this machine, I'd leave it in your home directory as there really isn't much point in moving it somewhere else. Just make sure you adjust the include and library paths accordingly.

For future reference:
Trying to install Boost 1.40 using apt-get and Synaptic, I encountered many problems: some files could not be downloaded, verified etc. Also, this installation doesn't seem to build the Boost libraries.
Finally, I installed the Boost manually following this manual:
http://ubuntuforums.org/showthread.php?t=1180792
I accepted all default directories, it is installed in /usr/local. I tested both inline functions and libraries, for now it looks OK.

Related

Is it possible to run a newer version of cloc (or any package) onto an older version of ubuntu?

I have to work with ubuntu 14.04, but I need to use cloc 1.92. The highest cloc version via package update for Ubuntu is 1.6.
https://packages.ubuntu.com/search?keywords=cloc
I did a wget https://github.com/AlDanial/cloc/releases/download/v1.92/cloc-1.92.tar.gz to download this package to my machine, but it's not showing up in the package list when I do dpkg --list. I'm not sure how to make the cloc 1.92 folder run the same way that 1.6 does on my VM, or if it's even possible to do so.
The git page for cloc explains all related aspects, and skimming over it, in the Why use cloc? section says that the "program is self-contained, only download and run it". This program is developed in Perl 5, present in all Ubuntu distros. You can check that with the command perl --version.
Simply extract the file cloc from the tar.gz and copy it in an appropiate directory, for example /usr/local/bin, and confirm it has the proper executable rights with the command chmod a+rx /usr/local/bin/cloc.
Caveat: cloc claims to use only standard Perl modules. If your installed Perl doesn't have all needed, you will have to install them using CPAN.
Edit: See the comments by Knud Larsen for manual installing as Ubuntu mantainers do.
In this case, as the program is run by an interpreter, it wasn't needed to compile it, but in general programs/libraries in source form could to be compiled and installed independently from the apt/dkpg package management, but could need other libraries/programs to operate. The mantainer of the distro ensures this dependencies are installed together with the desired package. If we want to compile/install manually, then also we have to compile/install all requirements of the program if they aren't there already.
In other cases, the additional required software for the package could be already installed in some older versions, but it is used by other installed programs that could fail if we install new versions. That is the main problem when updating software in older distros: We need to investigate and resolve any conflicts manually.
So, the second answer is: Yes, we can update software in older versions of Ubuntu, but could be impractical to do so.

Basic set of libraries in chroot (fedora linux)

I'm running an old version of my linux distro (fedora, but this is not very relevant) and for reasons which are completely irrelevant I'm not in a position to update it. However I do need a newer version of gcc and some other libraries than those supplied by my old distro.
I could compile a newer gcc and all the other libraries of course but I thought the simplest way would be to install a minimal set of packages from the latest distro version to a directory and then just chroot there. This way I'd take advantage of the binary packages present in the newest distro and all the infrastructure around it (like dependency installation, etc.) and I wouldn't need to compile everything from source.
My question is this: if I only would like to be able to compile with the most recent gcc and run those programs, what is the minimal set of packages I need? Since we are talking about fedora, what is the minimal set of rpms (beyond glibc and gcc)? Note that I don't need any X environment, networking, or anything like that, only the most basic terminal tools.
The minimal set varies depending on your user needs and what you're linking with. What I do when making a chroot environment is have a look at the distro I want to chroot and see if they have a base rpm/deb package that kickstarts everything. Then I install that in the chroot. From there I add libraries and applications as needed.
For an example where I create a chroot for RHEL on Arch see http://www.zenskg.net/wordpress/?p=267

how to compile apache,mysql and php in linux

I have never used Linux OS. Want to know how we can start compiling Apache,Mysql and php in Linux and is it necessary to configure it.
I tried doing it by using cd/user/scr/httpd_2.0.09
Do we need to downloads the set up from google
Do yourself a favour and don't try to compile your own webserver etc. ;)
Aside from the fact that it's a lot of work to set up the tools for compiling, resolve dependencies, and debug possible errors, you will have to do the same procedure with every tiny update – instead of simply getting a new version via your package manager.
If you use a common distribution, install the packages required for the so-called LAMP stack, and configure them properly. That will be hard enough for starters.
If you're using Ubuntu, have a look here: https://help.ubuntu.com/community/ApacheMySQLPHP
Actually installing binaries from repositories is less painful than compiling, but if you really want so, you may install Gentoo or other source-based distributive. I've simply described compilation of MySQL 5.5 in my blog.
To compile packages on Debian based systems you need to install build-essential and cmake package (and maybe some other *-dev packages, which appears to be missing during source configure).
For example to compile MySQL 5.5 it is enough to run:
cmake . #yep, with dot. Will prepare your source according to your system
make
make install #will install compiled binaries to system

Installing Qt on Linux (Debian distribution)

I have Qt 4.6.3 on Debian. I need version 4.8.1.
To install it I downloaded the Qt SDK 1.2.1 from the Qt site, where is said that it contains version 4.8.1
After installation I checked Qt version and it is 4.6.3 instead of expected 4.8.1.
What I am doing wrong? And how can I install 4.8.1?
First of all I recommend getting 'official' Debian Qt upgrades by adding the testing (wheezy) repo to your package manager, this way everything on your system will be updated seamlessly in a few clicks.
If you can't do this, then:
Use your package manager to uninstall the existing Qt installation (so that's the runtime libs, plugins, and Qt Creator).
Install the SDK anywhere you like, it installs under one folder anyway.
Update your $PATH to point to the directory with qtcreator, qmake, etc., there are numerous ways of doing this, the simplest is exporting the updated $PATH in your .bashrc. (And optionally make some nice shortcuts for your DE).
Create symlinks in /usr/lib (or /usr/lib64) to point to the Qt libraries the SDK provides, or add a qt.conf file containing the path in your /etc/ld.conf.so.d/ directory and run ldconfig as root.
I'm an openSUSE user myself, so some of the above may slightly different on Debian, hopefully someone with Debian experience can chime in if I'm incorrect.

Where is linux-tick-processor on node.js ubuntu native package installation?

I have installed Node.js on an Ubuntu 64bit server using a standard apt-get and would like to profile scripts through the "--prof" flag.
Web searching shows there should be a tool to process the v8.log output located in "deps/v8/tools/linux-tick-processor" but I don't seem to have any of those directories. Do they come with the native install? should they be installed separately? if so how?
Thank you
You need to download the source package with sudo apt-get source nodejs.The path you mentioned is in there.
You'll need to scons prof=on d8 in deps/v8 to build the debugger first, which might have some trouble on a 64-bit machine (v8 is 32-bit only), see here for more info.
Here's how I did it for Node.js 0.10.25 and 0.10.26:
I downloaded the source for Node.js that corresponds to the binaries I'm using. (I'm on Debian testing, which is a bit behind the releases from the Node.js web site.)
I checked the version of v8 bundled in the node sources. (Look at deps/v8/ChangeLog. It was 3.14.5 for Node.js 0.10.25 and 0.10.26.)
I downloaded this exact version of v8 from the v8 site.
Why? I tried running make native in Node.js deps/v8 directory but the Makefile was complaining about a missing test directory. From this we can infer that the Node developers are not including the entire v8 distribution. Once upon a time, with an earlier version of Node (0.8.something) I did build v8 from what was available in deps/v8 but this time I decided to use a different approach.
As explained in v8's build/README.txt, in the top level of the source tree for v8, I did:
$ svn co http://gyp.googlecode.com/svn/trunk build/gyp
(Linking my installed gyp to build/gyp as suggested in OrangeDog's answer did not work. That's why I did the above.)
I ran:
$ CXX=g++-4.7 make native
Why the CXX setting? I ran into a compilation problem right away when I tried with the default gcc. I checked the version. It was 4.8 and I remembered a story on Slashdot about how 4.8 was giving people trouble. So I installed 4.7. Worked fine.
I linked out/native/d8 to a location which is in my PATH. This is because the linux-tick-processor script does a poor job at finding d8. The simplest solution was to make it available in my PATH. Your mileage may vary.
After all this, linux-tick-processor can be used with the v8.log files that Node produces.
Either install the source package - sudo apt-get source nodejs, or switch to the official source as the ubuntu packages are very out of date.
To build d8, go to the deps/v8 directory.
Create a symlink at build/gyp to the directory where gyp can be found (e.g. /usr/bin).
Run make native.
Copy/symlink out/native/d8 to somewhere on your PATH.

Resources