How to pass -libm to MPICC? libimf.so: warning: feupdateenv is not implemented and will always fail

孤街浪徒 提交于 2019-12-24 01:16:16

问题


I am a newbie who tries to compile a program via mpicc replacing icc with gcc. I have already discovered, that I need to use the following command to compile

$ OMPI_CC=gcc make

However, I get the following error message (which is well-known)

/opt/intel/fce/9.1.036/lib/libimf.so: warning: warning: feupdateenv is not implemented and will always fail

I try to do

$ make clean && OMPI_CC=gcc OMPI_LDFLAGS=-libm make

Then I see

/usr/bin/ld: cannot find -libm
collect2: ld returned 1 exit status

However, I find the file there

lrwxrwxrwx /usr/lib/libm.so -> /lib/libm.so.6
lrwxrwxrwx /lib/libm.so.6 -> libm-2.3.6.so
-rw-r--r-- /lib/libm-2.3.6.so

回答1:


Try:

$ make clean
$ OMPI_CC=gcc OMPI_LDFLAGS=-lm make



回答2:


Use the --showme flag to determine the flags used by mpicc/mpi compiler wrappers. Then invoke your own compiler of choice (icc/gcc/pgcc/whatever) and add the relevant flags so the correct MPI libraries are linked.

Remember, you need to use --showme with a file for the wrapper to show the correct flags.

More info is here: http://www.open-mpi.org/faq/?category=mpi-apps#wrapper-showme-with-no-file



来源:https://stackoverflow.com/questions/3354818/how-to-pass-libm-to-mpicc-libimf-so-warning-feupdateenv-is-not-implemented-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!