Skip to content

Commit

Permalink
[helas] in gg_tt.mad cudacpp.mk, go back to using gfortran instead of…
Browse files Browse the repository at this point in the history
… hipcc to link fcheck_hip.exe

Revert "[helas] in gg_tt.mad cudacpp.mk, temporarely go back and try to use hipcc instead of gfortran to link fcheck_hip.exe: this links but it fails at runtime, will revert"
This reverts commit 988419b.

NOTE: I tried to use FC=hipcc and this also compiles the fortran ok!
Probably it internally uses flang from llvm madgraph5#804

The problem however is that there is no lowercase 'main' in fcheck_sa_fortran.o, only an uppercase 'MAIN_'.

Summary of the status" HELINL=L "rdc" is not supported on our AMD GPUs for now.
  • Loading branch information
valassi committed Sep 21, 2024
1 parent e4d9206 commit 2fda261
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions epochX/cudacpp/gg_tt.mad/SubProcesses/cudacpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ else ifeq ($(BACKEND),hip)
GPUFLAGS = $(foreach opt, $(OPTFLAGS), $(XCOMPILERFLAG) $(opt))

# DEBUG FLAGS (for #806: see https://hackmd.io/@gmarkoma/lumi_finland)
GPUFLAGS += -ggdb # FOR DEBUGGING ONLY
###GPUFLAGS += -ggdb # FOR DEBUGGING ONLY

# AMD HIP architecture flags
GPUARCHFLAGS = --offload-arch=gfx90a
Expand Down Expand Up @@ -893,8 +893,7 @@ endif
$(gpu_fcheckmain): LIBFLAGS += $(GPULIBFLAGSRPATH) # avoid the need for LD_LIBRARY_PATH
$(gpu_fcheckmain): $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBDIR)/lib$(MG5AMC_GPULIB).so $(gpu_objects_exe)
ifneq ($(findstring hipcc,$(GPUCC)),) # link fortran/c++/hip using $FC when hipcc is used #802
# $(FC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe) -lstdc++ -L$(shell cd -L $(shell dirname $(shell $(GPUCC) -print-prog-name=clang))/../..; pwd)/lib -lamdhip64 # fails to link
$(GPUCC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe) -fgpu-rdc --hip-link # links but crashes
$(FC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe) -lstdc++ -L$(shell cd -L $(shell dirname $(shell $(GPUCC) -print-prog-name=clang))/../..; pwd)/lib -lamdhip64
else
$(GPUCC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe)
endif
Expand Down

0 comments on commit 2fda261

Please sign in to comment.