jenkins: gcc multiple versions for different projects on same system - c++

In my Continuous Integration set-up in Jenkins, I have two Cpp projects. One project requires the latest G++ 4.8.2 (already installed in /usr/bin) but the other project requires an older version of G++ 4.6.3 (not yet installed). I am using make file for the build process. The OS running on the server is Linux Mint 17 Qiana.
Please advise a suitable method. Any help is appreciated.

Related

Build gcc on Windows with another gcc version

How to compile the newest gcc release under Windows 10? I have the latest mingw-w64available here which isn't fully c++17 compliant (I cannot use the filesystem library). A build called winlibs is also available but it is built on mingw-w64 8.0.0, so newer standards aren't fully supported. I downloaded the compressed file gcc-10.3.0.tar.gz.
What are the steps needed to do build any new (or old) gcc release on Windows natively without resorting to cygwin or msys or wsl?
Building GCC isn't trivial. It involves multiple steps, starting with having all the dependancies available.
You already had an older winlibs release, who don't you just get the latest winlibs build from http://winlibs.com/ ?
I do not understand what problem you are having with std::filesystem. Perhaps you are using a different mingw. Here is how I get mingw64
Download and install the latest g++ 64 bit compiler from
http://www.msys2.org/ Follow installation instructions on that page.
Note that you will have to stop and restart the MSYS2 command line
tool several times. To do this, close the window and then run
C:\msys64\msys2_shell. When pacman ( packet manager ) reports "there
is nothing to do" run it once more with the command pacman -S
mingw-w64-x86_64-toolchain

How to run g++-6 on debian 10, need to compile older buildroot system (Cross compiling)

How to run g++-6 on debian 10, need to compile older buildroot files.(NCurves(host-ncurses-5.9) is crashing)
I have tried to patch the files in the buildroot but it like walking into a swamp.
Fixing one problem to find the next problem.
Tried compiling 6.3 compiler from source but this is crashing with the latest gcc-8 compiler.
Any suggestions? (I always assumed that older compilers should compile with newer compilers)
My other options are:
* Running virtual machine (VM or docker) with Debian Jessie
* Compile an older compiler with a docker GCC compiler.(No idea if this works)
* maybe turn off the compiling of the local files in buildroot? (Could not find any info on this)
There is a gcc-6 package available in Debian. So you just need to sudo apt install gcc-6. link
No reason to compile gcc from source unless you need a very specific version, but even then Docker is the far easier solution since gcc has an official repo on Docker Hub. I'd also double check that you have the proper ncurses dev library installed.
The overall best solution is to containerize the correct build environment (compiler, libraries, etc.), though. It ensures you'll always be able to build the product, especially if a re-factor is not viable.

What is the best way to have multiple g++ toolchains installed on Debian Jessie

I'm pretty new to linux, and I want to have installed multiple toolchains versions on my machine for testing purposes, I've read many documents on the internet refering to how to install test/experimental/unstable packages to get very new compilers packages (i.e. g++-6), but after setting Debian to find packages from test/experimental/unstable channels and install g++-6 my machine crashed, so as a new Linux user I would like to get your help to understand what is the recommended way of doing this, in my case I would like to have an easy way of testing my code against g++ (4.9, 5 and 6).
On Windows I used to download a zip package from a daily build version of mingw including g++ 5 or 6 and just setted the IDE to look for the toolchain in each folder, is that possible on Linux?
Mixing up stable/testing/unstable branch of debian is not easy and i wouldn't recommend to do it. What you could do is to download diractly the tarball, or clone the cvs and compile the compiler on your own, having each version in their own directory.
The different releases can be found here, for example.

Compile vowpal-wabbit in ubuntu for use in windows 7

I have a Windows 7 laptop with an Ubuntu 12.04 installation on the same machine.
I am trying to compile a program from source (VowPal Wabbit). I tried using Cygwin but had no luck getting it to work. I ended up installing Ubuntu 12.04 to get access to get a functioning compiler.
It worked on the Ubuntu side but I am curious if there is a way to bring the compiled files over to Windows as that's where I actually do most of my work. More specifically, will programs compiled in Ubuntu function on a Windows machine?
Any suggestions?
You should check out MinGW:
MinGW, a contraction of "Minimalist GNU for Windows", is a minimalist
development environment for native Microsoft Windows applications.
I realize it is almost a year later. Credit Chris Quirk, Nick Nussbaum and others, current versions of vowpal wabbit (7.x) should build and work fine on Windows.
This reference should provide all the necessary details.
Edit: 2017-07-10:
I should also note: the library and basic train and test from files functionality has been working on Windows for a while. However, not all the functionality supported in a native Linux environment is available on Windows. In particular, the --daemon option, network related features like spanning-tree (under the cluster directory), and some of the utilities under the util directory have not been fully ported and/or tested on Windows. vw developers welcome pull-requests from Windows users.

