2018-07-16 17:18 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002802OpenFOAM[All Projects] Bugpublic2018-07-10 11:24
ReporterAriefDahoe 
Assigned Tohenry 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionunable to reproduce 
PlatformIntel i7 QuadcoreOSLinux FedoraOS Version27
Product Versiondev 
Target VersionFixed in Version 
Summary0002802: Compilation error scotchDecomp.C -- OpenFOAM-dev
DescriptionI'm compiling OpenFOAM-dev following the instructions at https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-dev/Fedora

When running the command "./Allwmake -j4 > log.make 2>&1" I'm getting a compilation error on scotchDecomp.C as reproduced in the file log.make copied below in Section Additonal Information.

How can I fix this error?
Steps To ReproduceCompilation scotchDecomp.C
Additional Informationompiling enabled on 4 cores
Allwmake /home/dahoe/OpenFOAM/OpenFOAM-dev
make: Nothing to be done for 'all'.

========================================
Start ThirdParty Allwmake
========================================

========================================
Build MPI libraries if required

========================================
Build Scotch decomposition library scotch_6.0.3
    /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3
    scotch header in /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3/include
    scotch libs in /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/lib

========================================
Build PTScotch decomposition library scotch_6.0.3 (uses MPI)
    /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3

    ptscotch header in /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3/include/openmpi-system
    ptscotch libs in /home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/lib/openmpi-system

========================================
Build Metis decomposition
    optional component Metis was not found
========================================
Build CGAL
    optional component was not found

========================================
Done ThirdParty Allwmake
========================================

Allwmake src
same version as previous build
Allwmake src/Pstream
wmake dummy
wmake mpi
Allwmake libo src/OSspecific/POSIX
    found <sys/inotify.h> -- enabling inotify for file monitoring.
wmake libo .
wmake OpenFOAM
wmake fileFormats
wmake surfMesh
wmake triSurface
wmake meshTools
Allwmake src/dummyThirdParty
wmake scotchDecomp
wmake ptscotchDecomp
wmake metisDecomp
wmake MGridGen
wmake finiteVolume
wmake lagrangian/basic
wmake lagrangian/distributionModels
wmake genericPatchFields
wmake conversion
wmake mesh/extrudeModel
wmake dynamicMesh
wmake sampling
wmake dynamicFvMesh
wmake topoChangerFvMesh
Allwmake src/parallel
Allwmake src/parallel/decompose
    using SCOTCH_ARCH_PATH=/home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3
wmake scotchDecomp
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/include/openmpi-x86_64 -pthread -I/home/dahoe/OpenFOAM/ThirdParty-dev/platforms/linux64GccDPInt64/scotch_6.0.3/include -I/usr/include/scotch -I../decompositionMethods/lnInclude -IlnInclude -I. -I/home/dahoe/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/dahoe/OpenFOAM/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -c scotchDecomp.C -o /home/dahoe/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt64Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o
scotchDecomp.C: In member function ‘Foam::label Foam::scotchDecomp::decomposeOneProc(const Foam::fileName&, const Foam::List<long int>&, const Foam::List<long int>&, const scalarField&, Foam::List<long int>&)’:
scotchDecomp.C:353:9: error: cannot convert ‘Foam::UList<long int>::const_iterator {aka const long int*}’ to ‘const SCOTCH_Num* {aka const int*}’ for argument ‘4’ to ‘int SCOTCH_graphBuild(SCOTCH_Graph*, SCOTCH_Num, SCOTCH_Num, const SCOTCH_Num*, const SCOTCH_Num*, const SCOTCH_Num*, const SCOTCH_Num*, SCOTCH_Num, const SCOTCH_Num*, const SCOTCH_Num*)’
         ),
         ^
scotchDecomp.C:383:79: error: cannot convert ‘Foam::UList<long int>::iterator {aka long int*}’ to ‘const SCOTCH_Num* {aka const int*}’ for argument ‘3’ to ‘int SCOTCH_archCmpltw(SCOTCH_Arch*, SCOTCH_Num, const SCOTCH_Num*)’
             SCOTCH_archCmpltw(&archdat, nProcessors_, processorWeights.begin()),
                                                                               ^
