make vic_image 失败

make步骤如下:

cd VIC/vic/drivers/image
dnf install openmpi
dnf install openmpi-devel.x86_64
module load mpi/openmpi-x86_64
dnf install -y netcdf-devel
dnf install -y netcdf netcdf-devel

报错如下:

/usr/bin/ld: /tmp/ccaypzjZ.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_log.h:61: multiple definition of `LOG_DEST'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_log.h:61: first defined here
/usr/bin/ld: /tmp/ccaypzjZ.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_def.h:76: multiple definition of `vic_run_ref_str'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_def.h:76: first defined here
/usr/bin/ld: /tmp/ccaypzjZ.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_run.h:157: multiple definition of `funcd'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_run.h:157: first defined here
/usr/bin/ld: /tmp/cczsSJD9.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_log.h:61: multiple definition of `LOG_DEST'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_log.h:61: first defined here
/usr/bin/ld: /tmp/cczsSJD9.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_def.h:76: multiple definition of `vic_run_ref_str'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_def.h:76: first defined here
/usr/bin/ld: /tmp/cczsSJD9.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_run.h:157: multiple definition of `funcd'; /tmp/ccyuazMj.o:/home/VIC/vic/drivers/image/../../vic_run/include/vic_run.h:157: first defined here
collect2: error: ld returned 1 exit status 
make[1]: *** [Makefile:126: model] Error 1
make[1]: Leaving directory '/home/VIC/vic/drivers/image'
make: *** [Makefile:109: all] Error 2

修改Makefile后,再make就成功了:添加了一句话 CFLAGS += -fcommon

 

posted on 2024-08-16 15:46  我和你并没有不同  阅读(1)  评论(0编辑  收藏  举报