How to install openmpi from Macports on Sierra and/or check if openmpi is already installed - macports

I am trying to install openmpi from Macports on Sierra 10.12.5. It seems that it is a straight forward command:
sudo port install openmpi
When I do this, I get the error:
sudo: port: command not found
I gathered from similar threads that this may be due to openmpi already being installed. How can I check if it is installed, and if so, uninstall it so that I can reinstall it using Macports with the above command? Any thoughts would be great. Thanks!

By default, the port command is installed at /opt/local/bin/port. The installer normally modifies your PATH environment variable to include '/opt/local/bin' so that you can launch stuff installed by MacPorts just by entering the name of the command. I think you should re-do the MacPorts installation. Follow:
https://www.macports.org/install.php
You almost certainly want to use the macOS package installer. You may have to restart Terminal for the new PATH to take effect.

Related

Error when trying to do (sudo apt install flex bison): The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt [duplicate]

I was watching this, and, as you can see, the first command I am told to put in is:
sudo apt-get install python-setuptools
When I do this, it outputs:
sudo: apt-get: command not found
I have no idea why this is the case.
How can I resolve this so I am following the tutorial correctly?
Mac OS X doesn't have apt-get. There is a package manager called Homebrew that is used instead.
This command would be:
brew install python
Use Homebrew to install packages that you would otherwise use apt-get for.
The page I linked to has an up-to-date way of installing homebrew, but at present, you can install Homebrew as follows:
Type the following in your Mac OS X terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that, usage of Homebrew is brew install <package>.
One of the prerequisites for Homebrew are the XCode command line tools.
Install XCode from the App Store.
Follow the directions in this Stack Overflow answer to install the XCode Command Line Tools.
Background
A package manager (like apt-get or brew) just gives your system an easy and automated way to install packages or libraries. Different systems use different programs. apt and its derivatives are used on Debian based linux systems. Red Hat-ish Linux systems use rpm (or at least they did many, many, years ago). yum is also a package manager for RedHat based systems.
Alpine based systems use apk.
Warning
As of 25 April 2016, homebrew opts the user in to sending analytics by default. This can be opted out of in two ways:
Setting an environment variable:
Open your favorite environment variable editor.
Set the following: HOMEBREW_NO_ANALYTICS=1 in whereever you keep your environment variables (typically something like ~/.bash_profile)
Close the file, and either restart the terminal or source ~/.bash_profile.
Running the following command:
brew analytics off
the analytics status can then be checked with the command:
brew analytics
As Homebrew is my favorite for macOS although it is possible to have apt-get on macOS using Fink.
MacPorts is another package manager for OS X:.
Installation instructions are at The MacPorts Project -- Download & Installation after which one issues sudo port install pythonXX, where XX is 27 or 35.
Conda can also be used as package manager. It can be installed from Anaconda.
Alternatively, a free minimal installer is Miniconda.
apt-get command is only available on Debian or Debian-based Linux distributions (such as Ubuntu, Linux Mint, Kali). It is not accessible on macOS. Alternatively, you can use package managers like Homebrew, MacPorts, and Nix. You can find equivalent commands for each as follows
brew install package_name
sudo port install package_name
nix-env -i package_name
Before installing above package managers, you need to install XCode first. Follow the operation instructions from this guide How to Fix "sudo apt-get command not found" Error on Mac Terminal.
Alternatively You can use the brew or curl command for installing things, wherever apt-get is mentioned with a URL...
For example,
curl -O http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz

remove downloads from cabal installation

I wanted to install Idris, so I first installed Haskell and then wrote cabal update and cabal install idris in the terminal. However, after downloading and installing lots of components, the installation finally failed on some packages. I then did the installation via the Windows-.exe from idris-lang.org and now it runs fine, but I want to remove what was downloaded and installed before with the cabal command. Any idea how to do that? Is there such a command like "cabal deinstall idris" or something? Or would it affect the other installation too?

Installing glibtop on ubuntu

I'm new to ubuntu and i'm currently using it on windows 7 with vmware workstation.
I need to access the CPU usage with a C program on terminal, so i thought of using glibtop_get_cpu() function on glibtop library. I just wrote #include <glibtop.h> in my code and compiled it with "gcc" on terminal, and it said
fatal error: glibtop.h: No such file or directory
compilation terminated.
I tried to install the library using this:
sudo apt-get install liblib2.0-dev
but the terminal said:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libglib2.0-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
libglib2.0-0 libglib2.0-bin
E: Package 'libglib2.0-dev' has no installation candidate
any ideas about this?
You should install libgtop2-dev (sudo apt-get install libgtop2-dev).

Mac running c program using gcc

Whenever I try to compile my c program on mac it gives the following error. I am completely clueless about it.
'sys/cdefs.h' file not found
have you installed "Xcode Command Line Tools" ? just install it in your terminal.
sudo xcode-select --install
Install Xcode, if you haven't already.
Then, from Terminal do the following to avoid future similar (not necessary just for this, I don't think) issues in future:
xcode-select --install
This will automatically download and install the latest XCode Command Line Tools.
From Xcode 4.3, the Xcode is installed from Mac App Store. By default, there is no command line tools. Probably you have missed it. They can be installed using the Components tab of the Downloads preferences panel.

Installing a php extension with Macports

I would like to install the php-intl extension for PHP on my Mac. I know the current PHP installation was installed with the OS (Mac OS X 10.6).
So I am wondering if I install the php5-intl package using Macports, will it install a second version of PHP (which I don't want), or will it upgrade my existing installation?
If I can't upgrade my current PHP installation that way, how can I proceed?
Installing the MacPorts php5-intl port will install PHP's intl extension for use with MacPorts php5, which it will also install; you'll also get MacPorts' copy of the apache2 server. MacPorts is designed to be self-contained; it's not designed to modify or integrate with any software components Apple provided with your OS. This is a good thing; Apple occasionally makes unexpectedly changes to their OS components which could break things installed by MacPorts.
If you want to give MacPorts apache2 and php5 a try, check out the MacPorts MAMP guide in the wiki.

Resources