scotchDecomp.C:457:9: error: cannot convert ‘Foam::UList<long int>::iterator {aka long int*}’ to ‘SCOTCH_Num* {aka int*}’ for argument ‘4’ to ‘int SCOTCH_graphMap(SCOTCH_Graph*, const SCOTCH_Arch*, SCOTCH_Strat*, SCOTCH_Num*)’
         ),
         ^
make: *** [/home/dahoe/OpenFOAM/OpenFOAM-dev/wmake/rules/General/transform:26: /home/dahoe/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt64Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o] Error 1
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0009183

henry (reporter)

I am not able to reproduce this problem, I believe it has been reported before and fixed. How recent is your ThirdParty-dev repository? Have you pulled the latest?

~0009184

AriefDahoe (reporter)

The OpenFOAM-dev and ThirdParty-dev repositories were downloaded on 20 December 2017.

~0009185

AriefDahoe (reporter)

I think that the error "cannot convert ‘Foam::UList<long int>::iterator {aka long int*}’ to ‘SCOTCH_Num* {aka int*}" might have to do with the const correctness feature of the C++ programming language. Also, the code segment tries to convert "long int" into "int". Maybe there should be a compiler option that defines both "long int" and "int" as 8 byte integers....?

~0009186

henry (reporter)

I am compiling with

icpc (ICC) 17.0.4 20170411

64bit with 64bit labels and there are no problems.

~0009187

henry (reporter)

The gcc version used to compile scotch is

gcc (SUSE Linux) 7.2.1 20171020 [gcc-7-branch revision 253932]

~0009188

AriefDahoe (reporter)

I'm compiling with "cc (GCC) 7.2.1 20170915"

~0009189

AriefDahoe (reporter)

This is the version of my compiler under Linux Fedora 27:

[dahoe@localhost ~]$ cc --version
cc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

[dahoe@localhost ~]$ g++ --version
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

~0009190

AriefDahoe (reporter)

Meanwhile I've recompiled everything with 32-bit labels instead of 64-bit labels. And everything compiled perfectly. See attached file "log.make"

~0009191

AriefDahoe (reporter)

The new file is called " log-2.make"

~0009192

henry (reporter)

I cannot reproduce this problem with any of the compilers I have.

~0009193

AriefDahoe (reporter)

I will continue with 32-bit labels instead of 64-bit labels. Because then everything compiles perfectly.

The errors with 64-bit labels are probably caused by the integer conversion rules under the C11 standard as described at https://wiki.sei.cmu.edu/confluence/display/c/INT02-C.+Understand+integer+conversion+rules

At https://www.cfd-online.com/Forums/openfoam-installation/148644-build-install-openfoam-dev-64-bits.html I saw that the error can be bypassed with:

   ./Allwmake -k

~0009194

henry (reporter)

I do not see the problem with 64-bit labels with the same compiler that you are using with the standard compiler option. It is not clear why the handling of the C11 stardard would be different for you.
+Notes

-Issue History
Date Modified Username Field Change
2018-01-02 17:36 AriefDahoe New Issue
2018-01-02 17:36 AriefDahoe File Added: log.make
2018-01-02 17:36 AriefDahoe Tag Attached: openfoam-dev
2018-01-02 18:32 henry Note Added: 0009183
2018-01-02 18:39 AriefDahoe Note Added: 0009184
2018-01-02 18:47 AriefDahoe Note Added: 0009185
2018-01-02 18:58 henry Note Added: 0009186
2018-01-02 19:00 henry Note Added: 0009187
2018-01-02 19:03 AriefDahoe Note Added: 0009188
2018-01-02 19:21 AriefDahoe Note Added: 0009189
2018-01-02 19:26 AriefDahoe File Added: log-2.make
2018-01-02 19:26 AriefDahoe Note Added: 0009190
2018-01-02 19:28 AriefDahoe File Added: log-3.make
2018-01-02 19:28 AriefDahoe Note Added: 0009191
2018-01-02 19:45 henry Note Added: 0009192
2018-01-02 21:03 AriefDahoe Note Added: 0009193
2018-01-02 22:46 henry Note Added: 0009194
2018-01-02 22:47 henry Assigned To => henry
2018-01-02 22:47 henry Status new => closed
2018-01-02 22:47 henry Resolution open => unable to reproduce
2018-07-10 11:24 administrator Tag Detached: openfoam-dev
+Issue History