

- SUDO APT GET INSTALL GFORTRAN HOW TO
- SUDO APT GET INSTALL GFORTRAN FULL
- SUDO APT GET INSTALL GFORTRAN SOFTWARE
Warnings.warn(‘Specified path %s is invalid.’ % d) usr/local/lib/python2.7/dist-packages/numpy/distutils/system_info.py:635: UserWarning: Specified path is invalid. I just looked through a similar issue on stackoverflow and tried the script mentioned over here ( ). I’ll try 1.9.2, and see if it solves the problem. Just run pip install scipy and you should be good to go, or install normally from source to get the lastest development version. Scipy is easy to install, because it will make use of Numpy’s OpenBLAS bindings. If Numpy is finding your OpenBLAS install when you do python setup.py config, you’re probably good. New versions of Numpy no longer create _dotblas.so, so don’t worry if you don’t see it. If the SVD and Eigendecomposition are slow, it’s likely that you have a problem with the LAPACK linking (this only happened when I tried to use the OpenBLAS installation from apt-get).

If just the matrix-matrix multiply is slow, it’s likely because core/_dotblas.so didn’t get created, or can’t find your OpenBLAS library (see above). Print("Eigendecomp of (%d,%d) matrix in %0.3f s" % (n, n, td)) Print("dotted two (%d) vectors in %0.2f us" % (n, 1e6*td/N)) To make sure everything is working right, I run the following script

Otherwise, use the -user flag to install to your home directory, or put the sudo command on front to install to the /usr directory. Installing to a virtual environment is best. If everything seems good, call python setup.py install. (Update: new versions of Numpy no longer create _dotblas.so, see below.) You can also run ldd on it, to make sure that it’s finding your OpenBLAS library all right. In your Numpy source directory (where you should still be if you’re following along), look under build/lib.linux-x86_64-2.7/numpy/core, and make sure _dotblas.so is there. For this to work, Numpy needs the file core/_dotblas.so to exist. One of the benefits of using OpenBLAS is that it can make Numpy’s dot function for matrix-matrix multiplies really fast. To specify gfortran as the compiler (see Numpy install notes). If you have both Fortran compilers installed, call:

(TODO: I should try this with ATLAS installed, to see if Numpy ignores it or tries to use it.) If everything looks good, go ahead and call python setup.py build. Run python setup.py config to make sure everything is set up correctly. This file lets Numpy know where your OpenBLAS libraries are. Right now it’s v1.10.4:Īdd a file called site.cfg, with the following lines
SUDO APT GET INSTALL GFORTRAN FULL
Find the newest branch (largest version number) with no letters after it (indicating a full release). This should show you all the possible branches. To find this, type git checkout v and press Tab. I prefer to use the latest stable branch. Numpyīuilding Numpy requires Cython, so make sure it is installed ( pip install cython, with sudo or -user as necessary depending on where you want to install it).īy default, the repository will be on the current development ( master) branch. Add a file to /etc/ld.so.conf.d/ called nf, containing the path to your new libraries ( /opt/openblas/lib). To install OpenBLAS, do the following commandsĪs you can see, I prefer to put my OpenBLAS install in /opt, so it’s out of the way of things I install with apt-get.įinally, you have to let your system know about these new libraries. This can be done via apt-get, but installing from source has the advantages that OpenBLAS will be fully optimized to your machine, and you can put it somewhere other than /usr/lib (which should hopefully allow Octave to be installed simultaneously, though I haven’t tried this yet). Sudo apt-get install git python-dev gfortranĪlso, it might make things easier to make sure that the other Fortran compiler, g77, is not installed (though if you prefer to keep it around, you just have to take an extra step in the Numpy install). Before we beginįirst, make sure you have these tools installed These instructions are based on the very useful blog post that can be found on odsf’s blog.
SUDO APT GET INSTALL GFORTRAN HOW TO
Here I will tell you how to set up Numpy and OpenBLAS on an Ubuntu machine from source (though I think they should be pretty transferable to any flavour of Linux). Even installing it using sudo apt-get install python-numpy (on Ubuntu) is not as good as the following setup in my experience. Unfortunately, if installed naïvely using pip, it can be very slow. using OpenBLAS), I’ve found it can be even faster than MATLAB’s highly optimized ATLAS backend.
SUDO APT GET INSTALL GFORTRAN SOFTWARE
Numpy is a great software package for doing numeric computations in Python.
