Skip to content

NETCDF causing error in Docker build with DAGMC and libmesh enabled #3695

@aditya-gts

Description

@aditya-gts

Bug Description

While trying to build a docker image using instructions in the Docker file, the build failed when in step while executing the following Dockerfile command:
RUN if [ "$build_dagmc" = "on" ]; then
# Install addition packages required for DAGMC
apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev
&& pip install --upgrade numpy
&& pip install --no-cache-dir setuptools cython
# Clone and install EMBREE
&& mkdir -p $HOME/EMBREE && cd $HOME/EMBREE
&& git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO}
&& mkdir build && cd build
&& cmake ../embree
-DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR}
-DEMBREE_MAX_ISA=NONE
-DEMBREE_ISA_SSE42=ON
-DEMBREE_ISPC_SUPPORT=OFF
&& make 2>/dev/null -j${compile_cores} install
&& rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ;
# Clone and install MOAB
mkdir -p $HOME/MOAB && cd $HOME/MOAB
&& git clone --single-branch -b ${MOAB_TAG} --depth 1 ${MOAB_REPO}
&& mkdir build && cd build
&& cmake ../moab -DCMAKE_BUILD_TYPE=Release
-DENABLE_HDF5=ON
-DENABLE_NETCDF=ON
-DBUILD_SHARED_LIBS=OFF
-DENABLE_FORTRAN=OFF
-DENABLE_BLASLAPACK=OFF
&& make 2>/dev/null -j${compile_cores} install
&& cmake ../moab
-DENABLE_PYMOAB=ON
-DBUILD_SHARED_LIBS=ON
&& make 2>/dev/null -j${compile_cores} install
&& cd pymoab && bash install.sh
&& python setup.py install
&& python -c "import pymoab"
&& rm -rf $HOME/MOAB ;
# Clone and install Double-Down
mkdir -p $HOME/Double_down && cd $HOME/Double_down
&& git clone --single-branch -b ${DD_TAG} --depth 1 ${DD_REPO}
&& mkdir build && cd build
&& cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR}
-DMOAB_DIR=/usr/local
-DEMBREE_DIR=${EMBREE_INSTALL_DIR}
&& make 2>/dev/null -j${compile_cores} install
&& rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ;
# Clone and install DAGMC
mkdir -p $HOME/DAGMC && cd $HOME/DAGMC
&& git clone --single-branch -b ${DAGMC_BRANCH} --depth 1 ${DAGMC_REPO}
&& mkdir build && cd build
&& cmake ../DAGMC -DBUILD_TALLY=ON
-DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR}
-DMOAB_DIR=/usr/local
-DDOUBLE_DOWN=ON
-DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib
-DBUILD_STATIC_LIBS=OFF
&& make 2>/dev/null -j${compile_cores} install
&& rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ;
fi

Identified relevant section in the logs:
#9 252.7 CMake Warning (dev) at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:438 (message): #9 252.7 The package name passed to `find_package_handle_standard_args` (HDF5) does #9 252.7 not match the name of the calling package (HDF5_MOAB). This can lead to #9 252.7 problems in calling code that expects `find_package` result variables #9 252.7 (e.g., `_FOUND`) to follow a certain pattern. #9 252.7 Call Stack (most recent call first): #9 252.7 config/FindHDF5_MOAB.cmake:164 (find_package_handle_standard_args) #9 252.7 CMakeLists.txt:352 (find_package) #9 252.7 This warning is for project developers. Use -Wno-dev to suppress it. #9 252.7 #9 252.7 -- Found HDF5: /usr/include/hdf5/serial #9 252.7 CMake Warning (dev) at CMakeLists.txt:373 (find_package): #9 252.7 Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT #9 252.7 variables. Run "cmake --help-policy CMP0144" for policy details. Use the #9 252.7 cmake_policy command to set the policy and suppress this warning. #9 252.7 #9 252.7 CMake variable NETCDF_ROOT is set to: #9 252.7 #9 252.7 /usr #9 252.7 #9 252.7 For compatibility, find_package is ignoring the variable, but code in a #9 252.7 .cmake module might still use it. #9 252.7 This warning is for project developers. Use -Wno-dev to suppress it. #9 252.7 #9 252.7 finding NetCDF failed, please try to set the var NETCDF_ROOT #9 252.7 CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message): #9 252.7 NetCDF not found, check the CMake NETCDF_ROOT variable (missing: #9 252.7 NETCDF_INCLUDES NETCDF_LIBRARIES) #9 252.7 Call Stack (most recent call first): #9 252.7 /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) #9 252.7 config/FindNetCDF.cmake:74 (find_package_handle_standard_args) #9 252.7 CMakeLists.txt:373 (find_package) #9 252.7 #9 252.7 #9 252.7 -- Configuring incomplete, errors occurred!

Note - Build completes when DENABLE_NETCDF flag is set to OFF.

Steps to Reproduce

  1. git clone https://github.com/openmc-dev/openmc.git
  2. cd openmc
  3. docker build -t openmc_dagmc_libmesh --build-arg build_dagmc=on --build-arg build_libmesh=on --build-arg compile_cores=4 .
  4. Build fails while building dependencies

Note: for better logs use flag --progress=plain with docker build

Environment

OS - MAC OS 26.1
OpenMC version - 0.15.3
Building from Dockerfile comment:
docker build -t openmc_dagmc_libmesh --build-arg build_dagmc=on --build-arg build_libmesh=on --build-arg compile_cores=4 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions