0
# Makefile for Defmod

FFLAGS =
FPPFLAGS =
LDLIBS =

-include ${PETSC_DIR}/conf/variables
-include ${PETSC_DIR}/conf/rules
-include ${PETSC_DIR}/lib/petsc/conf/variables
-include ${PETSC_DIR}/lib/petsc/conf/rules

OBJS = main.o m_global.o m_local.o m_elems.o m_utils.o

m_utils.o : m_utils.F90
m_elems.o : m_elems.F90 m_utils.o
m_local.o : m_local.F90 m_elems.o
m_global.o: m_global.F90 m_local.o
main.o    : main.F90 m_global.o

all: ${OBJS}
    -${FLINKER} ${OBJS} -o ../defmod ${PETSC_LIB} ${LDLIBS}

when I enter make all, it pops out:

make[1]: Entering directory '/mnt/c/Users/gxyan/defmod-dev/src'
    main.o m_global.o m_local.o m_elems.o m_utils.o -o ../defmod
    make[1]: main.o: Command not found
    Makefile:21: recipe for target 'all' failed
    make[1]: [all] Error 127 (ignored)
    make[1]: Leaving directory '/mnt/c/Users/gxyan/defmod-dev/src'

and all the environment variables of PETSC is set. the configure of PETSC is done with the command:

 ./configure --with-cc=gcc --with-fc=gfortran --download-mpich --download-fblaslapack --download-cmake --download-metis --with-debugging=0

So, what's wrong?

Ck Mo
  • 1
  • 1

2 Answers2

0

make variable FLINKER is either not defined, or is defined but has the empty string value

Mark Galeck
  • 6,155
  • 1
  • 28
  • 55
0

You need to first set the PETSC_DIR variable. E.g., in BASH do:

export PETSC_DIR=/home/user/petsc

followed by

make all

Alternatively, you can do:

make all PETSC_DIR=/home/user/petsc
stali
  • 321
  • 2
  • 9
  • From the question: "all the environment variables of PETSC is set.". Even if the variable weren't correct, how does that explain the error message? – francescalus Dec 12 '17 at 23:07