diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp
index 422dc193c370c7555b0f455af17d7542940b1340..1460ca4434dda0ebfb3197709a7110ec852371ae 100644
--- a/src/cluster/cluster.cpp
+++ b/src/cluster/cluster.cpp
@@ -149,6 +149,9 @@ void cluster(const string& config_file, const string& data_file, const string& o
     if (tppoan.is_open()) {
 #ifdef USE_LAPACK
       logger->log("INFO: using LAPACK calls.\n", LOG_INFO);
+#elif defined USE_MAGMA
+      logger->log("INFO: using MAGMA calls.\n", LOG_INFO);
+      magma_init();
 #else
       logger->log("INFO: using fall-back lucin() calls.\n", LOG_INFO);
 #endif
@@ -280,9 +283,12 @@ void cluster(const string& config_file, const string& data_file, const string& o
 #endif
       tppoanp->close();
       delete tppoanp;
+#ifdef USE_MAGMA
+      magma_finalize();
+#endif
     } else { // In case TPPOAN could not be opened. Should never happen.
       logger->err("\nERROR: failed to open TPPOAN file.\n");
-    }
+    } // closes if (tppoan.is_open) ... else ...
     fclose(output);
     // Clean memory
     delete cid;