ImperialCollegeLondon / poreFoam-singlePhase

Direct single-phase flow simulation and pre/post-processing codes
http://www.imperial.ac.uk/earth-science/research/research-groups/perm/research/pore-scale-modelling/
20 stars 17 forks source link

poreFoam does not build on Ubuntu 20.04 #1

Closed kweishaupt closed 3 years ago

kweishaupt commented 3 years ago

@aliraeini : First of all, thanks a lot for sharing your code!

Following the instructions given in the readme pdf, I tried to build and install poreFoam on a laptop running Ubuntu 20.04.

Here is some further info:

Here is a collection of compilation and linker errors:

+ wmake libso scotchDecomp
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file engineScotchDecomp/engineScotchDecomp.C
Making dependency list for source file scotchDecomp/scotchDecomp.C
could not open file scotch.h for source file scotchDecomp/scotchDecomp.C
SOURCE=scotchDecomp/scotchDecomp.C ;  g++ -m64 -std=c++11 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200 -I/usr/include/scotch/     -I../decompositionMethods/lnInclude     -I../../decompositionMethods/lnInclude -IlnInclude -I. -I/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude -I/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/scotchDecomp.o
SOURCE=engineScotchDecomp/engineScotchDecomp.C ;  g++ -m64 -std=c++11 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200 -I/usr/include/scotch/     -I../decompositionMethods/lnInclude     -I../../decompositionMethods/lnInclude -IlnInclude -I. -I/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude -I/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/engineScotchDecomp.o
scotchDecomp/scotchDecomp.C:115:10: fatal error: scotch.h: No such file or directory
  115 | #include "scotch.h"
      |          ^~~~~~~~~~
compilation terminated.
In file included from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H:29,
                 from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.C:26:
fields/fvPatchFields/derived/advective/advectiveFvPatchField.H: In member function ‘bool& Foam::advectiveFvPatchField<Type>::inletOutlet()’:
fields/fvPatchFields/derived/advective/advectiveFvPatchField.H:221:12: error: cannot bind non-const lvalue reference of type ‘bool&’ to an rvalue of type ‘bool’
  221 |     return inletOutlet_;
      |            ^~~~~~~~~~~~
In file included from /home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude/foamTime.H:48,
                 from /home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude/DimensionedField.C:28,
                 from /home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude/DimensionedField.H:341,
                 from lnInclude/fvPatchField.H:48,
                 from lnInclude/mixedFvPatchField.H:38,
                 from lnInclude/mixedFvPatchFields.H:29,
                 from fields/fvPatchFields/derived/advective/advectiveFvPatchField.H:76,
                 from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H:29,
                 from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.C:26:
/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/src/foam/lnInclude/Switch.H:168:3: note:   after user-defined conversion: ‘Foam::Switch::operator bool() const’
  168 |   operator bool() const
      |   ^~~~~~~~
In file included from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H:29,
                 from fields/fvPatchFields/derived/advective/advectiveFvPatchFields.C:26:
fields/fvPatchFields/derived/advective/advectiveFvPatchField.H: In member function ‘bool& Foam::advectiveFvPatchField<Type>::correctSupercritical()’:
fields/fvPatchFields/derived/advective/advectiveFvPatchField.H:234:12: error: cannot bind non-const lvalue reference of type ‘bool&’ to an rvalue of type ‘bool’
  234 |     return correctSupercritical_;
/usr/bin/ld: cannot find -l:libfiniteVolume.ext3.so
collect2: error: ld returned 1 exit status
make[2]: *** [/home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/wmake/Makefile:188: /home/kilian/Downloads/Software/poreFoam-singlePhase/thirdparty/foamx3m/lib/linux64GccDPOpt/libfvMotionSolver.ext3.so] Error 1
aliraeini commented 3 years ago

First sorry for late reply, somehow I am not getting notified on issues, Changed the repo setting and hopefully this will be fixed for future.

I think I have now added the fix in the README file, install prerequisites by running: sudo apt install mpi-default-dev flex libscotch-dev and try make agan.