GDC in fedora binary release - d

I search for GDC binary release (D2 -> D1 is on source forge) for fedora, but it isn't exists. Then I want to compile it from source code, but I don't know how to do it. There isn't any configure or make file in root directory. Are there any good soul who helps me with it? And yes, I found question D programming on fedora 16 but it isn't response to my question.

Lucky for you, I am working on GDC RPM, and I will soon announce it (once I test it) on the http://forum.dlang.org/group/digitalmars.D.announce newsgroup. At the moment I am testing the ARM build on my ODROID-U2 box. I will soon push the SPEC and the rest to a Git repository at https://gitorious.org/rpm-gdc . The RPM installs GDC into /opt/gdc .
Speaking about GDC, I also have a patched gcc.spec which can be used to re-build system's gcc with enabled support for the D programming language. I have never submitted it to Fedora people as I expect GDC to be in GCC soon...
Meanwhile, you may want to get DMD RPM from http://dlang.org (or build Fedora RPMs using my DMD SPEC from https://gitorious.org/dejan-fedora ) or LDC, which should already be in the Fedora repository. If not, grab it from http://koji.fedoraproject.org.

Related

Install older gcc

I have Fedora 31 installed which has gcc 9.3.1 installed into it.
I want to install gcc 4.8.5 on my machine.
Tried compiling the gcc by downloading tar file from gnu website, but facing lot of compilation errors.
Can anone help me with the installation.
Thanks in advance.
The compiler you are looking for was in a Fedora release many many years ago and will be hard to reasonably get going on a current Fedora Linux system.
However, it is the compiler in RHEL 7, and therefore in CentOS. Your best bet is to install one of those operating systems in a virtual machine. (You can get RHEL for individual use through the RH Developer Program.) In Fedora Workstation, the Boxes program makes it easy to set up such a VM.
You could also use a docker or podman container, but that will take a little more understanding.

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.

How to build and install GCC on Windows 7, ver. 4.8.1

I would like to upgrade my old GCC compiler to v. 4.8.1.
Currently I'm using Code::Blocks IDE (nightly build, svn 8982), and my compiler is GCC 4.4.1.
I downloaded fresh GCC from their site - gcc.gnu.org
From what I've read in documentation, they say that I should first build compiler by myself. Afterwards, they throw something like this:
% mkdir objdir
% cd objdir
% srcdir/configure [options] [target]
However, I completly have no idea what to do with these lines.
And even if I did, afterwards come maaany lines with some additional options, where I am even more lost then before.
I don't know if there is any easy way of installing it, but from what I've read here, I can download MSYS from MinGW and it will do everything(I hope?) for me. However, from what I see there, it says that MinGW comes with already built version of GCC, meaning I won't be able to use mine anyway. Am I right? If yes, what should I do to build and use GCC? If not, then will I be able to easily install GCC after downloading MSYS?
Thanks in advance.
I can download MSYS from MinGW
YOu can.
and it will do everything(I hope?) for me.
It won't. MSys provides environment for building software that requires unix-like environment. To be more precise - autotools. If you aren't familiar with *nix build process (configure script), Mingw won't really help you.
However, from what I see there, it says that MinGW comes with already built version of GCC,
Yes, version 4.7.2 at the moment.
meaning I won't be able to use mine anyway. Am I right?
No. If you don't add Mingw/MSys to your PATH, you can keep multiple different installations on the same machine. It also SHOULD be possible to use multiple different versions of gcc within the same installation of mingw, but things can get messy here. (gcc3 and gcc4 should be able to exist, not sure about 4.7.2 and 4.8.1)
If yes, what should I do to build and use GCC?
You should search for precompiled binaries provided by somebody else. Compiling gcc yourself is possible, but for you (i.e. if you aren't arleady familiar with msys) it might not be worth the effort.
Either you could try http://mingw-w64.sourceforge.net/ or mingw-nuwen. Mingw provided by nuwen is 32bit only, but is very easy to install. The problem is that standard mingw distribution includes update tool (with "mingw uppdate" and "mingw upgrade" you can upgrade installed packages to their latest version), bug "mingw-nuwen" doesn't have such tool.
Because you say
However, I completly have no idea what to do with these lines.
You should either use precompiled mingw provded by somebody else, or use another compiler. If you don't really need bleeding-edge C++11 support ON WINDOWS, use visual studio express.

How do I install g++ on MacOS X?

I want to compile C++ code on MacOS X, using the g++ compiler. How do I install it?
That's the compiler that comes with Apple's XCode tools package. They've hacked on it a little, but basically it's just g++.
You can download XCode for free (well, mostly, you do have to sign up to become an ADC member, but that's free too) here: http://developer.apple.com/technology/xcode.html
Edit 2013-01-25: This answer was correct in 2010. It needs an update.
While XCode tools still has a command-line C++ compiler, In recent versions of OS X (I think 10.7 and later) have switched to clang/llvm (mostly because Apple wants all the benefits of Open Source without having to contribute back and clang is BSD licensed). Secondly, I think all you have to do to install XCode is to download it from the App store. I'm pretty sure it's free there.
So, in order to get g++ you'll have to use something like homebrew (seemingly the current way to install Open Source software on the Mac (though homebrew has a lot of caveats surrounding installing gcc using it)), fink (basically Debian's apt system for OS X/Darwin), or MacPorts (Basically, OpenBSDs ports system for OS X/Darwin) to get it.
Fink definitely has the right packages. On 2016-12-26, it had gcc 5 and gcc 6 packages.
I'm less familiar with how MacPorts works, though some initial cursory investigation indicates they have the relevant packages as well.
Installing XCode requires:
Enrolling on the Apple website (not fun)
Downloading a 4.7G installer
To install g++ *WITHOUT* having to download the MASSIVE 4.7G xCode install, try this package:
https://github.com/kennethreitz/osx-gcc-installer
The DMG files linked on that page are ~270M and much quicker to install. This was perfect for me, getting homebrew up and running with a minimum of hassle.
The github project itself is basically a script that repackages just the critical chunks of xCode for distribution. In order to run that script and build the DMG files, you'd need to already have an XCode install, which would kind of defeat the point, so the pre-built DMG files are hosted on the project page.
Type g++(or make) on terminal.
This will prompt for you to install the developer tools, if they are missing.
Also the size will be very less when compared to xcode
Download Xcode, which is free with an ADC online membership (also free):
http://developer.apple.com/technology/xcode.html
xcode is now available for free from the app store. Just "buy it" (for free) and it will download. To get the command line tools go into preferences/downloads and "install command line compiler tools".
Instead of gcc you are using clang, but it works the same.
Here is how to do it on the newer mac chips and how to switch from clang(default) to g++
Install g++ through home-brew.
Check out the version you just installed, probably 12th or higher
You can make a symbolic link from g++-12 to g++
In order to do it, just type in your terminal:
sudo ln -s $(which g++-12) /usr/local/bin/g++.
Now open a new terminal and check your version again and you should see g++ instead of clang
g++ --version