Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ElmerIce with netCDF in CI on Ubuntu #589

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ jobs:
libqwt-qt5-dev qtscript5-dev libqt5svg5-dev \
libvtk9-qt-dev libglvnd-dev \
occt-misc libocct-data-exchange-dev libocct-draw-dev \
$([ "${{ matrix.mpi }}" == "with" ] && echo "trilinos-all-dev libptscotch-dev")
$([ "${{ matrix.mpi }}" == "with" ] && echo "trilinos-all-dev libptscotch-dev") \
$([ "${{ matrix.mpi }}" == "with" ] && echo "libnetcdff-dev")

- name: configure
# CHOLMOD and rocALUTION require a working OpenMP package. So, disable them for clang.
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindNETCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IF (NETCDF_INCLUDE_DIR AND NETCDF_LIBRARY AND NETCDFF_LIBRARY)
UNSET(NETCDF_FAILMSG)
SET(NETCDFLIB_FOUND TRUE)
SET(NETCDF_INCLUDE_DIR ${NETCDF_INCLUDE_DIR})
SET(NETCDF_LIBRARIES "${NETCDF_LIBRARY};${NETCDFF_LIBRARY}")
SET(NETCDF_LIBRARIES "${NETCDFF_LIBRARY};${NETCDF_LIBRARY}")
ELSE()
SET(NETCDF_FAILMSG "NETCDF libraries not found.")
ENDIF()
Expand Down
66 changes: 33 additions & 33 deletions elmerice/Solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ SET(WITH_ScatteredDataInterpolator FALSE CACHE BOOL "Include ElmerIce ScatteredD
MARK_AS_ADVANCED(WITH_ScatteredDataInterpolator)

# ---------------------- #
# -- NetCDF libraries -- #
# -- netCDF libraries -- #
#----------------------- #
MESSAGE(STATUS "------------------------------------------------")
MESSAGE(STATUS "Elmer/Ice package: Looking for [NetCDF] & [NetCDF Fortran] libraries")
MESSAGE(STATUS "Elmer/Ice package: Looking for [netCDF] & [netCDF Fortran] libraries")

FIND_PACKAGE(NetCDF)
FIND_PACKAGE(NETCDF MODULE)

IF(NetCDF_FOUND)
IF(NETCDF_FOUND)

SET(HAVE_NETCDF TRUE)
MARK_AS_ADVANCED(HAVE_NETCDF)
INCLUDE_DIRECTORIES(${NetCDF_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
ADD_DEFINITIONS(-DHAVE_NETCDF)

MESSAGE(STATUS " NetCDF: " "${NetCDF_FOUND}")
MESSAGE(STATUS " NetCDF_INC: " "${NetCDF_INCLUDE_DIR}")
MESSAGE(STATUS " NetCDF_LIBS: " "${NetCDF_LIBRARIES}")
MESSAGE(STATUS " netCDF: " "${NETCDF_FOUND}")
MESSAGE(STATUS " netCDF_INC: " "${NETCDF_INCLUDE_DIR}")
MESSAGE(STATUS " netCDF_LIBS: " "${NETCDF_LIBRARIES}")
ELSE()
MESSAGE(STATUS "Library not found: >NetCDF_FOUND< ")
MESSAGE(WARNING " \n Missing: >NetCDF_INCLUDE_DIR< , >NetCDF_LIBRARY<, >NetCDFF_LIBRARY< \n some functionalities will be disabled")
ENDIF(NetCDF_FOUND)
MESSAGE(STATUS "Library not found: netCDF ")
MESSAGE(WARNING " \n Missing: <NETCDF_INCLUDE_DIR> , <NETCDF_LIBRARY>, <NETCDFF_LIBRARY> \n some functionalities will be disabled")
ENDIF()

# ---------------------- #
# -- HDF5 libraries -- #
Expand Down Expand Up @@ -60,39 +60,39 @@ ENDIF()
SET(CMAKE_Fortran_MODULE_DIRECTORY
${PROJECT_BINARY_DIR}/fmodules CACHE PATH "Directory for Fortran modules")

SET(ElmerIce_SRC ElmerIceUtils.F90 AIFlowSolve_nlD2.F90 AIFlowSolve_nlS2.F90
CaffeSolver.F90 ComputeDevStress.F90 ComputeEigenValues.F90
ComputeNormal.F90 ComputeStrainRate.F90 DeformationalHeat.F90
EPLSolver.F90 FabricSolve.F90 Flowdepth.F90
ForceToStress.F90 GetHydrostaticLoads.F90 GolfLaw.F90
GroundedSolver.F90 IntegratedVelocity.F90 IDSSolver.F90
PorousSolve.F90 pointwise.F90 SIASolver.F90 SSASolver.F90
ThicknessSolver.F90 TemperateIce.F90 ExportVertically.F90
AdjointSolver.F90 DJDBeta_Adjoint.F90 DJDmu_Adjoint.F90
CostSolver_Adjoint.F90 DJDBeta_Robin.F90 DJDmu_Robin.F90
CostSolver_Robin.F90 m1qn3.F Grid2DInterpolator.F90
SET(ElmerIce_SRC ElmerIceUtils.F90 AIFlowSolve_nlD2.F90 AIFlowSolve_nlS2.F90
CaffeSolver.F90 ComputeDevStress.F90 ComputeEigenValues.F90
ComputeNormal.F90 ComputeStrainRate.F90 DeformationalHeat.F90
EPLSolver.F90 FabricSolve.F90 Flowdepth.F90
ForceToStress.F90 GetHydrostaticLoads.F90 GolfLaw.F90
GroundedSolver.F90 IntegratedVelocity.F90 IDSSolver.F90
PorousSolve.F90 pointwise.F90 SIASolver.F90 SSASolver.F90
ThicknessSolver.F90 TemperateIce.F90 ExportVertically.F90
AdjointSolver.F90 DJDBeta_Adjoint.F90 DJDmu_Adjoint.F90
CostSolver_Adjoint.F90 DJDBeta_Robin.F90 DJDmu_Robin.F90
CostSolver_Robin.F90 m1qn3.F Grid2DInterpolator.F90
Optimize_m1qn3Parallel.F90 OutputStrainHeating.F90 UpdateExport.F90
IntegrateVertically.F90 EnthalpySolver.F90 SubShelfMelt.F90
./Adjoint/Adjoint_LinearSolver.F90 ./Adjoint/Adjoint_CostDiscSolver.F90
./Adjoint/Adjoint_CostContSolver.F90 ./Adjoint/Adjoint_CostRegSolver.F90
./Adjoint/Adjoint_CostContSolver.F90 ./Adjoint/Adjoint_CostRegSolver.F90
./Adjoint/Adjoint_GradientValidation.F90
./AdjointStokes/AdjointStokes_GradientMu.F90
./AdjointStokes/AdjointStokes_GradientBetaSolver.F90
./AdjointStokes/AdjointStokes_GradientMu.F90
./AdjointStokes/AdjointStokes_GradientBetaSolver.F90
./AdjointSSA/AdjointSSA_AdjointSolver.F90 ./AdjointSSA/AdjointSSA_CostDiscSolver.F90
./AdjointSSA/AdjointSSA_CostRegSolver.F90 ./AdjointSSA/AdjointSSA_SSASolver.F90
./AdjointSSA/AdjointSSA_CostContSolver.F90 ./AdjointSSA/AdjointSSA_CostFluxDivSolver.F90
./AdjointSSA/AdjointSSA_CostTaubSolver.F90
./AdjointSSA/AdjointSSA_GradientSolver.F90
./AdjointSSA/AdjointSSA_GradientSolver.F90
./AdjointThickness/AdjointThickness_GradientSolver.F90 ./AdjointThickness/AdjointThickness_ThicknessSolver.F90
./Permafrost/PermafrostMaterials.F90 ./Permafrost/Permafrost_Utils.F90 ./Permafrost/Permafrost_HTEQ.F90
./Permafrost/Permafrost_Darcy.F90 ./Permafrost/Permafrost_solute.F90 ./Permafrost/Permafrost_solid.F90
SurfaceBoundaryEnthalpy.F90
Calving.F90 FrontDisplacement.F90
TwoMeshes.F90 ProjectCalving.F90 ComputeCalvingNormal.F90
Calving.F90 FrontDisplacement.F90
TwoMeshes.F90 ProjectCalving.F90 ComputeCalvingNormal.F90
CalvingGeometry.F90 Calving3D.F90 Calving3D_lset.F90 CalvingGlacierAdvance3D.F90 CalvingRemesh.F90
CalvingFrontAdvance3D.F90 Emergence.F90 SSAmask.F90
CalvingFrontAdvance3D.F90 Emergence.F90 SSAmask.F90
GlaDSCoupledSolver.F90 GlaDSchannelSolver.F90 Flotation.F90
BasalMelt3D.F90 CalvingHydroInterp.F90 HydroRestart.F90
BasalMelt3D.F90 CalvingHydroInterp.F90 HydroRestart.F90
GMValid.F90 Scalar_OUTPUT_Glacier.F90 IcyMaskSolver.F90
Weertman2Coulomb.F90)

Expand Down Expand Up @@ -123,7 +123,7 @@ ENDIF()
ADD_LIBRARY(ElmerIceSolvers SHARED ${ElmerIce_SRC})

# Library object
SET_TARGET_PROPERTIES(ElmerIceSolvers PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(ElmerIceSolvers PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(ElmerIceSolvers PROPERTIES
LINKER_LANGUAGE Fortran
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/fem/src/modules
Expand All @@ -137,7 +137,7 @@ ENDIF()
TARGET_LINK_LIBRARIES(ElmerIceSolvers Elmer::MPI_Fortran elmersolver ElmerIceUtils)

IF(HAVE_NETCDF)
TARGET_LINK_LIBRARIES(ElmerIceSolvers ${NETCDF_LIBRARIES})
TARGET_LINK_LIBRARIES(ElmerIceSolvers ${NETCDF_LIBRARIES})
ENDIF()
IF(HAVE_HDF5)
TARGET_LINK_LIBRARIES(ElmerIceSolvers ${PHDF5_LIBRARIES})
Expand All @@ -164,6 +164,6 @@ INSTALL(TARGETS ElmerIceSolvers LIBRARY DESTINATION "share/elmersolver/lib"
IF(HAVE_NETCDF)
ADD_SUBDIRECTORY(GridDataReader)
ENDIF()
IF(WITH_ScatteredDataInterpolator)
IF(WITH_ScatteredDataInterpolator)
ADD_SUBDIRECTORY(ScatteredDataInterpolator)
ENDIF()
Loading