CMake Error at CMakeLists.txt:16 (add_executable):
Target "build" links to target "Garfield::Garfield" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Even with this cmake error, the make is available to be run, so running it.
Yes, before i run the cmake i have typed this on terminal: source /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/setup.sh
To make sure everything went right, i always type echo $GARFIELD_HOME, and i get that:
Hi,
the version of Garfield++ that was included in LCG97 is quite old by now. I would really recommend cloning the master branch and building it yourself…
/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-96764/x86_64-ubuntu1804-gcc8-opt/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-96764/x86_64-ubuntu1804-gcc8-opt/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-96764/x86_64-ubuntu1804-gcc8-opt/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-96764/x86_64-ubuntu1804-gcc8-opt/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-96764/x86_64-ubuntu1804-gcc8-opt/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory
n file included from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:28,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TNamed.h:26,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualX.h:30,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualPad.h:27,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TPad.h:16,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TCanvas.h:17,
from /sampa/lucas19/garfield/GarfieldDetector.cc:11:
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/ROOT/RStringView.hxx:84:17: error: expected type-specifier
84 | operator std::string_view() const { return std::string_view(fData,fLength); }
| ^~~
In file included from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TNamed.h:26,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualX.h:30,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualPad.h:27,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TPad.h:16,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TCanvas.h:17,
from /sampa/lucas19/garfield/GarfieldDetector.cc:11:
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:110:13: error: expected type-specifier
110 | operator std::string_view() const { return std::string_view(Data(),fExtent); }
| ^~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:275:32: error: ‘string_view’ in namespace ‘std’ does not name a type
275 | explicit TString(const std::string_view &sub);
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:275:27: note: ‘std::string_view’ is only available from C++17 onwards
275 | explicit TString(const std::string_view &sub);
| ^~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:312:37: error: ‘string_view’ in namespace ‘std’ does not name a type
312 | TString &operator=(const std::string_view &s);
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:312:32: note: ‘std::string_view’ is only available from C++17 onwards
312 | TString &operator=(const std::string_view &s);
| ^~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:439:9: error: ‘string_view’ in namespace ‘std’ does not name a type
439 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:439:4: note: ‘std::string_view’ is only available from C++17 onwards
439 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
| ^~~
In file included from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TNamed.h:26,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualX.h:30,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TVirtualPad.h:27,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TPad.h:16,
from /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TCanvas.h:17,
from /sampa/lucas19/garfield/GarfieldDetector.cc:11:
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:834:53: error: ‘string_view’ in namespace ‘std’ does not name a type
834 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:834:48: note: ‘std::string_view’ is only available from C++17 onwards
834 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
| ^~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:834:15: error: ‘Bool_t operator==(const char*, const int&)’ must have an argument of class or enumerated type
834 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
| ^~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:839:37: error: ‘string_view’ in namespace ‘std’ does not name a type
839 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:839:32: note: ‘std::string_view’ is only available from C++17 onwards
839 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
| ^~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:839:15: error: ‘Bool_t operator==(const int&, const char*)’ must have an argument of class or enumerated type
839 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
| ^~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:852:37: error: ‘string_view’ in namespace ‘std’ does not name a type
852 | std::string printValue(const std::string_view* val);
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc9-opt/include/TString.h:852:32: note: ‘std::string_view’ is only available from C++17 onwards
852 | std::string printValue(const std::string_view* val);
| ^~~
make: ** [] Erro 1
Hi,
sorry, what I meant is: set up the environment using one of the LCG views like you did; then git clone the Garfield++ source and build the project following the instructions on the website.