Setting up MAGMA on Windows

96 views
Skip to first unread message

justin greige (GreigeJ)

unread,
Jan 24, 2025, 3:13:13 PMJan 24
to MAGMA User
Hey all, I'm sure you have probably heard this question a lot but I am struggling to get MAGMA to build in Visual studio.

I have MKL downloaded through the Intel ONEAPI package, and I believe I have all the configurations in the CMAKE GUI correct (attached below) except for the BLA_VENDOR and maybe the LAPACK_LIBRARIES entries.

For the LAPACK_LIBRARIES entry I simply found all of the .lib files in the Winodws-ReadME file and put all those paths in:

C:\Program Files (x86)\Intel\oneAPI\mkl\2025.0\lib\mkl_intel_lp64_dll.lib;C:\Program Files (x86)\Intel\oneAPI\mkl\2025.0\lib\mkl_intel_thread_dll.lib;C:\Program Files (x86)\Intel\oneAPI\mkl\2025.0\lib\mkl_core_dll.lib;C:\Program Files (x86)\Intel\oneAPI\2025.0\lib\libiomp5md.lib

Am I missing something here or is this correct?

As for the BLA_VENDOR entry I am at a bit of a loss, I looked at the findBLAS documentation and I do not not which variant of MKL that I am supposed to use. Also it says to include the source to the environment script, where do I find that? and where do I put that in the GUI? Does that go in the MKLROOT entry?

Finally, in Visual Studio, I am opening it through CMAKE and then building with the options set to Release and x64, is that correct? or Am I missing something there too?

Thanks for the help!
Justin
CMAKE_SC.PNG

justin greige (GreigeJ)

unread,
Jan 24, 2025, 3:34:25 PMJan 24
to MAGMA User, justin greige
  Wanted to add that I have set the BLA_VENDOR to intel10_64ilp since I will be working with large amounts of data, I have also set the MLK_ROOT to "C:\Program Files (x86)\Intel\oneAPI\mkl" but I am not sure if I should go a folder up since I know one of the files I call in the LAPACK_LIBRARIES is a folder up, I also noticed that some of the folders I call in that same libraries entry can be found in "C:\Program Files (x86)\Intel\oneAPI\2025.0\lib" as well as in "C:\Program Files (x86)\Intel\oneAPI\mkl\2025.0\lib" so I am not sure which one to pick.

Reply when you get the chance,
Cheers
CMAKE_SC2.PNG

AndrewC

unread,
Jan 24, 2025, 4:10:58 PMJan 24
to MAGMA User, julietg...@gmail.com
First thing you need to do is set BUILD_SHARED_LIBS "OFF".
MAGMA does not have the proper dllexport/dllimport for Windows so you have to build static libraries.
MKLROOT should be 
C:\Program Files (x86)\Intel\oneAPI\mkl\latest
Try leaving BLA_VENDOR empty

Andrew Cunningham

unread,
Jan 24, 2025, 4:16:42 PMJan 24
to MAGMA User, julietg...@gmail.com
BTW, You don't need to set the LAPACK libraries if you get MKLROOT
correct. They will be found.
If you get it all correct, you can just open the project in VIsual
Studio and build.
> --
> You received this message because you are subscribed to the Google Groups "MAGMA User" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to magma-user+...@icl.utk.edu.
> To view this discussion visit https://groups.google.com/a/icl.utk.edu/d/msgid/magma-user/6fa96064-9186-47ae-a173-10a5e575392an%40icl.utk.edu.

Andrew Cunningham

unread,
Jan 24, 2025, 4:20:36 PMJan 24
to MAGMA User, julietg...@gmail.com
And another quirk, Visual Studio 2022 C++ CL compiler does not support
OpenMP>2, so some examples fail to compile. Using the Intel C++
Compiler or clang instead solves those problems. In any event you need
the Intel Fortran Compiler for Fortran interfaces.

justin greige (GreigeJ)

unread,
Jan 24, 2025, 5:41:09 PMJan 24
to MAGMA User, AndrewC, justin greige
Thanks for the response!

I will make those changes and keep you posted,

and that's good to know, I am creating some new modules for/updating a program for our lab so I don't see myself needing to use Fortran in the near future

Cheers

justin greige (GreigeJ)

unread,
Jan 24, 2025, 6:04:43 PMJan 24
to MAGMA User, justin greige, AndrewC
Update,

Still says that the build failed with "Build: 4 succeeded, 632 failed, 0 up-to-date, 5 skipped" in the build console

