LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling another program with mpicc using a non default compiler (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-another-program-with-mpicc-using-a-non-default-compiler-889423/)

Ztif 07-01-2011 01:40 PM

Compiling another program with mpicc using a non default compiler
 
I am trying to compile a program with mpicc. To compile I use:
CC=/usr/bin/mpicc ./configure

However mpicc's default C compiler is gcc 4.4.2 and I need to use 4.0.0 which I have installed in another directory. I do not (nor can get) root privileges so I cannot edit mpicc's default compiler. Is there an option I can set while configuring?

Thanks

weibullguy 07-02-2011 07:33 AM

If you are using mpich, you should be able to use -cc=name on the command line or the environment variable MPICH_CC to select a different compiler. If using OpenMPI, setting the environment variable OMPI_CC should select a different compiler. However, gcc-4.4.2 was probably the compiler MPI was built with and using a different compiler can cause problems.

knudfl 07-06-2011 08:07 AM

Suggest : Build a new locale openmpi, mpicc, with your local gcc-4.0 :

Something like :
cd openmpi(-1.4.3)/ && ./configure CC=gcc-4.0 CXX=g++-4.0 --prefix=/home/Ztif


..


All times are GMT -5. The time now is 05:45 PM.