APPLICATION TERMINATED WITH THE EXIT STRING: Floating point exception (signal 8)

其实这个问题发现好久了,做一下笔记:
自己在超算上运行OpenFOAM中solver时候会碰见这种错误:
APPLICATION TERMINATED WITH THE EXIT STRING: Floating point exception (signal 8)
发现解决办法就是自己重新写一个Makefile编译一下;
具体做法为:将Make/options中项添加到Makefile的CINCLUDESCLDFLAGS中;将文件中的snappyHexMesh替换为你需要编译的文件。
具体原因可能是wmake和make所用的编译器版本不同导致的。

Makefile:
#----------------- dir of OpenFOAM----------------------
#dir where you install OF
FOAM_DIR := /opt/OpenFOAM/OpenFOAM-2.3.x
FOAM_LIB_DIR := $(FOAM_DIR)/platforms/linux64IccDPOpt/lib
FOAM_LIB_DIR2 := $(FOAM_DIR)/platforms/linux64IccDPOpt/lib/4.1.1.036

#----------------- cpp file compiler-------------------
mpidir := /opt/intel/impi/4.1.1.036
MPICC := $(mpidir)/bin64/mpicxx
CLDFLAGS := -lm -lnsl
mpiinc := $(mpidir)/include64
CINCLUDES := -I. -I$(mpiinc)
CC := $(MPICC) -fPIC 

CFLAGS := -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 

#--------------- openFOAM include files and libs------
FOAM_SRC	:= $(FOAM_DIR)/src
FOAM_SOLVER := $(FOAM_DIR)/applications/solvers

# included head files

CINCLUDES := \
        -I$(FOAM_SRC)/OpenFOAM/lnInclude \
        -I$(FOAM_SRC)/OSspecific/POSIX/lnInclude \
        -I$(FOAM_SRC)/parallel/decompose/decompositionMethods/lnInclude \
        -I$(FOAM_SRC)/mesh/autoMesh/lnInclude \
        -I$(FOAM_SRC)/meshTools/lnInclude \
        -I$(FOAM_SRC)/fileFormats/lnInclude \
        -I$(FOAM_SRC)/triSurface/lnInclude \
        -I$(FOAM_SRC)/surfMesh/lnInclude \
        -I$(FOAM_SRC)/dynamicMesh/lnInclude \
        -I$(FOAM_SRC)/edgeMesh/lnInclude \
        -I$(FOAM_SRC)/finiteVolume/lnInclude


CLDFLAGS := -L$(FOAM_LIB_DIR) -L$(FOAM_LIB_DIR2) -L$(FOAM_USER_LIBBIN) \
    -lfiniteVolume \
    -ldecompositionMethods \
    -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
    -lmeshTools \
    -lsurfMesh \
    -lfileFormats \
    -ldynamicMesh \
    -lautoMesh

# obj files
OBJ_CPP_FILES := snappyHexMesh.o

OBJ_FILES := $(OBJ_CPP_FILES)

# link app
LINK := $(CC) -Xlinker --add-needed -Xlinker --no-as-needed 


exec_name := snappyHexMesh

$(exec_name):$(OBJ_FILES) 
	$(LINK) -o $(exec_name) $(OBJ_FILES) $(CLDFLAGS)  $(CINCLUDES) $(CFLAGS) $(NVCCLDFLAGS)

# compile objs

snappyHexMesh.o:snappyHexMesh.C
	$(CC) -c snappyHexMesh.C -o snappyHexMesh.o $(CINCLUDES) $(CFLAGS)


clean:
	rm -f $(exec_name) $(OBJ_FILES)

你可能感兴趣的:(notes)