ifort编译可执行文件linux undefined引用

时间:2018-09-20 13:05:53

标签: linux makefile fortran

我有以下makefile

#makefile for building Linux 64b executable
FC = ifort
MPPD = -DAUTODOUBLE -4R8 -4I8
FLAGS = -safe_cray_ptr -assume byterecl,buffered_io,protect_parens -warn nousage -zero -ftz -fp-model precise -mP2OPT_hpo_dist_factor=21 -diag-disable 10212,10010 -fimf-arch-consistency=true -traceback -pad -DLINUX -DIFORT -DNET_SECURITY -DADDR64 -DINTEL -DXEON64 -DFCC80 -DTIMER=cycle_time -DSSE2 -DOVERRIDE -DMPP -DMPICH -DHPMPI -DAUTODOUBLE -DNEWIO -DEXTENDED -DLSTCODE  -DENABLE_HASH3 -DFFTW -DZMF2 -DUSES_CXX -DPFEM -DSPRNG -DUSE_SPRNG -DUSES_CPP  -DPTHREADS -nodps -i8 -r8 -DSPRNG_MPI -DUSE_MPI -DINTEL -DAdd_ -xSSE2 -align array16byte -fPIC -O2

TARGET = mppdyna

MPICH_LIB = /opt/intel/impi/4.1.3.048/mic/lib/libmpi.so

MPICH_INC = /opt/intel/impi/4.1.3.048/mic/include/

FFLAGS = $(FLAGS) -I. -I$(MPICH_INC) -I/opt/ibm/platform_mpi/include/

LINKLIBS = libgcrypt.so.20 libgpg-error.so.0 libpthread.so.0 libtriboformplugin.so 

OBJS = dyn21.o dyn21b.o couple2other_user.o triboform_lsdyna_plugin.o 

$(TARGET): $(OBJS)
    $(FC) -w -o mppdyna.out $(OBJS) $(LINKLIBS)

init_dyn21.o: init_dyn21.f nhisparm.inc 
    $(FC) -c $(FFLAGS) init_dyn21.f
dyn21.o: dyn21.f nhisparm.inc
    $(FC) -c $(FFLAGS) dyn21.f
dyn21b.o: dyn21b.f nhisparm.inc
    $(FC) -c $(FFLAGS) dyn21b.f
couple2other_user.o: couple2other_user.f
    $(FC) -c $(FFLAGS)  couple2other_user.f
dynrfn_user.o: dynrfn_user.f
    $(FC) -c $(FFLAGS) dynrfn_user.f
triboform_lsdyna_plugin.o: triboform_lsdyna_plugin.f
    $(FC) -c $(FFLAGS) triboform_lsdyna_plugin.f

clean:
    -@rm mppdyna 2>/dev/null || :
    rm -rf *.o

它给了我以下错误信息

...
...
dyn21b.f:(.text+0x90cd2): undefined reference to `adios_'
dyn21b.o: In function `umat48c_':
dyn21b.f:(.text+0x90dc2): undefined reference to `adios_'
dyn21b.o:dyn21b.f:(.text+0x90eb2): more undefined references to `adios_' follow
dyn21b.o: In function `thumat12_':
dyn21b.f:(.text+0x961ed): undefined reference to `crvval_'
dyn21b.f:(.text+0x96260): undefined reference to `crvval_'
dyn21b.o: In function `thumat13_':
dyn21b.f:(.text+0x963bc): undefined reference to `adios_'
...
...
libtriboformplugin.so: undefined reference to `do_license_check'
libtriboformplugin.so: undefined reference to `write_processing_file'
libtriboformplugin.so: undefined reference to `strerror_s'
libtriboformplugin.so: undefined reference to `fopen_s'
libtriboformplugin.so: undefined reference to `freopen_s'
make: *** [mppdyna] Error 1

我对ifort比较陌生,谁能指出我的错在哪里? which ifort指向/opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort,我也正在使用platform_mpi。 我已经成功地用另一个来自C项目的makefile创建了libtriboformplugin.so。

0 个答案:

没有答案