Hi,
I’m trying to install MPICH (version 3.4.2) on my Ubuntu system as part of setting up CMAQ for air quality modeling. However, I’m encountering several issues during the configuration and compilation process.
Environment:
- Operating System: Ubuntu 24.04.1 LTS
- Intel Compiler: Intel oneAPI (icc for C, ifort for Fortran)
- Additional Tools:
make
,gcc
,gfortran
,hwloc
libraries installed
Problem:
I am following the installation instructions for MPICH, but when I run the ./configure
script, I receive the following error:
configure: error: cannot run C compiled programs.
If you meant to cross compile, use ‘–host’.
See ‘config.log’ for more details.
Additionally, I am trying to configure MPICH with Intel compilers (icc
, ifort
), but I also tried using gcc
and gfortran
without success.
Steps Taken:
- Checked Compilers:
icc
andifort
are correctly installed and sourced.- Tried using
gcc
andgfortran
as alternatives, but the issue persists.
- Set Environment Variables:
- Added Intel compilers to the environment and sourced
setvars.sh
file. - Added required paths to
.profile
for GCC and other dependencies.
- Run
./configure
: I ran the following configure command:
CC=icc CXX=icc FC=ifort CPP='icpc -E' CPPFLAGS='-fPIC' \
./configure --prefix=/home/ubuntu/Build_CMAQ/LIBRARIES/mpich --with-device=ch3
This command did not generate the Makefile
and resulted in the error mentioned earlier.
4. Manual Workaround Attempts: I also tried setting --host
for cross-compilation, but it didn’t resolve the issue. Here’s the configuration command I tried:
./configure --prefix=/home/ubuntu/Build_CMAQ/LIBRARIES/mpich --host=arm --with-device=ch3
But I still encounter the same issue.
Errors Encountered:
./configure
fails to generate theMakefile
due to the error:cannot run C compiled programs
.- Tried to cross-compile with
--host=arm
, but that also didn’t work.
What I’ve Tried:
- Running
./configure
with both Intel and GCC compilers. - CC=icc CXX=icc FC=ifort CPP=‘icpc -E’ CPPFLAGS=‘-fPIC’
./configure --prefix=/home/ubuntu/Build_CMAQ/LIBRARIES/mpich --with-device=ch3 - this didn’t worked - Ensuring all paths are correctly set in
.profile
. - Installing missing dependencies (e.g.,
hwloc
,libhwloc-dev
). - Manually setting up
PATH
andLD_LIBRARY_PATH
. - I’m following this manual since it’s much easier for me to understand.
Request:
Could anyone help me troubleshoot why ./configure
isn’t generating the Makefile
and why I’m seeing the “cannot run C compiled programs” error?
Additionally, if anyone has experience configuring MPICH on Ubuntu with Intel compilers (or GCC), I’d greatly appreciate guidance on what steps I might be missing.