Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build openblas with CMAKE GUI and MSVC 2019 #3977

Closed
jbensabat opened this issue Mar 29, 2023 · 13 comments
Closed

build openblas with CMAKE GUI and MSVC 2019 #3977

jbensabat opened this issue Mar 29, 2023 · 13 comments
Labels

Comments

@jbensabat
Copy link

Hello
I tried to build Openbals using CMAKE and MSVC for X64
The configuration with CMAKE goes fine but when I try to build the library I get a number of errors
(missing functions).
I know i can build the library under miniconda and CMAKE - i just wonder if someone has managed to build openblas under MSVC
best
jac

@martin-frbg
Copy link
Collaborator

#2825 may be related, but in any case a pure MSVC build will be inferior due to using generic, relatively poorly optimized C sources instead of the cpu-specific assembly routines available to other compilers

@jbensabat
Copy link
Author

Hi
I think that I managed to build openblas with MSVC
I want to run the test program utest but there is no documentation about the arguments that are to be fed (argc , argv)
could you provide an example just to see what I get when I run utest
best

jac

@martin-frbg
Copy link
Collaborator

openblas_utest is run without command line arguments, its output should look like

TEST 1/38 max:smax_zero [OK]
TEST 2/38 max:dmax_positive [OK]
...
TEST 37/38 fork:safety [OK]
TEST 38/38 fork:safety_after_fork_in_parent [OK]

not all these regression tests are executed in all configurations, so you will probably see a smaller total than 38, the important point is that what is there should not report anything other than "OK".

@jbensabat
Copy link
Author

hi
I just ran as you suggested and indeed there were 34 tests which all reported "OK". so i guess the lib is ready to use
thanks
jac

@martin-frbg
Copy link
Collaborator

Ok, there are some more in-depth BLAS tests in the test and ctest folders (the BLAS1 tests with "1" in their name need no arguments, the others require the correspondingly named (first character for input type, number for BLAS rank) input files to be fed as STDIN. (Note also that if you just built 0.3.22, it is now known to have a serious bug in LAPACK function GETF2)

@jbensabat
Copy link
Author

OK thanks

@jbensabat
Copy link
Author

Hi I checked th ctest directory
these projects (Example xccblat1) have mixed code (fortran and c) and they are not likely to compile as is
there is a need to compile c and fortran in different work-spaces.
best
jac

@martin-frbg
Copy link
Collaborator

Oh, right - lack of a Fortran compiler would be another argument against a pure MSVC build. (On the other hand, if you did not see C equivalents for the Fortran files there, chances are you are looking at an older release and thus not affected by the current problem(s?) with the latest. )

@jbensabat
Copy link
Author

hi
this is not what I meant. I have a fortran compiler. But under MSVC you can't not mix within the same workspace fortran and c code. you can compile fortran separately and c separately and they combine binaries.
in the ctest directory the project xccblat1 has two files:
c_cblas1.c and c_cblat1.f
the code in c_cblas1.c has interfaces for calling c functions from fortran.
the fortran code has a main program.
so it seems that ctest has fortran programs calling c routines
I have downloaded the last version of openblas (for sourceforge and github
best
jac

@martin-frbg
Copy link
Collaborator

In versions since 0.3.21, xccblat1 has an alternate source file c_cblat1c.c that replaces c_cblat1.f when building without a Fortran compiler, so at least in theory it should build.

@jbensabat
Copy link
Author

Hi
I have seen that
the c programs have been translated from fortran to c using f2c translator, which usually requires the f2c.lib file.
is it the case here too ?
best
jac

@jbensabat
Copy link
Author

with regard to ctest
I replaced the file c_cblat1.f with c_cblat1.c just to check
there are a number of missing functions for example ICAMAXTEST_ (both in the fortran and c versions)
I looked for a file containing such a function in the whole directory and I have not found it
best
jac

@martin-frbg
Copy link
Collaborator

The CMakeLists.txt there is supposed to do that automatically , or is this not picked up by the gui ? The ...TEST_ functions are mapped by the header file cblas_test.h to the corresponding F77_... functions that are defined in the (original) C files.
(And yes, the Fortran files were translated with f2c, but using a special header and wrapper script so that the usual f2c support library is not needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants