gerlero / openfoam-app

Native OpenFOAM for macOS
GNU General Public License v3.0
147 stars 9 forks source link

Compiling new solver with wake in $USER-v2112/applications/solvers/ #46

Closed PaulBrss closed 2 years ago

PaulBrss commented 2 years ago

Hi,

First of all, thanks for this project which is more than welcomed on macOS. The compilation is really easy and I ran some tutorials without any problem.

Now, I would like to compile my own solver in ~/OpenFOAM/$USER-v2112/applications/solvers/ with wmake. These warning and errors messages appear:

`warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt] mypimpleFoam.C:82:10: warning: non-portable path to file '"correctPhi.H"'; specified path differs in case from file name on disk [-Wnonportable-include-path]

include "CorrectPhi.H"

     ^~~~~~~~~~~~~~
     "correctPhi.H"

In file included from mypimpleFoam.C:82: ./CorrectPhi.H:1:1: error: C++ requires a type specifier for all declarations CorrectPhi ^ ./CorrectPhi.H:3:5: error: use of undeclared identifier 'U' U, ^ ./CorrectPhi.H:4:5: error: use of undeclared identifier 'phi' phi, ^ ./CorrectPhi.H:5:5: error: use of undeclared identifier 'p' p, ^ ./CorrectPhi.H:8:5: error: use of undeclared identifier 'pimple' pimple ^ In file included from mypimpleFoam.C:82: In file included from ./CorrectPhi.H:11: /Volumes/OpenFOAM-v2112/src/finiteVolume/lnInclude/continuityErrs.H:34:1: error: expected unqualified-id { ^ 2 warnings and 6 errors generated. make: *** [Make/darwin64ClangDPInt32Opt/mypimpleFoam.o] Error 1`

Do you have any idea how to solve this in order to compile my own solver ? Note that I also try to recompile pimpleFoam with a different name in ~/OpenFOAM/$USER-v2112/applications/solvers/ without any success as it gives a similar error. Therefore, the problem does not come from my coded function (I think ?). And off course, my solver compiles on linux (ubuntu).

Regards,

Paul

gerlero commented 2 years ago

That's the compiler assuming that #include "CorrectPhi.H" refers to the correctPhi.H file in your own project (it seemingly behaves this way because you're compiling files that are stored in a case insensitive filesystem–it still emits the warning about it, though), when in fact you want to include the CorrectPhi.H file of OpenFOAM itself. Changing the include directive to #include <CorrectPhi.H> (i.e., angle brackets instead of quotes) seems to point the compiler at the right file (and thus should fix this).

PaulBrss commented 2 years ago

Hi, Thanks you very much for your answer. It does compile now.

Regards, Paul