View Issue Details

IDProjectCategoryView StatusLast Update
0003858OpenFOAMPatchpublic2023-04-18 09:28
ReporterTZirwes Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Product Version10 
Fixed in Version10 
Summary0003858: OpenFOAM 10 cannot be compiled with 64 bits labels
DescriptionIn a couple of places, invalid function calls are generated when compiling OpenFOAM 10 with 64 bit labels. A patch is attached that casts some of the literals ("0", "1" and "-1") into the "label" type to resolve the compiler errors.
Steps To ReproduceCompile OpenFOAM 10 with 64 bit labels -> compiler errors occur
Apply the patch and compile again -> compiles without errors
Additional InformationTested on OpenSuse, Ubuntu WSL and RedHat with gcc 7.1 and gcc 11
TagsNo tags attached.

Relationships

has duplicate 0003975 closedhenry Allwmake fails when WM_LABEL_SIZE=64 is set 

Activities

TZirwes

2022-07-13 01:56

reporter  

label64.patch (3,256 bytes)   
diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
index f59de1b49..08fba9063 100644
--- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
+++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C
@@ -520,7 +520,7 @@ Foam::fvMeshStitcher::calculateOwnerOrigBoundaryEdgeParts
         ownerOrigBoundaryEdgeMeshEdge,
         ownerOrigBoundaryEdgeNParts,
         plusEqOp<label>(),
-        0
+        label(0)
     );
     syncTools::syncEdgeList
     (
@@ -642,7 +642,7 @@ void Foam::fvMeshStitcher::applyOwnerOrigBoundaryEdgeParts
         ownerOrigBoundaryEdgeMeshEdge,
         ownerOrigBoundaryEdgeNOrigFaces,
         plusEqOp<label>(),
-        0
+        label(0)
     );
 
     // If debugging, check that face changes are in sync
diff --git a/src/fvMeshStitchers/moving/fvMeshStitchersMoving.C b/src/fvMeshStitchers/moving/fvMeshStitchersMoving.C
index 245cb9399..8b67c4e14 100644
--- a/src/fvMeshStitchers/moving/fvMeshStitchersMoving.C
+++ b/src/fvMeshStitchers/moving/fvMeshStitchersMoving.C
@@ -218,7 +218,7 @@ Foam::labelHashSet Foam::fvMeshStitchers::moving::ownerCoupledCellSet()
         ncb.ownerOrigBoundaryEdgeMeshEdge(),
         ownerOrigBoundaryEdgeNSet,
         plusEqOp<label>(),
-        0
+        label(0)
     );
 
     // Isolate the cells that are edge connected to the owner patches. This
diff --git a/src/meshTools/nonConformalBoundary/nonConformalBoundary.C b/src/meshTools/nonConformalBoundary/nonConformalBoundary.C
index 2f57f33b6..94db684eb 100644
--- a/src/meshTools/nonConformalBoundary/nonConformalBoundary.C
+++ b/src/meshTools/nonConformalBoundary/nonConformalBoundary.C
@@ -400,7 +400,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge() const
             ownerOrigAndProcBoundaryMeshEdges,
             rMap,
             maxEqOp<label>(),
-            -1
+            label(-1)
         );
 
         // Remove all local indexing from the map
diff --git a/src/parallel/parallel/domainDecompositionDecompose.C b/src/parallel/parallel/domainDecompositionDecompose.C
index a07c1b9c1..91edb75d5 100644
--- a/src/parallel/parallel/domainDecompositionDecompose.C
+++ b/src/parallel/parallel/domainDecompositionDecompose.C
@@ -78,7 +78,7 @@ void Foam::domainDecomposition::addInterProcFace
         nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
         interPatchFaces[ownerProc].append(DynamicList<label>());
         subPatchIDs[ownerProc].append(labelList(1, subPatchID));
-        subPatchStarts[ownerProc].append(labelList(1, 0));
+        subPatchStarts[ownerProc].append(labelList(label(1), label(0)));
 
         if (facei != -1 && completeMesh().isInternalFace(facei))
         {
@@ -86,7 +86,7 @@ void Foam::domainDecomposition::addInterProcFace
             nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchi);
             interPatchFaces[nbrProc].append(DynamicList<label>());
             subPatchIDs[nbrProc].append(labelList(1, subPatchID));
-            subPatchStarts[nbrProc].append(labelList(1, 0));
+            subPatchStarts[nbrProc].append(labelList(label(1), label(0)));
         }
     }
     else
label64.patch (3,256 bytes)   

will

2022-07-13 09:29

manager   ~0012673

Thanks for the report. Fixed in version 10 and in dev.

https://github.com/OpenFOAM/OpenFOAM-10/commit/d5b54df1766f2f6a6d268a4c8a60cb7499f80348
https://github.com/OpenFOAM/OpenFOAM-dev/commit/eb7b8763c4ea42239e0cf2f0eb5c72857cc7168d

Issue History

Date Modified Username Field Change
2022-07-13 01:56 TZirwes New Issue
2022-07-13 01:56 TZirwes File Added: label64.patch
2022-07-13 09:29 will Assigned To => will
2022-07-13 09:29 will Status new => resolved
2022-07-13 09:29 will Resolution open => fixed
2022-07-13 09:29 will Fixed in Version => 10
2022-07-13 09:29 will Note Added: 0012673
2023-04-18 09:28 henry Relationship added has duplicate 0003975