installation from source using Ubuntu 24 and gcc v. 14

21 views
Skip to first unread message

Thomas Kalscheuer

unread,
Jun 18, 2026, 3:10:27 PM (11 days ago) Jun 18
to MAGMA User
Hi,

I am trying to install magma from source on a workstation with an AMD GPU (gfx803), Ubuntu 24 and gcc v. 14. I believe to have made reasonable settings in make.inc trying to use a hip BACKEND with hip, rocm, hipcc all installed from the Ubuntu server.

When running make, I get the error:
hipcc -O3 -fPIC -fopenmp   -DNDEBUG -DADD_ -Wall -std=c++11 -D__HIP_PLATFORM_AMD__ -DHIPBLAS_V2 -I/usr/include -I./include -I./testing -I./control -c -o control/magma_threadsetting.o control/magma_threadsetting.cpp
control/magma_threadsetting.cpp:14:10: fatal error: 'omp.h' file not found
   14 | #include <omp.h>
      |          ^~~~~~~
1 error generated when compiling for host.

Since hipcc uses gcc v. 14, I thought it would be appropriate to provide omp.h as provided through gcc v. 14 which is in /usr/lib/gcc/x86_64-linux-gnu/14/include/. So, I changed line 92 in make.inc to
FOPENMP     = -fopenmp -I/usr/lib/gcc/x86_64-linux-gnu/14/include

However, when running make, this gives
hipcc -O3 -fPIC -fopenmp -I/usr/lib/gcc/x86_64-linux-gnu/14/include  -DNDEBUG -DADD_ -Wall -std=c++11 -D__HIP_PLATFORM_AMD__ -DHIPBLAS_V2 -I/usr/include -I./include -I./testing -I./control -c -o control/magma_threadsetting.o control/magma_threadsetting.cpp
In file included from control/magma_threadsetting.cpp:14:
/usr/lib/gcc/x86_64-linux-gnu/14/include/omp.h:341:45: error: '__malloc__' attribute takes no arguments
  341 |   __GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
      |                                             ^
/usr/lib/gcc/x86_64-linux-gnu/14/include/omp.h:346:45: error: '__malloc__' attribute takes no arguments
  346 |   __GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
      |                                             ^
/usr/lib/gcc/x86_64-linux-gnu/14/include/omp.h:350:45: error: '__malloc__' attribute takes no arguments
  350 |   __GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
      |                                             ^
/usr/lib/gcc/x86_64-linux-gnu/14/include/omp.h:355:45: error: '__malloc__' attribute takes no arguments
  355 |   __GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
      |                                             ^
/usr/lib/gcc/x86_64-linux-gnu/14/include/omp.h:360:33: error: '__malloc__' attribute takes no arguments
  360 |   __GOMP_NOTHROW __attribute__((__malloc__ (omp_free), __alloc_size__ (2)));
      |                                 ^
5 errors generated when compiling for host.
make: *** [Makefile:811: control/magma_threadsetting.o] Error 1

Do you have any suggestions for fixing this problem?

Best wishes,
Thomas


Natalie Beams

unread,
Jun 18, 2026, 3:21:35 PM (11 days ago) Jun 18
to MAGMA User, thomas.k...@gmx.net
Hi Thomas,

I see it's trying to compile magma_threadsetting.cpp with `hipcc` -- and I realize now that our make.inc examples for HIP (which are old) still set `CC` and `CXX` to `HIPCC` by default, 
which was from days way earlier in the AMD software stack, and should probably be updated. When I build MAGMA with HIP these days, I set CXX to be g++ rather than compiling everything with hipcc, 
for what that's worth.

I am a little confused by the statement "hipcc uses gcc v. 14". My understanding is that hipcc is just a wrapper which calls nvcc or clang. So maybe using hipcc will still work if you give it the location of the AMD compiler's omp.h.

--Natalie

Thomas Kalscheuer

unread,
Jun 22, 2026, 10:41:29 AM (7 days ago) Jun 22
to MAGMA User, Natalie Beams, Thomas Kalscheuer
Hi Natalie,

many thanks for your swift response!

I assumed that hipcc used gcc v.14 because the output of the command 
hipcc -v
is
Ubuntu clang version 17.0.6 (9ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found HIP installation: /usr, version 5.7.31921
clang++-17: warning: argument unused during compilation: '-O3' [-Wunused-command-line-argument]
clang++-17: warning: argument unused during compilation: '--rtlib=compiler-rt' [-Wunused-command-line-argument]
clang++-17: warning: argument unused during compilation: '-unwindlib=libgcc' [-Wunused-command-line-argument]

I just interpreted this as gcc v. 14 being used as the underlying compiler for clang. Sorry for the confusion, to me anything outside gfortran, g++ and gcc is new territory.

I followed your advice and set 
CC           = gcc
CXX          = g++
in make.inc. However, this leads to another (earlier?) error
g++ -O3 -fPIC -fopenmp -I/usr/lib/gcc/x86_64-linux-gnu/14/include  -DNDEBUG -DADD_ -Wall -std=c++11 -D__HIP_PLATFORM_AMD__ -DHIPBLAS_V2 -I/usr/include -I./include -I./testing -I./control -c -o src/shpotrf_gpu.o src/shpotrf_gpu.cpp
src/shpotrf_gpu.cpp: In function ‘magma_int_t magma_sgemm_fp16(magma_trans_t, magma_trans_t, magma_int_t, magma_int_t, magma_int_t, float, float*, magma_int_t, magmaHalf*, magma_int_t, float*, magma_int_t, magmaHalf*, magma_int_t, float, float*, magma_int_t, magma_queue_t)’:
src/shpotrf_gpu.cpp:61:28: error: ‘HIPBLAS_COMPUTE_32F’ was not declared in this scope; did you mean ‘HIPBLAS_C_32F’?
   61 |                            HIPBLAS_COMPUTE_32F, HIPBLAS_GEMM_DEFAULT);
      |                            ^~~~~~~~~~~~~~~~~~~
      |                            HIPBLAS_C_32F
make: *** [Makefile:811: src/shpotrf_gpu.o] Error 1

Any advice is appreciated.

Best wishes,
Thomas

Natalie Beams

unread,
Jun 22, 2026, 11:15:00 AM (7 days ago) Jun 22
to MAGMA User, thomas.k...@gmx.net, Natalie Beams
Hi Thomas,

Which version of ROCm are you using? It looks like that error is related to changes from this PR: https://github.com/icl-utk-edu/magma/pull/65 ?

I was just building with ROCm 7.0.1 and didn't get an error when building that file.


--Natalie

Reply all
Reply to author
Forward
0 new messages