Skip to content

Bug Intel oneapi compiler fails to build tiff in beta2 #3311

Description

@HathewayWill

I found the bug: TIFF configures with C++ support enabled even though icpx already failed its C++ test, and the build later dies compiling tif_stream.cxx because icpx cannot resolve the C++ header location. The top-level compile_MET_all.log only reports the wrapper failure from make -j 8; the actionable error is in tiff.make.log.

TIFF’s configure log shows an earlier warning sign: libtool.m4: error: problem compiling CXX test program, followed by icpx supports -c -o file.o... no, but configure still finishes with C++ support: yes. The environment explicitly sets CXX=icpx and CXXFLAGS="-Wall -DHAVE_ISATTY", which is the compiler/flag path used in the failing TIFF C++ compile.

Describe the Problem

MET external library compilation fails while building TIFF 4.6.0 with the Intel oneAPI LLVM compilers. The TIFF configure step detects problems compiling with icpx, but still completes with C++ support enabled. The subsequent TIFF make step fails when compiling libtiff/tif_stream.cxx because icpx cannot resolve the C++ header location.

The first fatal error is:

icpx: error: C++ header location not resolved; check installed C++ dependencies
make[2]: *** [Makefile:724: tif_stream.lo] Error 1
make[1]: *** [Makefile:518: all] Error 2
make: *** [Makefile:556: all-recursive] Error 1

The top-level build then exits with:

ERROR: Command returned with non-zero (2) status: make -j 8 > .../tiff.make.log 2>&1

This appears to be a TIFF C++ configuration/compiler-detection issue in the Intel icx/icpx build path. The configure step logs that icpx cannot compile the C++ test program and does not support -c -o file.o, but still reports C++ support: yes. The build then attempts to compile the C++ source tif_stream.cxx with icpx and fails.

Expected Behavior

compile_MET_all.sh should successfully build and install the required external libraries, including TIFF, when using the Intel oneAPI compilers, or it should fail earlier during TIFF configure with a clear actionable message.

If TIFF C++ support is not required for MET, the TIFF configure step should disable TIFF C++ support when icpx fails the C++ compiler test. If TIFF C++ support is required, the build script should validate that icpx can resolve the system C++ headers before starting the TIFF build, or pass the necessary compiler configuration.

Environment

Describe your runtime environment:

  1. Machine: Linux workstation or VM under /home/workhorse

  2. OS: Linux x86_64-pc-linux-gnu; install script includes Ubuntu 24.04 handling

  3. Software version number(s):

    • MET source tarball: v13.0.0-beta2.tar.gz
    • Build directory shown in logs: MET-12.2.1
    • TIFF: 4.6.0
    • Compiler family: Intel
    • CC=icx
    • CXX=icpx
    • FC=ifx
    • Compiler string shown by MET build: intel_22.1.0
    • Intel oneAPI runtime paths include 2026.0
    • Python: 3.12.8
    • MAKE_ARGS=-j 8
    • CFLAGS="-fPIC -fPIE -O3 -Wno-implicit-function-declaration -Wno-incompatible-function-pointer-types -Wno-unused-command-line-argument"
    • CXXFLAGS="-Wall -DHAVE_ISATTY"

To Reproduce

Describe the steps to reproduce the behavior:

  1. Install the required packages and Intel oneAPI tooling.

  2. Source the Intel oneAPI environment:

    source /opt/intel/oneapi/setvars.sh --force
  3. Export the Intel compiler environment:

    export CC=icx
    export CXX=icpx
    export FC=ifx
    export F77=ifx
    export F90=ifx
    export CFLAGS="-fPIC -fPIE -O3 -Wno-implicit-function-declaration -Wno-incompatible-function-pointer-types -Wno-unused-command-line-argument"
    export CXXFLAGS="-Wall -DHAVE_ISATTY"
  4. Download compile_MET_all.sh, tar_files.met-base-develop.tgz, and v13.0.0-beta2.tar.gz.

  5. Set the MET build environment:

    export TEST_BASE="${WRF_FOLDER}/MET-${met_Version_number}"
    export MET_SUBDIR="${TEST_BASE}"
    export MET_TARBALL=v13.0.0-beta2.tar.gz
    export USE_MODULES=FALSE
    export MAKE_ARGS="-j 8"
    export MET_PYTHON=/opt/intel/oneapi/intelpython/python3.12
  6. Run:

    ./compile_MET_all.sh 2>&1 | tee compile_MET_all.log
  7. Observe that the build stops during TIFF:

    Compiling TIFF
    ./configure --prefix=.../external_libs > .../tiff.configure.log 2>&1
    make -j 8 > .../tiff.make.log 2>&1
    ERROR: Command returned with non-zero (2) status
    
  8. Open tiff.make.log and observe the real failure:

    /bin/bash ../libtool --tag=CXX --mode=compile icpx ... -c -o tif_stream.lo tif_stream.cxx
    icpx: error: C++ header location not resolved; check installed C++ dependencies
    make[2]: *** [Makefile:724: tif_stream.lo] Error 1
    

Relevant sample data is attached in:

  • compile_MET_all.log
  • tiff.configure.log
  • tiff.make.log
  • compile_MET_all.sh
  • install script snippet

Relevant Deadlines

NONE

Funding Source

NONE

Define the Metadata

Assignee

  • Select engineer(s) required
  • Select no scientist required

Labels

  • Review default alert labels
  • Select component(s): installation, external libraries, TIFF, Intel compiler
  • Select priority: high
  • Select requestor(s): external user / support request

Milestone and Projects

  • Select Milestone as the next bugfix version
  • Select Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Select METplus-Wrappers-X.Y.Z Development project for development toward the next official release

Define Related Issue(s)

Consider the impact to the other METplus components.

This issue likely affects MET builds using the Intel oneAPI LLVM compiler stack, specifically when MET’s external library build compiles TIFF from source. It may affect METplus installations that rely on compile_MET_all.sh to build MET and its external dependencies.

Related issue may be needed in:

  • MET
  • METplus
  • METdataio
  • METviewer
  • METexpress
  • METcalcpy
  • METplotpy

Suggested Fix

Update the TIFF build section in compile_MET_all.sh to handle broken or incomplete icpx C++ configuration before running make.

Possible approaches:

  1. Disable TIFF C++ support if it is not required:

    ./configure --prefix=${LIB_DIR} --disable-cxx
  2. Add a preflight C++ compiler test for Intel LLVM builds:

    echo '#include <iostream>
    int main(){ return 0; }' > conftest.cxx
    ${CXX} ${CXXFLAGS} conftest.cxx -o conftest

    If this fails, stop before TIFF configure with a clear message.

  3. If TIFF C++ support is required, document and configure the required system C++ header/toolchain dependency for icpx, or pass the appropriate CXXFLAGS/include paths so icpx can locate the C++ standard library headers.

  4. Treat libtool.m4: error: problem compiling CXX test program during TIFF configure as fatal for builds that leave TIFF C++ support enabled.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_.
    Branch name: bugfix_<Issue Number>_main_<Version>_fix_tiff_icpx_cxx_build
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Add any new Python packages to the METplus Components Python Requirements table.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_.
    Pull request: bugfix <Issue Number> main_<Version> fix TIFF icpx CXX build
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next bugfix version
    Select: Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_fix_tiff_icpx_cxx_build
    Pull request: bugfix <Issue Number> develop fix TIFF icpx CXX build
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next official version
    Select: METplus-Wrappers-X.Y.Z Development project for development toward the next official release
  • Close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions