title: Compiling a C++ code including PETSc libraries. make: No rule to make target error message
body: <p>I am interested in using the open source code discussed <a href="https://github.com/topopt/TopOpt_in_PETSc" rel="nofollow noreferrer">here</a>. The framework and some instruction on how to run the code is discussed <a href="https://www.researchgate.net/publication/266953492_Topology_optimization_using_PETSc_An_easy-to-use_fully_parallel_open_source_topology_optimization_framework" rel="nofollow noreferrer">here</a>. To be able to use the code one should first install <a href="https://www.mcs.anl.gov/petsc/" rel="nofollow noreferrer">PETSc</a>. I have done this and it seems to be correctly installed. The problem rises when I try to run <code>make topopt</code> following the instructions given in the <a href="https://www.researchgate.net/publication/266953492_Topology_optimization_using_PETSc_An_easy-to-use_fully_parallel_open_source_topology_optimization_framework" rel="nofollow noreferrer">paper</a> (section 2.2). On the <a href="https://github.com/topopt/TopOpt_in_PETSc" rel="nofollow noreferrer">GitHub</a> there exists a <code>makefile_ref</code> where following the instructions given in the <a href="https://www.researchgate.net/publication/266953492_Topology_optimization_using_PETSc_An_easy-to-use_fully_parallel_open_source_topology_optimization_framework" rel="nofollow noreferrer">paper</a> I make the following changes: <code>PETSC_DIR=\home\myusername\petsc</code> and <code>PETSC_ARCH=arch-linux-c-debug</code>. After running <code>make -d topopt</code> I get the following error:</p>
  <pre><code>GNU Make 4.2.1
  Built for x86_64-pc-linux-gnu
  Copyright (C) 1988-2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Reading makefiles...
  Updating makefiles....
   Considering target file 'GNUmakefile'.
    File 'GNUmakefile' does not exist.
    Looking for an implicit rule for 'GNUmakefile'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.o'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.c'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.cc'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.C'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.cpp'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.p'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.f'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.F'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.m'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.r'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.s'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.S'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.mod'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.sh'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile,v'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'RCS/GNUmakefile,v'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'RCS/GNUmakefile'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 's.GNUmakefile'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'SCCS/s.GNUmakefile'.
    Trying pattern rule with stem 'GNUmakefile'.
    Trying implicit prerequisite 'GNUmakefile.o'.
    Looking for a rule with intermediate file 'GNUmakefile.o'.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.c'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.cc'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.C'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.cpp'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.p'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.f'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.F'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.m'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.r'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.s'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.S'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.mod'.
     Trying pattern rule with stem 'GNUmakefile.o'.
     Trying implicit prerequisite 'GNUmakefile.o,v'.
     Trying pattern rule with stem 'GNUmakefile.o'.
     Trying implicit prerequisite 'RCS/GNUmakefile.o,v'.
     Trying pattern rule with stem 'GNUmakefile.o'.
     Trying implicit prerequisite 'RCS/GNUmakefile.o'.
     Trying pattern rule with stem 'GNUmakefile.o'.
     Trying implicit prerequisite 's.GNUmakefile.o'.
     Trying pattern rule with stem 'GNUmakefile.o'.
     Trying implicit prerequisite 'SCCS/s.GNUmakefile.o'.
     Trying pattern rule with stem 'GNUmakefile'.
     Trying implicit prerequisite 'GNUmakefile.c'.
     Looking for a rule with intermediate file 'GNUmakefile.c'.
      Avoiding implicit rule recursion.
      Avoiding implicit rule recursion.
      Trying pattern rule with stem 'GNUmakefile'.
      Trying implicit prerequisite 'GNUmakefile.y'.
      Trying pattern rule with stem 'GNUmakefile'.
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  Looking for a rule with intermediate file 'topopt.mod'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'topopt.mod'.
     Trying implicit prerequisite 'topopt.mod,v'.
     Trying pattern rule with stem 'topopt.mod'.
     Trying implicit prerequisite 'RCS/topopt.mod,v'.
     Trying pattern rule with stem 'topopt.mod'.
     Trying implicit prerequisite 'RCS/topopt.mod'.
     Trying pattern rule with stem 'topopt.mod'.
     Trying implicit prerequisite 's.topopt.mod'.
     Trying pattern rule with stem 'topopt.mod'.
     Trying implicit prerequisite 'SCCS/s.topopt.mod'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.c'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.cc'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.C'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.cpp'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.p'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.f'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.F'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.m'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.r'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.s'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.S'.
   Trying pattern rule with stem 'topopt'.
   Rejecting impossible implicit prerequisite 'topopt.mod'.
   Trying pattern rule with stem 'topopt'.
   Trying implicit prerequisite 'topopt.sh'.
   Looking for a rule with intermediate file 'topopt.sh'.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'topopt.sh'.
    Trying implicit prerequisite 'topopt.sh,v'.
    Trying pattern rule with stem 'topopt.sh'.
    Trying implicit prerequisite 'RCS/topopt.sh,v'.
    Trying pattern rule with stem 'topopt.sh'.
    Trying implicit prerequisite 'RCS/topopt.sh'.
    Trying pattern rule with stem 'topopt.sh'.
    Trying implicit prerequisite 's.topopt.sh'.
    Trying pattern rule with stem 'topopt.sh'.
    Trying implicit prerequisite 'SCCS/s.topopt.sh'.
   No implicit rule found for 'topopt'.
   Finished prerequisites of target file 'topopt'.
  Must remake target 'topopt'.
  make: *** No rule to make target 'topopt'.  Stop.
  </code></pre>
  <p>The code above is only a fraction of the whole message (the starting fraction and the ending fraction).</p>
  <p>I am working on Ubuntu 20.04.</p>
  <p>Thanks in advance.</p>