WENO-OF / WENOEXT

Weighted essentially non-oscillatory library for the framework of OpenFOAM
GNU General Public License v3.0
124 stars 64 forks source link

Compile errors #7

Closed songbaiyao closed 3 years ago

songbaiyao commented 3 years ago

Platform: OpenFOAM 5.x/v1912 g++/gcc version: 7.5

I found the following errors in compiling the code:

Current OpenFOAM version is 5.x.
This is a clean install
OpenFOAM-version: Major 5 Minor 0 Patch 0 (-1 == x / 0) Fork: org
No versionRules/foamVersion4weno.H. Generating!

Please include the output above when reporting a problem in the compilation. It helps diagnosing the problem    

wmake libso libWENOEXT
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file makeWENOCentredFit.C
Making dependency list for source file makeWENOHybrid.C
Making dependency list for source file makeWENOUpwindFit.C
Making dependency list for source file reconstructRegionalMesh.C
Making dependency list for source file matrixDB.C
Making dependency list for source file globalfvMesh.C
Making dependency list for source file WENOBase.C
Making dependency list for source file geometryWENO.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOBase/geometryWENO/geometryWENO.C -o Make/linux64GccDPInt32Opt/WENOBase/geometryWENO/geometryWENO.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOBase/WENOBase.C -o Make/linux64GccDPInt32Opt/WENOBase/WENOBase.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOBase/globalfvMesh.C -o Make/linux64GccDPInt32Opt/WENOBase/globalfvMesh.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOBase/matrixDB.C -o Make/linux64GccDPInt32Opt/WENOBase/matrixDB.o
WENOBase/matrixDB.C: In member function ‘std::multimap<int, blaze::DynamicMatrix<double> >::const_iterator Foam::matrixDB::similar(const scalarRectangularMatrix&&)’:
WENOBase/matrixDB.C:120:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (blaze::size(cmpA) == A.size())
             ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOBase/reconstructRegionalMesh.C -o Make/linux64GccDPInt32Opt/WENOBase/reconstructRegionalMesh.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOUpwindFit/makeWENOUpwindFit.C -o Make/linux64GccDPInt32Opt/WENOUpwindFit/makeWENOUpwindFit.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOHybrid/makeWENOHybrid.C -o Make/linux64GccDPInt32Opt/WENOHybrid/makeWENOHybrid.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -c WENOCentredFit/makeWENOCentredFit.C -o Make/linux64GccDPInt32Opt/WENOCentredFit/makeWENOCentredFit.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -Wno-deprecated -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/dynamicMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/triSurface/lnInclude  -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/surfMesh/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/fileFormats/lnInclude -DGIT_BUILD=\"2.1\" -std=c++14 -I../versionRules -I../blaze-3.8 -IlnInclude -I. -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/sy/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/WENOBase/geometryWENO/geometryWENO.o Make/linux64GccDPInt32Opt/WENOBase/WENOBase.o Make/linux64GccDPInt32Opt/WENOBase/globalfvMesh.o Make/linux64GccDPInt32Opt/WENOBase/matrixDB.o Make/linux64GccDPInt32Opt/WENOBase/reconstructRegionalMesh.o Make/linux64GccDPInt32Opt/WENOUpwindFit/makeWENOUpwindFit.o Make/linux64GccDPInt32Opt/WENOHybrid/makeWENOHybrid.o Make/linux64GccDPInt32Opt/WENOCentredFit/makeWENOCentredFit.o -L/home/sy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib \
    -ldynamicMesh -ltriSurface -lfiniteVolume -lmeshTools -lspecie -lsurfMesh -lfileFormats -lOpenFOAM  -o /home/sy/OpenFOAM/sy-5.x/platforms/linux64GccDPInt32Opt/lib/libWENOEXT.so
/usr/bin/ld: cannot find -ldynamicMesh
/usr/bin/ld: cannot find -ltriSurface
/usr/bin/ld: cannot find -lfiniteVolume
/usr/bin/ld: cannot find -lmeshTools
/usr/bin/ld: cannot find -lspecie
/usr/bin/ld: cannot find -lsurfMesh
/usr/bin/ld: cannot find -lfileFormats
/usr/bin/ld: cannot find -lOpenFOAM
collect2: error: ld returned 1 exit status
/home/sy/OpenFOAM/OpenFOAM-5.x/wmake/makefiles/general:167: recipe for target '/home/sy/OpenFOAM/sy-5.x/platforms/linux64GccDPInt32Opt/lib/libWENOEXT.so' failed
make: *** [/home/sy/OpenFOAM/sy-5.x/platforms/linux64GccDPInt32Opt/lib/libWENOEXT.so] Error 1
JanGaertner commented 3 years ago

Reproducing the error message with OpenFOAM 5.x and gcc version 7.5.0 gave following error message:

In file included from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/List.H:309:0,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/Istream.H:184,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/ISstream.H:39,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/IOstreams.H:38,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/VectorSpace.C:27,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/VectorSpace.H:229,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/Vector.H:44,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/vector.H:39,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/fieldTypes.H:35,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/volFieldsFwd.H:37,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:39,
                 from /home/sy/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/linear.H:38,
                 from WENOBase/WENOBase.H:42,
                 from WENOBase/WENOBase.C:31:
/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/List.C: In instantiation of ‘Foam::List<T>::List(InputIterator, InputIterator) [with InputIterator = int; T = long int]’:
WENOBase/WENOBase.C:1091:28:   required from here
/home/sy/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/List.C:211:39: error: no matching function for call to ‘distance(int&, int&)’
     List<T>(first, last, std::distance(first, last))

This is resolved by not initializing the labelList dummyList in WENOBase::setDegreeOfFreedom()