CC       =  gcc
CXX      =  g++

MPICC    =  mpicc
MPIC++   =  mpic++

OPTIMIZE = -O3 -fopenmp -march=native -mavx -mavx2 
OMP_GPU = -mp=multicore,gpu -gpu=cuda12.0 -gpu=cc86

CUDA_INC = -I/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/cuda/12.0/include
CUDA_LIB = -L/opt/nvidia/hpc_sdk/Linux_x86_64/23.1/cuda/12.0/lib64

FFTW_INCL=
FFTW_LIB=


##########################################################
#NVIDIA CUFFTMP

CUFFTMP_LIB  = -L/.../lib64
CUFFTMP_INCL = -I/.../include/cufftmp
##########################################################


##########################################################
#NVIDIA NCCL REDUCE

NCCL_INC = -I/opt/nvidia/hpc_sdk/Linux_x86_64/23.3/comm_libs/nccl/include
NCCL_LIB = -L/opt/nvidia/hpc_sdk/Linux_x86_64/23.3/comm_libs/nccl/lib
##########################################################

NVC = /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/compilers/bin/nvc 
NVFLAGS = -O4 -fast -march=native $(OMP_GPU) -mavx -mavx2  
NVLIB = $(CUDA_INC) $(CUDA_LIB) -lcuda -lcudart


NVLIB_2 = $(CUDA_INC) $(CUDA_LIB) $(MPI_INC) $(MPI_LIB) $(CUFFT_INC) $(CUFFT_LIB) $(NVSHMEM_INC) $(NVSHMEM_LIB) -lnvshmem_host -lnvshmem_device -lcuda -lcudart -lcufftMp

NVLIB_3 = $(CUDA_INC) $(CUDA_LIB) $(MPI_INC) $(MPI_LIB) $(NCCL_INC) $(NCCL_LIB) -lcuda -lcudart -lnccl


NVCC = /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/cuda/12.0/bin/nvcc
OPT_NVCC   = -std=c++17 --generate-code arch=compute_86,code=sm_86 

CFLAGS +=

MPICHLIB =



##########################################################
#AMD GPUs (DEFAULT = LUMI)

CLANG   = clang
CLANG++ = clang++
 
OPTIMIZE_AMD = -O3 -Ofast -fopenmp -march=native -mavx -mavx2 -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx90a

RCCL_INCL= -I/opt/rocm-5.2.3/rccl/include
RCCL_LIB= -L/opt/rocm-5.2.3/rccl/lib

HIP_INCL= -I/opt/rocm-5.2.3/hip/include
HIP_LIB= -L/opt/rocm-5.2.3/hip/lib

AMDLIB = $(HIP_INCL) $(HIP_LIB) $(RCCL_INCL) $(RCCL_LIB) -lamdhip64 -lrccl
###########################################################

