[petsc-dev] Makefile with latest PETSc

Matthew Knepley knepley at gmail.com
Tue Oct 1 05:54:06 CDT 2019


On Tue, Oct 1, 2019 at 6:38 AM Tabrez Ali via petsc-dev <
petsc-dev at mcs.anl.gov> wrote:

> Hello
>
> I am trying to compile a simple Fortran program and it works fine with
> PETSc 3.10 but fails with the latest version, e.g., see below:
>
> $ make clean; make exe PETSC_DIR=/opt/petsc-3.10.5_clang_uni
> flang -c -fPIC -Wall -Wno-unused-variable -g -O3
>  -I/opt/petsc-3.10.5_clang_uni/include
> -I/opt/petsc-3.10.5_clang_uni/arch-linux2-c-opt/include    -o m_foo.o
> m_foo.F90
> flang -c -fPIC -Wall -Wno-unused-variable -g -O3
>  -I/opt/petsc-3.10.5_clang_uni/include
> -I/opt/petsc-3.10.5_clang_uni/arch-linux2-c-opt/include    -o bar.o bar.F90
> flang -fPIC -Wall -Wno-unused-variable -g -O3   -o exe m_foo.o bar.o
> -Wl,-rpath,/opt/petsc-3.10.5_clang_uni/arch-linux2-c-opt/lib
> -L/opt/petsc-3.10.5_clang_uni/arch-linux2-c-opt/lib
> -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/8
> -L/usr/lib/gcc/x86_64-linux-gnu/8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu
> -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu
> -L/lib/x86_64-linux-gnu -Wl,-rpath,/opt/flang/lib -L/opt/flang/lib
> -Wl,-rpath,/opt/intel/compilers_and_libraries_2019.4.243/linux/mpi/intel64/libfabric/lib
> -L/opt/intel/compilers_and_libraries_2019.4.243/linux/mpi/intel64/libfabric/lib
> -Wl,-rpath,/opt/intel/compilers_and_libraries_2019.4.243/linux/tbb/lib/intel64/gcc4.7
> -L/opt/intel/compilers_and_libraries_2019.4.243/linux/tbb/lib/intel64/gcc4.7
> -lpetsc -llapack -lblas -lm -lpthread -lflangmain -lstdc++ -ldl -lflang
> -lflangrti -lpgmath -lompstub -lm -lrt -lpthread -lgcc_s -lstdc++ -ldl
>
> $ make clean; make exe PETSC_DIR=/home/stali/petsc-dev
> make: *** No rule to make target 'm_foo.o', needed by 'exe'.  Stop.
>
> Any ideas as to what could be wrong? Here's the Makefile ...
>
> include ${PETSC_DIR}/lib/petsc/conf/variables
> include ${PETSC_DIR}/lib/petsc/conf/rules
> OBJS = m_foo.o bar.o
> exe: ${OBJS}
>          ${FLINKER} -o exe ${OBJS} ${PETSC_LIB}
>

Can you try putting the include statements at the end?

  Thanks,

     Matt


> Thanks in advance.
>
> Tabrez
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20191001/579f1cfe/attachment-0001.html>


More information about the petsc-dev mailing list