问题
I have a C-code for parallel computing written for gcc
, and I want to compile it on a cluster, which apparently uses icc
via mpicc
. Correcting the code to be icc
-friendly seems to be too time-demanding, so I wonder if I can ask OpenMPI
to use gcc
instead. I don't have the admin rights on that cluster, and I would actually prefer to do not mess the original configuration.
If it is not possible to set in e.g. Makefile
, then I could hopefully compile OpenMPI
in my home directory, but I need some guidance in what must be done after that. Could you help me?
UPDATE1
The Makefile
contains
CC = mpicc
CFLAGS += -DMPI
And here are some OpenMPI files
$ which mpicc
/usr/bin/mpicc
lrwxr-xr-x /usr/bin/mpicc -> opal_wrapper
-rwxr-xr-x /usr/bin/opal_wrapper
Let me know, if I can provide you more information.
UPDATE2
With the help of Jeff, I was able to find OpenMPI
settings for mpicc
$ more /usr/local/share/openmpi/mpicc-wrapper-data.txt
project=Open MPI
project_short=OMPI
version=1.1.4
language=C
compiler_env=CC
compiler_flags_env=CFLAGS
compiler=icc
extra_includes= openmpi
preprocessor_flags=
compiler_flags=-pthread
linker_flags=
libs=-lmpi -lorte -lopal -ldl -Wl,--export-dynamic -lnsl -lutil -ldl
required_file=
However, I do not have rights to edit this file, and OPMI_CC = gcc
doesn't change compiler.
UPDATE3
Environmental variable CC = gcc
doesn't help
$ export CC=gcc
$ echo $CC
gcc
$ make clean $$ make
...icc:...errors
UPDATE4
...but export OMPI_CC=gcc
does finally help (thanks to sharth). I should one day remember that these are different things...
Despite that the binary was created, I got the following bye-bye message
/opt/intel/fce/9.1.036/lib/libimf.so: warning: warning: feupdateenv is not implemented and will always fail
回答1:
See http://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0.
回答2:
Try setting the environmental variable CC to gcc.
csh: setenv CC gcc
bash: export CC=gcc
来源:https://stackoverflow.com/questions/3353119/how-to-force-openmpi-to-use-gcc-instead-of-icc-is-recompiling-openmpi-necessary