We expect that El Capitan users will maintain Makefiles and build systems for their applications. This page provides a simple makefile, such that loaded modules are not relied upon and users can achieve consistent build-time and run-time behavior. 

C++ AMD Clang Compiler with MPI Example

The following makefile relies on the rush_larsen_gpu_hip.cc file discussed in the C++ Code Examples.

SHELL = /bin/sh

.SUFFIXES: .cc .o

CXX = /usr/tce/packages/rocmcc/rocmcc-6.1.2-magic/bin/amdclang++
CPPFLAGS = -D__HIP_PLATFORM_AMD__ -I/opt/rocm-6.1.2/include
CXXFLAGS = -O3 --cuda-gpu-arch=gfx942 -std=c++11 --rocm-path=/opt/rocm-6.1.2 -x hip
HIPFLAGS = -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -fhip-new-launch-api --driver-mode=g++
LDFLAGS =
LDLIBS =

all: rush_larsen_gpu_hip

rush_larsen_gpu_hip: rush_larsen_gpu_hip.cc
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(HIPFLAGS) $+ $(LDFLAGS) $(LDLIBS) -o $@

check:
	./rush_larsen_gpu_hip 10 .01

clean:
	rm rush_larsen_gpu_hip

Fortran Cray Compiler with OpenMP and MPI Example

The following makefile relies on the rush_larsen_gpu_omp_mpi_fort.F90 file discussed in the Fortran Code Examples.

SHELL = /bin/sh

.SUFFIXES: .F90 .o

CPPFLAGS = -D__HIP_PLATFORM_AMD__ -I/opt/rocm-6.1.2/include
FC = /usr/tce/packages/cray-mpich/cray-mpich-8.1.30-cce-18.0.0-magic/bin/mpicrayftn
FCFLAGS = -O3 -g -fopenmp -haccel=amd_gfx942
LDFLAGS =
LDLIBS =

all: rush_larsen_gpu_omp_mpi_fort

rush_larsen_gpu_omp_mpi_fort: rush_larsen_gpu_omp_mpi_fort.F90
	$(FC) $(CPPFLAGS) $(FCFLAGS) $+ $(LDFLAGS) $(LDLIBS) -o $@

check:
	srun -n 2 ./rush_larsen_gpu_omp_mpi_fort 10 .01

clean:
	rm rush_larsen_gpu_omp_mpi_fort

Finding Compilers

The El Capitan systems support a number of compiler families. There are a few places where users can look to find compiler executables. It is recommended that users examine the module for a particular compiler that they would like to use with the command module show MODULE_NAME.