Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Building Libraries -- configure: error: C compiler cannot create executables

Verrra

New member
I am a beginner and following the intruction ("Online Compilation Tutorial", "Compiling WRF") step by step, but is stopped when install netcdf-fortran, at the step "./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared", and it shows as below:

configure: WARNING: unrecognized options: --disable-dap
configure: netCDF-Fortran 4.5.2
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: checking user options
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/Build_WRF/LIBRARIES/netcdf-fortran-4.5.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
--disable-netcdf-4: command not found

Can anyone help me to solve it? Thank you.
 

Attachments

  • config.log
    11.9 KB · Views: 3
I am a beginner and following the intruction ("Online Compilation Tutorial", "Compiling WRF") step by step, but is stopped when install netcdf-fortran, at the step "./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared", and it shows as below:

configure: WARNING: unrecognized options: --disable-dap
configure: netCDF-Fortran 4.5.2
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: checking user options
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/Build_WRF/LIBRARIES/netcdf-fortran-4.5.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
--disable-netcdf-4: command not found

Can anyone help me to solve it? Thank you.
This might help

 
Thank you for reply. It works well in building libraries, but there are some unexpected results in compiling WRF and WPS.
For compiling WRF, I follow this thread: (RESOLVED) Problem Compiling WRFV4.0 on Fedora 28: landread error. I copied "landread.c.dist" in "landread.c" and modified the "configure.wrf" (change CFLAGS). But there is no executables in "main" directory after compiling, executables are in "run" and "test/em_real" directories.
I ignored this and then compiled WPS, end up with no "geogrid.exe" and "metgrid.exe" in both the WPS top-level directory and "geogrid/src/", "metgrid/src" directories. And after configuration, it showed:

Testing for NetCDF, C and Fortran compiler

This installation NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit


Your versions of Fortran and NETCDF are not consistent.

Is this normal and right for these configuration and compiling results? Thank you.
 

Attachments

  • configurewrf.txt
    20.6 KB · Views: 1
  • wrf_logcompile.txt
    1.3 MB · Views: 0
  • configurewps.txt
    3.4 KB · Views: 0
  • wps_logcompile.txt
    113.6 KB · Views: 0
Last edited:
Thank you for reply. It works well in building libraries, but there are some unexpected results in compiling WRF and WPS.
For compiling WRF, I follow this thread: (RESOLVED) Problem Compiling WRFV4.0 on Fedora 28: landread error. I copied "landread.c.dist" in "landread.c" and modified the "configure.wrf" (change CFLAGS). But there is no executables in "main" directory after compiling, executables are in "run" and "test/em_real" directories.
I ignored this and then compiled WPS, end up with no "geogrid.exe" and "metgrid.exe" in both the WPS top-level directory and "geogrid/src/", "metgrid/src" directories. And after configuration, it showed:

Testing for NetCDF, C and Fortran compiler

This installation NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit


Your versions of Fortran and NETCDF are not consistent.

Is this normal and right for these configuration and compiling results? Thank you.
@Verrra

What operating system are you using?
 
Windows Subsystem for Linux (WSL), Ubuntu 20.04
@Verrra

Oklay WSL is tricky because if something messes up you have to delete the folder where you built wrf and the libraries and try everything again.

most likely what happened as a fallow argument mismatch or invalid boz error. I would reccomened either

1. rebuilding from scratch it with CFLAGS= --fallow-argument-mistmach --fallow-invalid-boz

2. Use ubuntu 22 and build it again.
 
Top