** testing if installed package can be loaded from temporary location
9088Error: package or namespace load failed for ‘harmony’ in dyn.load(file, DLLpath = DLLpath, ...):
9089 unable to load shared object '/tmp/RtmpFJPXav/Rinst331e36a01374/00LOCK-harmony/00new/harmony/libs/harmony.so':
9090 /tmp/RtmpFJPXav/Rinst331e36a01374/00LOCK-harmony/00new/harmony/libs/harmony.so: undefined symbol: dgesv_
I already tried adding apt-get dependencies, but that didn't work.
The missing symbol dgesv_ is from BLAS/LAPACK. However, the additional dependencies cannot help since R already includes the necessary infrastructure to work with them, c.f. LAPACK_LIBS and BLAS_LIBS in https://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars. In harmony's master branch this is (sort of[1]) correct. However, in your ci branch you have removed the configure script without moving src/Makevars.in to src/Makevars. In effect, R tries to install your package without a Makevars file. Therefore LAPACK and BLAS are not present in PKG_LIBS, leading to the missing symbol. You have to decide whether you want a configure script to create src/Makevars from src/Makevars.in or use a handcrafted src/Makevars.
One further note: You might want to $(SHLIB_OPENMP_CXXFLAGS) to PKG_CXXFLAGS and PKG_LIBS, c.f. the skeleton Makevars.
[1] I find it strange that FLIBS is being overwritten. No idea why this should be necessary.
Change ~/.R/Makevars in such a way, that the standard $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) works on your machine. Hundreds of CRAN packages use these flags and they all compile on MacOS.