Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:31:18+00:00 2026-06-17T10:31:18+00:00

I am trying to install numpy with OpenBLAS , however I am at loss

  • 0

I am trying to install numpy with OpenBLAS , however I am at loss as to how the site.cfg file needs to be written.

When the installation procedure was followed the installation completed without errors, however there is performance degradation on increasing the number of threads used by OpenBLAS from 1 (controlled by the environment variable OMP_NUM_THREADS).

I am not sure if the OpenBLAS integration has been perfect. Could any one provide a site.cfg file to achieve the same.

P.S.: OpenBLAS integration in other toolkits like Theano, which is based on Python, provides substantial performance boost on increasing the number of threads, on the same machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:31:19+00:00Added an answer on June 17, 2026 at 10:31 am

    I just compiled numpy inside a virtualenv with OpenBLAS integration, and it seems to be working OK.

    This was my process:

    1. Compile OpenBLAS:

      $ git clone https://github.com/xianyi/OpenBLAS
      $ cd OpenBLAS && make FC=gfortran
      $ sudo make PREFIX=/opt/OpenBLAS install
      

      If you don’t have admin rights you could set PREFIX= to a directory where you have write privileges (just modify the corresponding steps below accordingly).

    2. Make sure that the directory containing libopenblas.so is in your shared library search path.

      • To do this locally, you could edit your ~/.bashrc file to contain the line

        export LD_LIBRARY_PATH=/opt/OpenBLAS/lib:$LD_LIBRARY_PATH
        

        The LD_LIBRARY_PATH environment variable will be updated when you start a new terminal session (use $ source ~/.bashrc to force an update within the same session).

      • Another option that will work for multiple users is to create a .conf file in /etc/ld.so.conf.d/ containing the line /opt/OpenBLAS/lib, e.g.:

        $ sudo sh -c "echo '/opt/OpenBLAS/lib' > /etc/ld.so.conf.d/openblas.conf"
        

      Once you are done with either option, run

      $ sudo ldconfig
      
    3. Grab the numpy source code:

      $ git clone https://github.com/numpy/numpy
      $ cd numpy
      
    4. Copy site.cfg.example to site.cfg and edit the copy:

      $ cp site.cfg.example site.cfg
      $ nano site.cfg
      

      Uncomment these lines:

      ....
      [openblas]
      libraries = openblas
      library_dirs = /opt/OpenBLAS/lib
      include_dirs = /opt/OpenBLAS/include
      ....
      
    5. Check configuration, build, install (optionally inside a virtualenv)

      $ python setup.py config
      

      The output should look something like this:

      ...
      openblas_info:
        FOUND:
          libraries = ['openblas', 'openblas']
          library_dirs = ['/opt/OpenBLAS/lib']
          language = c
          define_macros = [('HAVE_CBLAS', None)]
      
        FOUND:
          libraries = ['openblas', 'openblas']
          library_dirs = ['/opt/OpenBLAS/lib']
          language = c
          define_macros = [('HAVE_CBLAS', None)]
      ...
      

      Installing with pip is preferable to using python setup.py install, since pip will keep track of the package metadata and allow you to easily uninstall or upgrade numpy in the future.

      $ pip install .
      
    6. Optional: you can use this script to test performance for different thread counts.

      $ OMP_NUM_THREADS=1 python build/test_numpy.py
      
      version: 1.10.0.dev0+8e026a2
      maxint:  9223372036854775807
      
      BLAS info:
       * libraries ['openblas', 'openblas']
       * library_dirs ['/opt/OpenBLAS/lib']
       * define_macros [('HAVE_CBLAS', None)]
       * language c
      
      dot: 0.099796795845 sec
      
      $ OMP_NUM_THREADS=8 python build/test_numpy.py
      
      version: 1.10.0.dev0+8e026a2
      maxint:  9223372036854775807
      
      BLAS info:
       * libraries ['openblas', 'openblas']
       * library_dirs ['/opt/OpenBLAS/lib']
       * define_macros [('HAVE_CBLAS', None)]
       * language c
      
      dot: 0.0439578056335 sec
      

    There seems to be a noticeable improvement in performance for higher thread counts. However, I haven’t tested this very systematically, and it’s likely that for smaller matrices the additional overhead would outweigh the performance benefit from a higher thread count.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to install the ADT plugin following Android Developper Site' instructions on a
Trying to install an app beta. The mobile provision file installs fine on my
I am trying to install numpy on my mac machine. Whatever I try, I
I'm trying to install numpy on a Red Hat (RHEL6) 64-bit linux machine that
I'm trying to write some code that uses Numpy. However, I can't import it:
I'm trying to install matplotlib under Windows Vista. Both python itself and numpy are
Trying to install PostGIS 2.0.0 on Ubuntu 11.10. I've basically followed the OSGeo instructions
I am trying to get NumPy to work on my new Windows 8 installation,
I am trying: install.packages(RGoogleDocs, repos = http://www.omegahat.org/R) As suggested here , but it doesn't
Trying to install Symfony 1.4.11 application on Ubutnu Server + Nginx + php-fpm Nginx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.