Installation script for multiple operating systems - bash

I have to install a C compiler with cilkplus branch which is recently added to the GCC. Since it is recent so I ave to install it manually and there are no direct methods available to that. I plan to install it at custom location. I installed it on a redhat 6 and ubuntu 12.04 successfully but I found that the settings of environment variables are different on both operating systems ( not a surprise ).
For example to install the compiler on ubuntu 12.04 you would need C_INCLUDE_PATH=/usr/lib/x86_64-linux-gnu a directory which does not exist on redhat 6.
I plan to write a single script for installation of this compiler on many systems(different distributions of linux). How can I do it.
One way I can think of is to check which OS and version you are running and set environment variables accordingly but here also I do not know how to do it.
Any other suggestions are also valueable.
Thanks

I would use cmake for easy dependency checking and handling

Related

IRAF for Mac m1

Hi I'm trying to install IRAF with anaconda I follow these steps, but when I run iras, and I want to make something, this program doesn't recognize the commands of IRAF
i follow this tutorial: https://astroconda.readthedocs.io/en/latest/installation.html
I don't know how to fix it.
The Astroconda IRAF is a 32-bit version and does not work on M1 Macs, since they are not able to run 32-bit code.
To install IRAF for an M1 Mac, you should compile it manually, as described in https://iraf-community.github.io/install. This installs the latest 64-bit IRAF version. PyRAF (for Python 3) can then simply installed with pip3, see https://iraf-community.github.io/pyraf.html.
However, it is not recommended to start with IRAF unless there is a real need for it. IRAF is old software with an uncertain future and no institutional support. The Astropy Python package and its ecosystem provide good alternatives for many tasks of IRAF. https://astropy.org

Using snapd instead of flatpak in Linux Mint

I installed IntelliJ and WebStorm on my Linux Mint distro. The problem I have is that I cannot use the integrated terminal on both of the software. In both of them there is a problem with my bash binary location. I researched and saw that the software manager in Linux Mint installs flatpak software by default, and that it works as a sort of a container. I tried to change the location of my bash binary to var/run/host.. but it didn't seem to work.
I read that people solve this by installing the tar version of the software or using snapd. Since snapd is not supported by Linux Mint, what are my alternatives? Can I somehow give access to my software to use my bash, npm, etc... and if not, why is it that flatpak makes these things so difficult?..
Flatpak works as a sandbox environment - each pack has its own runtime environment and because of security reasons, flatpak apps do not have direct access to host files. There could be a lot of problems due to this.
Please try reinstalling the IDE using one of the officially recommended options (https://www.jetbrains.com/help/webstorm/installation-guide.html) - download the tar.gz from https://www.jetbrains.com/webstorm/download/#section=linux, or use the toolbox app to manage installations

Install GCC 4.8 on Redhat 7 in offline mode

How to install GCC 4.8 on RHEL 7 in offline mode? (not registered with Redhat).
I searched for a solution but couldn't find a proper one.
There are two options that we can use
1) Create a local yum repository from DVD/ISO file - Google search will throw lot of links. One such thing is https://access.redhat.com/solutions/1355683
2) Another option is use the Centos repository. Centos is derived from RHEL and should be safe. You can set this as you repository. But, I will go for the first one
Not sure about GCC 4.8, but V6.3.1 is available via the Developer Toolset. See https://developers.redhat.com/products/developertoolset/updates/
I'm believe GCC 5.3 may still be accessible too.
There's a no-cost RHEL developer subscription to download here: https://developers.redhat.com/products/rhel/download/
HTH

How can I install GCC compiler in Fedora without internet?

I got a new Fedora machine some time ago from this link http://download.fedoraproject.org/pub/fedora/linux/releases/21/Workstation/i386/iso/Fedora-Live-Workstation-i686-21-5.iso. I need to install software, but for that I need a compiler ("No acceptable C compiler found in $PATH.") So, I want to install GCC compiler. I cannot connect to internet on the Fedora machine, but I do have an internet connected Windows 8.1 machine, that I can use to download and copy files via 2gb flash drive. Please help me on how to go about installing GCC to the Fedora machine.
If you have the packages you need from the Fedora mirrors on your flash drive, you can install them on the command line with (for example)
yum install /media/pathname/gcc-4.8.2-1.fc20.i686.rpm
However, since 2GB isn't big enough to include the entire Fedora release, you will need to pick and choose the packages. And this will leave you in the state we used to call "RPM hell" back before yum came along and solved that. You can either figure out the dependencies one by one (start with the above, and then add anything it tells you it is missing), or, you could go all out and copy the entire mirror in 2GB sized chunks to your Fedora machine's hard drive so you have it for any future needs.

Installing OpenAL (or a similar package) on W7

I want to install OpenAL Haskell bindings for Windows. When I try cabal install alut I get:
Resolving dependencies...
Configuring OpenAL-1.4.0.2...
cabal: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
Installing MSYS or Cygwin is absolutely not an option. runghc setup configure on the source yields the same thing. This leads me to the following:
How can I install OpenAL with just an installation of the Haskell Platform? I know mingw comes with the Haskell Platform on Windows. Can I use just that to execute this script?
Is there a package that can play audio that installs with cabal on Windows 7 AND Unix based systems?
The source contains hundreds of directives designed for the configure script, which doesn't work on Windows. Is there a version of the source which is platform specific, ie, the script has already been run in a windows environment?
Edit: Context for the problem:
I have a Haskell program, which among other things, plays sound. It is going to be used for demonstration/interactive presentation to students. The computers in the lab run Windows 7. They have the Haskell Platform installed, but not MSYS or Cygwin. I have about 45 minutes to complete this, which doesn't leave time for the installation of needlessly complex and essentially pointless software. If I could get Windows-compatible source code, I could just distribute it with the program I wrote. All the packages I need besides this one will cabal install just fine; this is also a good introduction to package management.
Edit2: cabal install fails with Cygwin installed, as does runghc setup configure

Resources