How to update GCC in MinGW on Windows?

I'm used to manually install GCC from source before on Ubuntu and it was a painful process. So I really don't want to do repeat this process. Currently, I have MinGW and GCC (4.6.2) installed on my machine. So is there an easy way to update GCC without building it entirely from source? Has anyone done it before can share me some tips?
Update using terminal:
Run the command prompt/terminal (cmd or sh).
Update the package list:
mingw-get update
After updating the package list, run:
mingw-get upgrade
When the command finishes running, all of your packages will be upgraded.
Update using the GUI version:
If you aren't used to the terminal, there is also a GUI version of MinGW called "MinGW Installation Manager", which is normally located at:
C:\MinGW\libexec\mingw-get\guimain.exe
When the GUI is open, tap Installation -> Update Catalogue. This will update the package list.
After that, tap Installation -> Mark All Upgrades. This will select all of the packages which can be upgraded.
Finally, tap Installation -> Apply Changes to apply the upgrades.
Snapshots and release builds of the MinGW http://code.google.com/p/mingw-builds/downloads/list
UPDATE: As of Nov-5-2012, MinGW includes 4.7.2 of the GCC compiler, which is the most current version. I personally will use the MinGW package, since it includes MSYS and other tools, and since it is the defacto standard, I hope that it is better supported. The only drawback is the included GDB does not include Python scripting, but I think that can be updated separately.
I don't know if you can update the GCC in MinGW, but there are alternative projects to MinGW with newer versions of GCC.
The MinGW-builds project provides a package similar to MinGW but with an updated GCC (4.7.2). I extracted the files to c:\MinGW (so I could use the same path) after moving my existing MinGW to another folder. Only MinGW has MSYS, so if you need that (I did) copy the msys folder from the original MinGW.
After installing MinGW-builds, the result of g++ --version:
g++ (Built by MinGW-builds project) 4.7.2
The latest GCC that comes with standard MinGW is currently 4.7.0. I compiled a few simple projects in Code::Blocks, and the latest wxWidgets source, and everything seems to work.
It's worth noting that MinGW-builds includes a Python script enabled version of GDB, in case you want STL pretty printer support, or other GDB Python features.
Another good choice is TDM-GCC, which is a project that hosts an impressive installer that includes an updated GCC compiler (4.7.1) and support tools. It is a standalone package. As far as I can tell, Python scripting is not supported in the GDB that comes with this package.
Finally there is the MinGW-w64 project, which is a fork of MinGW. Rubenvb, who posted an answer to this question, has good standalone packages (in the personal builds folder) based on this project which include an updated GCC (4.7.2). The included GDB seems to be Python script enabled.
if you use MSYS2
just open mingw64-console and type in:
# Update the package database and core system packages with:
pacman -Syu
# If needed, close MSYS2, run it again from Start menu. Update the rest with:
pacman -Su
I have built a more up to date GCC 4.7 (it's built within code freeze, so it should be equivalent with the release). Also, this build contains <thread> support.
32-bit
64-bit
The -gcc_linux package is what you want if you want to use it on Linux. Just extract somewhere and add the mingw??/bin directory to PATH.
PS: There's a native Windows compiler and a Windows Clang build. I suggest using Clang only with one of my GCC 4.6 builds, as it has trouble with GCC 4.7's libstd++. Extract the Clang package in the same directory as the GCC package and it will work out of the box.
The MinGW-w64 build from http://winlibs.com/ has the latest GCC version and requires no installation, just unzip the download. To upgrade you can just replace the mingw32 or mingw64 folder with the new version.
To get latest MinGW64 in Windows: https://sourceforge.net/projects/mingw-w64/?source=typ_redirect
For all platforms: https://mingw-w64.org/doku.php/download
You just need to update your g++ compiler if its not.
First problem can be solved through this:
Update using the GUI version:
If you aren't used to the terminal, there is also a GUI version of MinGW called "MinGW Installation Manager", which is normally located at:
C:\MinGW\libexec\mingw-get\guimain.exe
When the GUI is open, tap
Installation -> Update Catalogue
. This will update the package list.
After that, tap
Installation -> Mark All Upgrades
. This will select all of the packages which can be upgraded.
Finally, tap
Installation -> Apply Changes
to apply the upgrades.
2nd Problem could be that if you didn't updated the path of mingw in environment variables.