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}

当我输入make all时,它会弹出:</p>

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'

并且设置了PETSC的所有环境变量。PETSC 的配置是通过以下命令完成的:

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

那么,怎么了?

4

2 回答 2

0

make 变量FLINKER要么未定义,要么已定义但具有空字符串值

于 2017-10-01T18:26:50.010 回答
0

您需要先设置PETSC_DIR变量。例如,在 BASH 中:

export PETSC_DIR=/home/user/petsc

其次是

make all

或者,您可以执行以下操作:

make all PETSC_DIR=/home/user/petsc
于 2017-12-12T22:27:23.043 回答