Opened 17 months ago

Last modified 3 months ago

#66209 assigned defect

netcdf does not compile with mpich or openmpi

Reported by: massonseb Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc: jmon12, Dave-Allured (Dave Allured)
Port: netcdf

Description

I am using macOS 12.6.1 with ARM64 (Apple M1 Pro) and I am trying to compile netcdf.

port install netcdf +gcc12 works fine.

but netcdf +gcc12 +openmpi or netcdf +gcc12 +mpich fail to configure:

--->  Configuring netcdf
Error: Failed to configure netcdf: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_netcdf/netcdf/work/build/CMakeFiles/CMakeError.log
Error: Failed to configure netcdf: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_netcdf/netcdf/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port netcdf failed

In both cases, the error message in the main.log file is :

with openmpi:

:info:configure -- Found MPI_C: /opt/local/bin/mpicc-openmpi-gcc12 (found version "3.1") 
:info:configure -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
:info:configure CMake Error at /opt/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
:info:configure   Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "3.1")
:info:configure Call Stack (most recent call first):
:info:configure   /opt/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
:info:configure   /opt/local/share/cmake-3.23/Modules/FindMPI.cmake:1830 (find_package_handle_standard_args)
:info:configure   CMakeLists.txt:1426 (FIND_PACKAGE)
:info:configure -- Configuring incomplete, errors occurred!

with mpich:

:info:configure -- Found MPI_C: /opt/local/bin/mpicc-mpich-gcc12 (found version "4.0") 
:info:configure -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
:info:configure CMake Error at /opt/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
:info:configure   Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "4.0")
:info:configure Call Stack (most recent call first):
:info:configure   /opt/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
:info:configure   /opt/local/share/cmake-3.23/Modules/FindMPI.cmake:1830 (find_package_handle_standard_args)
:info:configure   CMakeLists.txt:1426 (FIND_PACKAGE)
:info:configure -- Configuring incomplete, errors occurred!

I attach the 2 log files (netcdf_openmpi.log and netcdf_mpich.log)

Thank you for your help,

Sébastien

Attachments (2)

netcdf_openmpi.log (131.0 KB) - added by massonseb 17 months ago.
configure log file for netcdf +gcc12 +openmpi
netcdf_mpich.log (129.2 KB) - added by massonseb 17 months ago.
configure log file for netcdf +gcc12 +mpich

Download all attachments as: .zip

Change History (6)

Changed 17 months ago by massonseb

Attachment: netcdf_openmpi.log added

configure log file for netcdf +gcc12 +openmpi

Changed 17 months ago by massonseb

Attachment: netcdf_mpich.log added

configure log file for netcdf +gcc12 +mpich

comment:1 Changed 17 months ago by jmroot (Joshua Root)

Owner: set to tenomoto
Status: newassigned

comment:2 Changed 5 months ago by jmon12

cmake is not finding the MPI compilers (e.g. mpicc-openmpi-mp) etc...

In my case, selecting a macports MPI environments allowed cmake to find the compilers correctly. Just follow the instructions of the notes of the MPI port you have installed. Here is an example with openmpi-default:

# Get the instruction: this varies depending on your installed port
port notes openmpi-default

# Follow the instructions: set the wrappers as default
sudo port select --set mpi openmpi-mp-fortran

You might alternatively play with cmake variables, e.g. add a -DCMAKE_PREFIX_PATH in the configure.args-append instruction in the Portfile, but I didn't experiment with that.

Last edited 5 months ago by jmon12 (previous) (diff)

comment:3 Changed 5 months ago by jmon12

Cc: jmon12 added

comment:4 Changed 3 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added
Note: See TracTickets for help on using tickets.