Skip to content

OpenBLAS built with USE_OPENMP=1 for windows 64 bit #1989

Closed

Description

@thedude2019

Dear OpenBLAS team,

Can you please send me OpenBLAS latest release built with USE_OPENMP=1 for windows 64 bit (Intel Haswell processor)? I don't have a lot of experience building for windows and was unsuccessful...the standard release on your site works but I want to work with OpenBLAS & OpenMP.

gcc version: gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.
gfortran version: GNU Fortran (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.

Thank you!

Activity

  1. brada4 commented on Jan 29, 2019

    @brada4
    Contributor

    It is just adding USE_OPENMP=1 to make command line. It will use gomp , not native omp, so other programs need to use gomp

  2. thedude2019 commented on Jan 29, 2019

    @thedude2019
    Author

    Hi! maybe you can explain what I'm doing wrong...I did the following:

    1. Installed MSYS-1.0.11.
    2. Installed msysDTK-1.0.1.
    3. Downloaded OpenBLAS Windows x86/x86_64 latest binary package: OpenBLAS 0.3.5 version.
    4. Extracted the binary and I get the folder: xianyi-OpenBLAS-eebc189.
    5. Opened MSYS and move to OpenBLAS folder with: $ cd /d/OpenBLAS/xianyi-OpenBLAS-eebc189.
    6. When I build with $ make command I receive the following error:
      $ make Can't locate object method "new" via package "File::Temp" (perhaps you forgot to load "File::Temp"?) at ./c_check line 15. make: *** [config.h] Error 9 Makefile.system:201: Makefile.conf: No such file or directory C:\msys\1.0\bin\make.exe: *** couldn't commit memory for cygwin heap, Win32 erro r 0

    What am I doing wrong?

    Thank you!

  3. brada4 commented on Jan 29, 2019

    @brada4
    Contributor

    You do everything correctly.
    Your perl is broken/incomplete. It would generate makefile.conf that is found missing one step later.
    If you have some strawbery or activestate windows perl installed and working - try to make it appear before mingw/cygwin perl in path

  4. brada4 commented on Jan 29, 2019

    @brada4
    Contributor

    The essence of problem is tat perl.exe invoked from make.exe finds different versions of core perl modules because of PERL5LIB vatiable pointing to other perl installation and justly rejects to load those.

  5. thedude2019 commented on Jan 29, 2019

    @thedude2019
    Author

    What is the easiest way to resolve this issue? don't understand what you mean when you say "try to make it appear before mingw/cygwin perl in path".

  6. thedude2019 commented on Jan 29, 2019

    @thedude2019
    Author

    This is my PATH (printed with cmd):
    PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32 \WindowsPowerShell\v1.0;C:\Program Files\Microsoft Windows Performance Toolkit\ ;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\Program Files (x86)\Calibre2;C: \Program Files (x86)\Notepad++;C:\Windows\System32\WindowsPowerShell\v1.0;C:\W indows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporatio n\PhysX\Common;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\mingw-w64 \x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\Windows\System32\WindowsPowerS hell\v1.0;C:\msys\1.0\bin;C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_ v6-rev0\mingw64\bin;C:\msys\1.0\bin

    C:\msys\1.0\bin and C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_ v6-rev0\mingw64\bin appear twice...C:\Windows\System32\WindowsPowerShell\v1.0 appears three times...

  7. brada4 commented on Jan 30, 2019

    @brada4
    Contributor

    What is inside PERL5LIB variable?
    @martin-frbg what do you think about reverting partially d1c6469#diff-7cf3cca9d0a67dfeb94e7187f4adba11R4 and permitting script to work with typical broken PERL installations?

  8. brada4 commented on Jan 30, 2019

    @brada4
    Contributor

    What was done for sf.net libraries:
    make HOSTCC=gcc CC=x86_64-w64-mingw32-gcc FC=x86_64-w64-mingw32-gfortran DYNAMIC_ARCH=1 NUM_THREADS=64
    Inside Linux virtual machine
    Fedora 28/29 or Ubuntu 18.04 will provide these compilers with AVX512 support.
    You will need few redist DLLs copied off the building Linux installation
    Shortcoming is that DLL will use GOMP provided on that Linux and it will certainly fail to work with very different gcc native to windows.

  9. martin-frbg commented on Jan 30, 2019

    @martin-frbg
    Collaborator

    @brada4 reverting that is not so easy now that the temporary file is also needed on x86_64 (AVX512 compatibility test). I will check later if conditional loading is possible (tried it once and did not get it to work, but my perl is a bit rusty), but I suspect File::Basename (used in the cross-compile check) will be equally problematic when PERL5LIB points to a conflicting or incomplete module collection.

  10. brada4 commented on Jan 30, 2019

    @brada4
    Contributor

    @martin-frbg I know it. Though no idea how to detect problem "safely"

  11. thedude2019 commented on Jan 30, 2019

    @thedude2019
    Author

    What is the MSYS command to print the PERL5LIB variable? this is my perl include path:

    $ perl -e "print qq(@inc)"
    /usr/lib/perl5/5.6.1/msys /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/ms
    ys /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl .

    Thank you!

  12. thedude2019 commented on Jan 30, 2019

    @thedude2019
    Author

    If I clear the user PATH variable and put C:\msys\1.0\bin before C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_ v6-rev0\mingw64\bin in Path system variable I get the same error...my Path system variable is now:

    PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\msys\1.0\bin;C:
    Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft Windows Perf
    ormance Toolkit;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\Program Files (x
    86)\Calibre2;C:\Program Files (x86)\Notepad++;C:\Program Files (x86)\NVIDIA Co
    rporation\PhysX\Common;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\m
    ingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;

  13. martin-frbg commented on Jan 30, 2019

    @martin-frbg
    Collaborator
    1. What does perl -v return - is it 5.6.1 ? (I think we also saw a few cases where PERL5DIR was set correctly for the perl version in the PATH, but the File::Temp module (File/Temp.pm) was not installed).

    2. Can you try with the attached version of the c_check script (needs renaming back to c_check without the .txt ending - github will not let me attach it unless it is named .txt)
      c_check.txt

  14. thedude2019 commented on Jan 30, 2019

    @thedude2019
    Author
    1. this is the output of perl -v :
      $ perl -v

    This is perl, v5.6.1 built for msys

    Copyright 1987-2001, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using man perl' or perldoc perl'. If you have access to the
    Internet, point your browser at http://www.perl.com/, the Perl Home Page.

    1. I renamed the file to c_check, put in on the desktop, moved to desktop with cd /c/Users/Zev/Desktop and this is the output:
      $ c_check
      C Compiler () is something wrong.
      1 at ./c_check line 29.

    Thank you!

  15. martin-frbg commented on Jan 30, 2019

    @martin-frbg
    Collaborator

    Sorry, I guess I should have been more verbose - the idea with the c_check file is to replace the c_check file in the OpenBLAS folder with it and retry the build. (c_check is called by one of the Makefiles and expects a number of arguments, including the name of the C compiler, so running it on its own is not really expected to work)
    What I did in the new file is try to work around any problems with wrong or unavailable perl modules)

  16. 33 remaining items

  17. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    After I renamed openblas_config_template.h to openblas_config.h (it also compiles after renaming config.h to openblas_config.h) it compiles without errors with the files you mentioned. I also had to add cblas_mangling.h to the include folder as mentioned previously.

    Which file should I rename to openblas_config.h, openblas_config_template.h or config.h?

    Thank you!

  18. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    Normally that would happen in the install step. openblas_config.h combines both config.h and openblas_config_template.h (with a version string added and a header guard against double inclusion around it, i.e.

    #ifndef OPENBLAS_CONFIG_H
    #define OPENBLAS_CONFIG_H
    #define OPENBLAS_VERSION "OpenBLAS 0.3.5"
    <contents of config.h>
    <contents of openblas_config_template.h>
    #endif
    
  19. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    And the cblas_mangling.h is only required by the (unused) netlib version of cblas.h, not by the OpenBLAS cblas.h so you would not normally need to copy it to the include folder.

  20. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    I made a mistake...I can't compile with the package cblas.h, I can only compile with lapack-netlib cblas.h & cblas_mangling.h...the build does not generate openblas_config.h and if I paste config.h & openblas_config_template.h in one file and rename to openblas_config.h (and compile with package cblas.h) there is still a header error. Attached config.h & openblas_config_template.h build files.
    config.txt
    openblas_config_template.txt

    Thank you!

  21. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    Finished to compare LAPACKE_dsyev_2stage with the three builds:

    1. 592.8 s - OpenBLAS regular build (OpenBLAS 0.3.5).
    2. 590.3 s - OpenBLAS build with USE_OPENMP=1 (OpenBLAS 0.3.5).
    3. 1971.3 s - BLAS, LAPACK & LAPACKE (LAPACK 3.7.0).

    OpenBLAS is definitely faster...is it crucial to work with the package cblas.h? results with lapack-netlib cblas.h & cblas_mangling.h (without openblas_config.h) are very good.

  22. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    The only relevant difference in the OpenBLAS cblas.h is the addition of the prototypes for the openblas-specific utility functions like openblas_set_num_threads(), if you do not use them your current setup should be sufficient. (Not sure why copying the two files together to create openblas_config.h did not work for you though, perhaps you did not add the OPENBLAS_VERSION line ?)

  23. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    Can you send me the combined openblas_config.h file so I can test? this is what I put in the include folder:
    openblas_config.txt

    Thank you!

  24. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    Ah, I forgot that the constants from the initial config.h get "OPENBLAS_" prepended when copied to openblas_config.h
    openblas_config.txt

  25. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    I get the same error:
    In file included from C:...\z1.c:9:
    C:...\xianyi-OpenBLAS-eebc189\include/cblas.h:5:10: fatal error: common.h: No such file or directory
    #include "common.h"
    ^~~~~~~~~~
    compilation terminated.

  26. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    That should be openblas_config.h instead of common.h in the cblas.h (normally converted in the make install step).
    BTW the f77blas.h is generated from common_interface.h
    f77blas.txt

  27. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    Replaced f77blas.h and It gives the same error...

  28. martin-frbg commented on Feb 5, 2019

    @martin-frbg
    Collaborator

    Err, the f77blas.h was just mentioned in passing as it is the last of the header files that are normally generated rather than copied.
    You need to change the "common.h" in cblas.h to "openblas_config.h" to make the error go away.

  29. thedude2019 commented on Feb 5, 2019

    @thedude2019
    Author

    Compiles without errors with your openblas_config.txt & after changing "common.h" in cblas.h to "openblas_config.h" :)

    Thank you both for your help!!!

  30. brada4 commented on Feb 5, 2019

    @brada4
    Contributor

    I've dropped a line in general threading issue so that if there is a measurable improvement reached with _symv it can be verified in this context of deep lapack calls too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions