I have an R package with Fortran and OpenMP than can't pass CRAN. I receive the following message:
Your package no longer installs on macOS with OpenMP issues.
My Makevars file is:
USE_FC_TO_LINK =
PKG_FFLAGS = $(SHLIB_OPENMP_FFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_FFLAGS)
C_OBJS = init.o
FT_OBJS = e_bottomup.o e_topdown.o check_nt.o
all:
@$(MAKE) $(SHLIB)
@rm -f *.o
$(SHLIB): $(FT_OBJS) $(C_OBJS)
init.o: e_bottomup.o e_topdown.o check_nt.o
How to solve this issue? Thanks.
Edit 1:
I tried adding the flag cpp:
USE_FC_TO_LINK =
PKG_FFLAGS = $(SHLIB_OPENMP_FFLAGS) *-cpp*
PKG_LIBS = $(SHLIB_OPENMP_FFLAGS)
to add the condition #ifdef _OPENMP on Fortran code before !omp...
But with R CMD Check I got the message:
Non-portable flags in variable 'PKG_FFLAGS': -cpp
init.o: e_bottomup.o e_topdown.o check_nt.o
doesn’t make sense. An object file can’t have dependencies on other object files. – Clubfoot