diff --git a/src/FiniteDifference/eq_unit_test_3d.hpp b/src/FiniteDifference/eq_unit_test_3d.hpp
index a8fbbc13e373a6f7497870f78cbee199df184298..579e10708d5e1442380475b4a884fd86d9173ef3 100644
--- a/src/FiniteDifference/eq_unit_test_3d.hpp
+++ b/src/FiniteDifference/eq_unit_test_3d.hpp
@@ -219,7 +219,9 @@ template<typename solver_type,typename lid_nn_3d> void lid_driven_cavity_3d()
 BOOST_AUTO_TEST_CASE(lid_driven_cavity)
 {
 	lid_driven_cavity_3d<umfpack_solver<double>,lid_nn_3d_eigen>();
+#ifdef HAVE_PETSC
 	lid_driven_cavity_3d<petsc_solver<double>,lid_nn_3d_petsc>();
+#endif
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/Matrix/SparseMatrix.hpp b/src/Matrix/SparseMatrix.hpp
index 28ff0ef1c08fced384ac918034e0d9fb90d24bf8..09d79567be8cd6ac293109faa45650e6a3d60af7 100644
--- a/src/Matrix/SparseMatrix.hpp
+++ b/src/Matrix/SparseMatrix.hpp
@@ -88,6 +88,7 @@ public:
 
 
 	SparseMatrix(size_t N1, size_t N2) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
+	SparseMatrix(size_t N1, size_t N2, size_t loc) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
 	SparseMatrix()	{std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
 	openfpm::vector<triplet_type> & getMatrixTriplets() {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return stub_vt;}
 	const int & getMat() const {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return stub_i;}
diff --git a/src/Matrix/SparseMatrix_unit_tests.hpp b/src/Matrix/SparseMatrix_unit_tests.hpp
index 039f3780ae9a0bb0fd060960fe70558282d666dc..5a65fa415ee61c44774465e071908ba8588a7cad 100644
--- a/src/Matrix/SparseMatrix_unit_tests.hpp
+++ b/src/Matrix/SparseMatrix_unit_tests.hpp
@@ -168,6 +168,8 @@ BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_parallel)
 	}
 }
 
+#ifdef HAVE_PETSC
+
 BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_petsc)
 {
 	Vcluster & vcl = create_vcluster();
@@ -412,6 +414,8 @@ BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_petsc_solve)
 	solver.solve(sm,v);
 }
 
+#endif
+
 BOOST_AUTO_TEST_SUITE_END()
 
 
diff --git a/src/Solvers/petsc_solver.hpp b/src/Solvers/petsc_solver.hpp
index 96ee9c7e1a41d0baba3687d330e34caadec13e54..04d0c91edd73fc918e2432b7da4abc4fa3f242ca 100644
--- a/src/Solvers/petsc_solver.hpp
+++ b/src/Solvers/petsc_solver.hpp
@@ -8,6 +8,8 @@
 #ifndef OPENFPM_NUMERICS_SRC_SOLVERS_PETSC_SOLVER_HPP_
 #define OPENFPM_NUMERICS_SRC_SOLVERS_PETSC_SOLVER_HPP_
 
+#ifdef HAVE_PETSC
+
 #include "Vector/Vector.hpp"
 #include "Eigen/UmfPackSupport"
 #include <Eigen/SparseLU>
@@ -891,5 +893,6 @@ public:
 	}
 };
 
+#endif
 
 #endif /* OPENFPM_NUMERICS_SRC_SOLVERS_PETSC_SOLVER_HPP_ */
diff --git a/src/Vector/Vector_unit_tests.hpp b/src/Vector/Vector_unit_tests.hpp
index f684aaadfc8d6ddff1741a58e2b8d2e4bb62f441..f2e44b9af97970bd11e85dfc520d1f94948e1928 100644
--- a/src/Vector/Vector_unit_tests.hpp
+++ b/src/Vector/Vector_unit_tests.hpp
@@ -129,6 +129,7 @@ BOOST_AUTO_TEST_CASE(vector_eigen_parallel)
 	}
 }
 
+#ifdef HAVE_PETSC
 
 BOOST_AUTO_TEST_CASE(vector_petsc_parallel)
 {
@@ -258,6 +259,8 @@ BOOST_AUTO_TEST_CASE(vector_petsc_parallel)
 
 }
 
+#endif
+
 BOOST_AUTO_TEST_SUITE_END()