diff -urN OpenBLAS-0.2.20.orig/Makefile.system OpenBLAS-0.2.20/Makefile.system
--- OpenBLAS-0.2.20.orig/Makefile.system	2017-07-24 09:03:35.000000000 +0500
+++ OpenBLAS-0.2.20/Makefile.system	2018-03-01 12:25:04.997365800 +0500
@@ -650,7 +650,7 @@
 FCOMMON_OPT += -Wall
 #Don't include -lgfortran, when NO_LAPACK=1 or lsbcc
 ifneq ($(NO_LAPACK), 1)
-EXTRALIB += -lgfortran
+EXTRALIB += -lgfortran -lquadmath
 endif
 ifdef NO_BINARY_MODE
 ifeq ($(ARCH), $(filter $(ARCH),mips64))
diff -urN OpenBLAS-0.2.20.orig/cmake/fc.cmake OpenBLAS-0.2.20/cmake/fc.cmake
--- OpenBLAS-0.2.20.orig/cmake/fc.cmake	2017-07-24 09:03:35.000000000 +0500
+++ OpenBLAS-0.2.20/cmake/fc.cmake	2018-03-01 12:24:15.684865800 +0500
@@ -47,7 +47,7 @@
   set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
   #Don't include -lgfortran, when NO_LAPACK=1 or lsbcc
   if (NOT NO_LAPACK)
-    set(EXTRALIB "{EXTRALIB} -lgfortran")
+    set(EXTRALIB "{EXTRALIB} -lgfortran -lquadmath")
   endif ()
   if (NO_BINARY_MODE)
     if (${ARCH} STREQUAL "mips64")