I have noticed that the files lapacktest.lib, magma_sparse.lib, and tester.lib are in the build\lib\Release folder but there is nothing in the build\testing\Release folder.

I am assuming that's still not good, Is there any specific error I should be looking for in the console that might help you weed out the issue?

Cheers

AndrewC

unread,
Jan 27, 2025, 10:40:00 AMJan 27
to MAGMA User, julietg...@gmail.com

In Visual Studio just go to the "error list" tab and look at the first error and paste that here.
You also get all the build output  including errors in the Output window. Just go to the top and look at the first error.
I assume you installed the latest CUDA toolkit for Windows of course.

justin greige

unread,
Jan 27, 2025, 10:40:22 AMJan 27
to Andrew Cunningham, MAGMA User
Sorry Another thing I noticed is in the CMAKE_INSTALL_PREFIX entry, it calls the folder "C:/Program Files (x86)/MAGMA" but that does not exist.

I am missing some files?

On Sun, Jan 26, 2025 at 1:22 PM justin greige <julietg...@gmail.com> wrote:
Thanks for all the help,

I have removed Cuda12.6 and installed cuda12.8. Weird that the website took me to 12.6 over 12.8 in the first place,

For the second part, is the openmp directives simply these lines in the CMAKELists.txt file?

# ----------------------------------------
# locate OpenMP
find_package( OpenMP )
if (OPENMP_FOUND)
    message( STATUS "Found OpenMP" )
    message( STATUS "    OpenMP_C_FLAGS   ${OpenMP_C_FLAGS}" )
    message( STATUS "    OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}" )
    set( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
endif()

Also do I need to specify the intel C/C++ compiler? I included these in the CMAKE GUI

CMAKE_SC3.PNG

Cheers

On Sat, Jan 25, 2025 at 7:03 PM Andrew Cunningham <ad...@a-cunningham.com> wrote:
  • "first from the build output it seems like there are some missing parenthesis in some of the files"
    • Remove all your existing CUDA installs and upgrade to CUDA 12.8 ( the latest)
  • max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
    • This is the problem as the Microsoft CL compiler only supports openmp 2.0
    • You can fix them manually by commenting out the openmp directives.
    • Or reconfiguring with CMake from scratch to use the Intel C++ Compiler.


I just went through the whole process from beginning to end and I was able to build everything ( except for the openmp issue which required manual commenting of the #pragma)
Note that the LAPACK_LIBRARIES was filled by CMake 

PastedGraphic-1.tiff

Microsoft Visual Studio Professional 2022 (64-bit)  Version 17.12.3


On Jan 25, 2025, at 8:22 AM, justin greige (GreigeJ) <julietg...@gmail.com> wrote:

Looking at the errors,

first from the build output it seems like there are some missing parenthesis in some of the files

"1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : expected an identifier
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"

as well as some errors like this

"1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : attribute "__host__" does not apply here
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : memory qualifier on data member is not allowed
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"

In the error list there errors show up multiple times

"Error MSB6006 "link.exe" exited with code 1181" 3 instances
"Error C7660 'max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
"Error LNK1181 cannot open input file 'lib\Release\magma.lib'" the other 610 instances

Yes I have CUDA 12.6 installed, CMAKE 3.24.1, and OneAPI 2025
Although I have noticed that I also had CUDA 11.2 installed

I am cleaning that up and trying again

Cheers

justin greige (GreigeJ)

unread,
Jan 27, 2025, 10:40:22 AMJan 27
to MAGMA User, justin greige, AndrewC
Looking at the errors,

first from the build output it seems like there are some missing parenthesis in some of the files

"1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : expected an identifier
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"

as well as some errors like this

"1>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : attribute "__host__" does not apply here
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include\cuda/std/detail/libcxx/include/limits(155): error : memory qualifier on data member is not allowed
1>    __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"

In the error list there errors show up multiple times

"Error MSB6006 "link.exe" exited with code 1181" 3 instances
"Error C7660 'max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
"Error LNK1181 cannot open input file 'lib\Release\magma.lib'" the other 610 instances

Yes I have CUDA 12.6 installed, CMAKE 3.24.1, and OneAPI 2025
Although I have noticed that I also had CUDA 11.2 installed

I am cleaning that up and trying again

Cheers

Andrew Cunningham

unread,
Jan 27, 2025, 10:40:22 AMJan 27
to justin greige, MAGMA User
- CMAKE_INSTALL_PREFIX is just where the MAGMA files ( headers/libraries etc)  will be placed when you build the “INSTALL” project, it can be anywhere and it will be created if needed
- The problem with C:/Program Files (x86)/MAGMA as the “INSTALL” area is that these days, that “Program Files” area is protected and read-only except to admin on most Windows 11 machines so the INSTALL step will fail.
- So I just put it somewhere else.
- Do not fiddle with OpenMP in the CMAKELists.txt file
-If you use Intel C++ you should have no problems with OpenMP directives (but there might be some other issues)
-If you use Microsoft CL then you need to comment out a few openmp directives that occur in some of the “testing” C++ files
For example in D:\dev\magma-2.8.0\testing\testing_sgeqrf_batched.cpp

                // #pragma omp parallel for reduction(max:magma_error,magma_error2)




On Jan 26, 2025, at 10:17 AM, justin greige <julietg...@gmail.com> wrote:

Sorry Another thing I noticed is in the CMAKE_INSTALL_PREFIX entry, it calls the folder "C:/Program Files (x86)/MAGMA" but that does not exist.

I am missing some files?

On Sun, Jan 26, 2025 at 1:22 PM justin greige <julietg...@gmail.com> wrote:
Thanks for all the help,

I have removed Cuda12.6 and installed cuda12.8. Weird that the website took me to 12.6 over 12.8 in the first place,

For the second part, is the openmp directives simply these lines in the CMAKELists.txt file?

# ----------------------------------------
# locate OpenMP
find_package( OpenMP )
if (OPENMP_FOUND)
    message( STATUS "Found OpenMP" )
    message( STATUS "    OpenMP_C_FLAGS   ${OpenMP_C_FLAGS}" )
    message( STATUS "    OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}" )
    set( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
endif()

Also do I need to specify the intel C/C++ compiler? I included these in the CMAKE GUI

<CMAKE_SC3.PNG>

Cheers

On Sat, Jan 25, 2025 at 7:03 PM Andrew Cunningham <ad...@a-cunningham.com> wrote:
  • "first from the build output it seems like there are some missing parenthesis in some of the files"
    • Remove all your existing CUDA installs and upgrade to CUDA 12.8 ( the latest)
  • max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
    • This is the problem as the Microsoft CL compiler only supports openmp 2.0
    • You can fix them manually by commenting out the openmp directives.
    • Or reconfiguring with CMake from scratch to use the Intel C++ Compiler.


I just went through the whole process from beginning to end and I was able to build everything ( except for the openmp issue which required manual commenting of the #pragma)
Note that the LAPACK_LIBRARIES was filled by CMake 

justin greige

unread,
Jan 27, 2025, 10:40:22 AMJan 27
to Andrew Cunningham, MAGMA User
Thanks for all the help,

I have removed Cuda12.6 and installed cuda12.8. Weird that the website took me to 12.6 over 12.8 in the first place,

For the second part, is the openmp directives simply these lines in the CMAKELists.txt file?

# ----------------------------------------
# locate OpenMP
find_package( OpenMP )
if (OPENMP_FOUND)
    message( STATUS "Found OpenMP" )
    message( STATUS "    OpenMP_C_FLAGS   ${OpenMP_C_FLAGS}" )
    message( STATUS "    OpenMP_CXX_FLAGS ${OpenMP_CXX_FLAGS}" )
    set( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
endif()

Also do I need to specify the intel C/C++ compiler? I included these in the CMAKE GUI

CMAKE_SC3.PNG

Cheers

On Sat, Jan 25, 2025 at 7:03 PM Andrew Cunningham <ad...@a-cunningham.com> wrote:
  • "first from the build output it seems like there are some missing parenthesis in some of the files"
    • Remove all your existing CUDA installs and upgrade to CUDA 12.8 ( the latest)
  • max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
    • This is the problem as the Microsoft CL compiler only supports openmp 2.0
    • You can fix them manually by commenting out the openmp directives.
    • Or reconfiguring with CMake from scratch to use the Intel C++ Compiler.


I just went through the whole process from beginning to end and I was able to build everything ( except for the openmp issue which required manual commenting of the #pragma)
Note that the LAPACK_LIBRARIES was filled by CMake 

PastedGraphic-1.tiff

Microsoft Visual Studio Professional 2022 (64-bit)  Version 17.12.3

On Jan 25, 2025, at 8:22 AM, justin greige (GreigeJ) <julietg...@gmail.com> wrote:

justin greige

unread,
Jan 27, 2025, 10:40:30 AMJan 27
to Andrew Cunningham, MAGMA User

Andrew Cunningham

unread,
Jan 27, 2025, 10:40:33 AMJan 27
to justin greige (GreigeJ), MAGMA User
  • "first from the build output it seems like there are some missing parenthesis in some of the files"
    • Remove all your existing CUDA installs and upgrade to CUDA 12.8 ( the latest)
  • max': requires '-openmp:llvm' command line option(s)" like 10 or 20 instances
    • This is the problem as the Microsoft CL compiler only supports openmp 2.0
    • You can fix them manually by commenting out the openmp directives.
    • Or reconfiguring with CMake from scratch to use the Intel C++ Compiler.


I just went through the whole process from beginning to end and I was able to build everything ( except for the openmp issue which required manual commenting of the #pragma)
Note that the LAPACK_LIBRARIES was filled by CMake 

PastedGraphic-1.tiff

Microsoft Visual Studio Professional 2022 (64-bit)  Version 17.12.3

On Jan 25, 2025, at 8:22 AM, justin greige (GreigeJ) <julietg...@gmail.com> wrote:

justin greige

unread,
Jan 27, 2025, 11:27:34 AMJan 27
to Andrew Cunningham, MAGMA User
One other thing,

When I go to comment out the openmp directives, is it all directives that have the "#pragma omp parallel for reduction" or all lines that have or call "omp"?

Andrew Cunningham

unread,
Jan 27, 2025, 11:27:39 AMJan 27
to justin greige, MAGMA User
Hi Justin,
- The location of the “Install”. It is irrelevant to the build. That location is only used by the INSTALL step ( or project) that you run manually when you have a successful build of MAGMA

- The CMake errors in “red” are nothing to be concerned about. I get them and they have NO effect on the build.

- Something is wrong with your Intel MKL installation. CMake should find MKL ( and the BLAS and LAPACK) automatically and set up MKLROOT correctly. That needs to work before you try anything else. Download and install the latest MKL




-Do not try to use the Intel Compiler for MAGMA. I tried using Intel C++ Compiler 2025 and found an incompatibility when building MAGMA because of some of the headers it installed.
-You will need to manually comment the openmp #pragma lines that are incompatible with Microsoft CL. They are only in some of the testing_ files and not relevant to building the MAGMA libraries.


Andrew

Mark Gates

unread,
Jan 27, 2025, 11:32:37 AMJan 27
to Andrew Cunningham, justin greige, MAGMA User
I have no recent experience compiling MAGMA on Windows, but did notice that VS can use other compilers to get a more up-to-date OpenMP implementation, e.g., using clang.

Mark

justin greige

unread,
Jan 29, 2025, 10:27:13 AMJan 29
to Andrew Cunningham, Mark Gates, MAGMA User
Let's save clang for the last result option then😂

On Mon, Jan 27, 2025, 1:19 p.m. Andrew Cunningham <ad...@a-cunningham.com> wrote:
Absolutely using clang-cl is a solution, but I wanted to keep things simple.

Andrew Cunningham

unread,
Jan 29, 2025, 10:27:42 AMJan 29
to justin greige, Mark Gates, MAGMA User
Attempting to use ClangCL as the “Toolset” fails the configure step with some nvcc error.
I am not saying it is not possible to use clang-cl to build MAGMA enabled projects, I just mean trying to build the complete library with clang-cl fails at the Cmake configure stage.

Honestly, it’s much simpler to stick to the standard Microsoft compiler. That’s what everyone uses by default and what CUDA is tested with.

If the MAGMA team felt up to it they could surround the problematic OpenMP code with something like

#if _OPENMP >=200805 // version 3.1

                   #pragma omp parallel for reduction(max:error)
#endif

justin greige

unread,
Jan 29, 2025, 10:27:54 AMJan 29
to Andrew Cunningham, MAGMA User
Hey so unfortunately still no luck,

CMAKE has been set up exactly as you stated, the only thing of concern there is not auto detecting the libraries in the lapack libraries field.

my cuda version is V12.8.61
I uninstalled everything from OneAPI and installed only MKL from the link you shared

It did get further in the installation process this time, the errors of note are:

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include\cuda/std/detail/libcxx/include/limits(151): error : expected an identifier
1>      inline __declspec(__host__) __declspec(__device__) static constexpr type (() < () ? () : ()) noexcept"

errors along the line of this pop up a lot which I thought would have been fixed by using the newest version of CUDA, and causes multiple attempts of "magma.vcxproj" to fail to build

"Error LNK1104 cannot open file 'lib\Debug\magma.lib'"

magma.lib was never created in the lib\Debug folder. That seems to be causing everything else to not build

I also have not bothered commenting out the openmp directives atm, there are a lot of files to look at and if it's not a necessity I can live with those errors

Getting closer at least

Cheers

Andrew Cunningham

unread,
Jan 29, 2025, 10:28:03 AMJan 29
to justin greige, User MAGMA

Did you quit and restart cmake-gui after installing MKL.

Manually set the MKLROOT variable as an environment variable then quit cmake and rerun

MKLROOT=C:\Program Files (x86)\Intel\oneAPI\mkl\latest

Have you updated visual studio 2022 to the latest version? Your compilers seem out of date.

ME
The C compiler identification is MSVC 19.42.34435.0
The CXX compiler identification is MSVC 19.42.34435.0

YOU

The C compiler identification is MSVC 19.36.32535.0

The CXX compiler identification is MSVC 19.36.32535.0




On Jan 28, 2025, at 6:41 AM, justin greige <julietg...@gmail.com> wrote:



justin greige

unread,
Jan 29, 2025, 10:28:12 AMJan 29
to Andrew Cunningham, User MAGMA
Yes, I restarted my computer after MKL and updating Visual Studio.

After setting MKLROOT as an environment variable, CMAKE now finds everything automatically

C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_intel_lp64_dll.lib;C:/Program Files/LLVM/lib/libiomp5md.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_intel_thread_dll.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_core_dll.lib

For the libiomp5md library, should it be getting it from LLVM?

I am preemptively installed the newest version

Also for reference I am using WIndows 10

justin greige

unread,
Jan 29, 2025, 10:28:21 AMJan 29
to Andrew Cunningham, User MAGMA
After updating LLVM now CMAKE is finding  libiomp5md under C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/libiomp5md.lib;

going to try building again

Andrew Cunningham

unread,
Jan 29, 2025, 10:28:29 AMJan 29
to justin greige, User MAGMA
That’s all good, don’t worry about libomp5md.lib.. that is required by MKL and is the Intel openMP library.
As a minor side note, I am surprised the intel MKL installer did not set MKLROOT, it used to. Maybe they changed things.

Not sure what you mean by “updating LLVM”.
As I said, stick to using the default toolset which is the Microsoft compiler.


On Jan 29, 2025, at 5:58 AM, justin greige <julietg...@gmail.com> wrote:



Andrew Cunningham

unread,
Jan 29, 2025, 10:28:35 AMJan 29
to justin greige, MAGMA User
Just to reiterate, with the following setup
- Windows 11 
- Visual Studio 2022 ( latest)
- CUDA 12.8 installed
- Intel MKL 2025 (latest) installed.

I open the CMake-GUI, select the MAGMA folder
- Configure
- Uncheck “USE_FORTRAN”
- Configure
- Uncheck BUILD_SHARED_LIBS
- Optionally set CMAKE_INSTALL_PREFIX
- Configure
- Generate
- Open project, Build 

The core MAGMA libraries build, but I get some errors in a number of testing_xxxx.cpp files due to #pragma omp directives not supported by Microsoft CL.  These can be manually commented out as needed. To be more precise, they could be surrounded by #ifdef using the openmp version.








On Jan 27, 2025, at 8:26 AM, Andrew Cunningham <ad...@a-cunningham.com> wrote:

Hi Justin,
- The location of the “Install”. It is irrelevant to the build. That location is only used by the INSTALL step ( or project) that you run manually when you have a successful build of MAGMA

- The CMake errors in “red” are nothing to be concerned about. I get them and they have NO effect on the build.

- Something is wrong with your Intel MKL installation. CMake should find MKL ( and the BLAS and LAPACK) automatically and set up MKLROOT correctly. That needs to work before you try anything else. Download and install the latest MKL

Andrew Cunningham

unread,
Jan 29, 2025, 10:28:40 AMJan 29
to Mark Gates, justin greige, MAGMA User
Absolutely using clang-cl is a solution, but I wanted to keep things simple.
On Jan 27, 2025, at 8:32 AM, Mark Gates <mga...@icl.utk.edu> wrote:

justin greige

unread,
Jan 29, 2025, 10:28:51 AMJan 29
to Mark Gates, Andrew Cunningham, MAGMA User
Thanks Mark! I will check this out as well

Cheers

Andrew Cunningham

unread,
Jan 30, 2025, 12:00:55 PMJan 30
to justin greige, MAGMA User
OK, problems with build is resolved, have a look at 





The fix is that you have to modify 4 files. You apply the identical changes to 4 files at line #13 on.

magma-2.8.0\magmablas\cgbtf2_kernels.cu
magma-2.8.0\magmablas\sgbtf2_kernels.cu
magma-2.8.0\magmablas\dgbtf2_kernels.cu
magma-2.8.0\magmablas\zgbtf2_kernels.cu


#include "magma_internal.h"
#if   defined(MAGMA_HAVE_CUDA)
#if CUDA_VERSION >= 12060
#undef max
#undef min
#endif
#include <cooperative_groups.h>






On Jan 29, 2025, at 9:59 AM, justin greige <julietg...@gmail.com> wrote:

Very much appreciated!

OK that's good to know, truth be told I was losing my mind a bit here.

I'm in no real rush so take your time

Thanks again

On Wed, Jan 29, 2025 at 12:52 PM Andrew Cunningham <ad...@a-cunningham.com> wrote:
Hi Justin,
OK, I know what the issue is. The MAGMA source has a VERY,VERY unfortunate use of a min/max C++ macro (macros are evil, as they say) that breaks the compilation when used with newer versions of CUDA headers. This causes the "expected _ expression” error.

I dealt with the same issue months ago and basically have had a brain fart and forgot I had hacked the source locally to fix it. Sorry about that!

So, I will get back to you later. Probably the best thing is for me to send you a .zip of “my” version of the MAGMA source which I know works.

Then I will go back and check if I submitted a bug report to the MAGMA team.



Andrew


On Jan 29, 2025, at 7:45 AM, justin greige <julietg...@gmail.com> wrote:

To clarify, I had LLVM 10.whatever and downloaded 18.8, but like you said that does not matter, it was just weird that it popped up in the lapack libraries

as for libomp5md.lib, that was a result of me messing around with paths in MKLROOT, i have set it back to just be C:/Program Files (x86)/Intel/oneAPI/mkl/latest.

At this point I am at a loss as to what I am missing

I have CUDA 12.8
MKL 2025.0.1
CMAKE 3.24.1
Latest VS 
"The C compiler identification is MSVC 19.42.34435.0
The CXX compiler identification is MSVC 19.42.34435.0"

I am still getting the same "expected _ expression" from 1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include\cuda/std/detail/libcxx/include/limits

and the cannot open file 'lib\Debug\magma.lib' error.

When is that file supposed to be created in the build process?

<CMAKE_SC4.PNG>

Also just to cover all my bases, are these all correct in the VS project properties?

<VS_settings.PNG>

Is there anything else that I am supposed to have installed prior to attempting to build this that I am missing?

Cheers

justin greige

unread,
Jan 30, 2025, 12:00:59 PMJan 30
to Andrew Cunningham, MAGMA User
It worked!

with the couple of testing files that I know would not build I just want to confirm that "Build: 624 succeeded, 12 failed, 0 up-to-date, 5 skipped" is expected

Also for peace of mind these are all the files I would expect in the build/lib/debug folder

lib_direct.PNG

Thanks again for all the help!

Andrew Cunningham

unread,
Jan 31, 2025, 12:09:54 PMJan 31
to justin greige, MAGMA User
Hi Justin,
If you download and build the just released MAGMA 2.9.0 the fixes to the .cu files are already applied. I would guess you will still get the 12 failures in the testing_xxx files due to the OpenMP version issues  when using Microsoft CL compiler.

Andrew

On Jan 30, 2025, at 6:52 AM, justin greige <julietg...@gmail.com> wrote:

It worked!

with the couple of testing files that I know would not build I just want to confirm that "Build: 624 succeeded, 12 failed, 0 up-to-date, 5 skipped" is expected

Also for peace of mind these are all the files I would expect in the build/lib/debug folder

<lib_direct.PNG>

Thanks again for all the help!
On Wed, Jan 29, 2025 at 2:45 PM Andrew Cunningham <ad...@a-cunningham.com> wrote:
OK, problems with build is resolved, have a look at 

justin greige

unread,
Jan 31, 2025, 12:09:58 PMJan 31
to Andrew Cunningham, MAGMA User
Nice! I will download and build the new magma version

Quick question about compiling the example_v2.cpp code, I am setting up a tasks.json file in VScode and was wondering if I need to include the Openblas library?
'-L$OPENBLASDIR/lib -lopenblas \" from example\README.txt

Cheers
Reply all
Reply to author
Forward
0 new messages