diff --git a/src/CheckForPDF.cxx b/src/CheckForPDF.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..2ffdfc143f7e18529fc3d9adce4246bb7ac3f8f4
--- /dev/null
+++ b/src/CheckForPDF.cxx
@@ -0,0 +1,33 @@
+#include "CheckForPDF.h"
+
+using namespace std;
+
+void CheckForPDF(char *pdfname){
+  bool found= false;
+  string spdfname=string(pdfname);
+  spdfname.erase(std::remove_if(spdfname.begin(), spdfname.end(), ::isspace),spdfname.end());
+  for (const string& s : LHAPDF::availablePDFSets()){
+    if (s==spdfname) found=true;
+	    }
+  if (!found){
+    cout << "PDF: " << spdfname << " not found"<< endl;
+    cout << "List of available PDFs in this installation:" << endl;
+    for (const string& s : LHAPDF::availablePDFSets())
+      cout << " " << s << endl;
+
+    cout << "You can try installing your chosen pdf with: 'lhapdf install " << spdfname << "'" << endl;
+
+    exit(0);
+  } else {
+    cout << "PDF: " << spdfname << " found in this installation" << endl;
+  }
+}
+
+
+// Fortran wrapper
+
+extern "C" {
+  void checkforpdf_(char *pdfname, long int length){
+    CheckForPDF(pdfname);
+  }
+}
diff --git a/src/CheckForPDF.h b/src/CheckForPDF.h
new file mode 100644
index 0000000000000000000000000000000000000000..913439ac6121ff9b17e269c6e23d93417fc82b71
--- /dev/null
+++ b/src/CheckForPDF.h
@@ -0,0 +1,15 @@
+#ifndef __CHECKFORPDF_H
+#define __CHECKFORPDF_H
+#include "LHAPDF/Paths.h"
+#include <iostream>
+#include <algorithm>
+
+
+void CheckForPDF(char *pdfname);
+
+
+// for Fortran calling
+
+
+
+#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index ebf020b77943e42fdb6bc27da993f74d83dd3f27..01963da1cc9a8b9f1334ba05ec6632b4ebc54ed2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,9 +60,11 @@ endif
 if ENABLE_APFELGRID
   libxfmain_la_SOURCES+= APFELgridGeneration.cc
 endif
-if ENABLE_LHAPDF
+
+if ENABLE_LHAPDF 
+  libxfitter_a_SOURCES+= CheckForPDF.cxx
 else
-  libxfmain_la_SOURCES+= lhapdf_dum.f
+  libxfitter_a_SOURCES+= lhapdf_dum.f 
 endif
 if ENABLE_HATHOR
   libxfmain_la_SOURCES+= ttbar_hathor.f
diff --git a/src/lhapdf_dum.f b/src/lhapdf_dum.f
index d3b98773ae7aa275eb93f7c51548be972423953b..13794e932705c5721b687f436dfde26a047fd69d 100644
--- a/src/lhapdf_dum.f
+++ b/src/lhapdf_dum.f
@@ -8,6 +8,8 @@ c----------------------------------------------------------
       call hf_errlog(14060201, 'S: Call to lhapdf function but xFitter compiled without --enable-lhapdf switch')
       return
       end
+
+      subroutine checkforpdf()                                                                                                        end           
       
       subroutine initpdfsetbyname(a)
       call print_lhapdf_messg
diff --git a/src/read_steer.f b/src/read_steer.f
index 773b234e9e3ccd2dc95e098c2072d8d04a66f9fc..975597e10a7707fe06ffacff8eb424235af34a1c 100644
--- a/src/read_steer.f
+++ b/src/read_steer.f
@@ -7,6 +7,8 @@ C---------------------------------------------------
 
       implicit none
 
+
+
 #include "steering.inc"
 #include "ntot.inc"
 #include "indata.inc"
@@ -1094,8 +1096,9 @@ C
 C---------------------------------------
       Subroutine SetPDFStyle()
 
-      implicit none
 
+      implicit none
+      external CheckForPDF
       logical lhapdffile_exists
       integer*1 has_photon
 #include "steering.inc"
@@ -1149,6 +1152,8 @@ cv         iparam = 301
          call HF_stop
       endif
 
+      call checkforpdf(LHAPDFSET)
+
       if ((PDFStyle.eq.'LHAPDF').or.(PDFStyle.eq.'LHAPDFQ0')
      $     .or.(PDFStyle.eq.'LHAPDFNATIVE')) then
          INQUIRE(FILE=LHAPDFSET, EXIST=lhapdffile_exists)