-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wmake error when compiling my own boundary condition #87
Comments
This looks like a case of different compilers having slightly different behaviors: Clang (the system compiler on macOS) is refusing to compile the code because it finds an ambiguity when applying the required type conversions, while GCC (the default compiler on Linux, including Docker) does not see the same code as ambiguous. In this case, initializing scalarField ycoord {2 * ((c - ctr) & y_) / ((bb.max() - bb.min()) & y_)}; |
I just tried your fix, and it now compiles and the boundary condition runs as expected. I also tried replacing Thank you so much! |
You're welcome.
|
While my first college programming class used punch cards and I have done a lot of programming over the course of my academic career, I haven't done much with C++ so I'm still a newbie when it comes to anything beyond just surface issues. I therefore really appreciate your comments and suggestions, especially since Openfoam is such a well-developed software system that makes intensive use of C++ features, and is therefore somewhat daunting to dive into. 😄 |
JFYI HiSA contributor shows another approach - "changed from initialiser assignment to copy construction" |
It's just the equals sign that you don't want there (FWIW the equals sign does "copy initialization" instead of "direct initialization", which has different semantics). Braces vs. parentheses is a different discussion and mostly (although not always!) a matter of the project's style. More details here. |
Thank you so much for making this project available! I have come across the following issue:
I just brew installed openfoam2206, started it up, and tried to use wmake to compile my own boundary condition (which compiles fine when I use your openfoam-docker-arm docker image--thanks for that project too!) and got this error:
It looks like there is a problem trying to create a variable of type
scalarField
(ycoord
), which is necessary for my boundary condition. For some reason the variable type is not being accepted (compiler flag issue?). Is there a way to get this to work? By the way, the same error occurs with openfoam2112, which I also brew installed.Also, I have the latest XCode version (13.4.1), command line tools, and system software (macOS Monterey 12.5.1) installed on my MacBook Pro M1 Max.
The text was updated successfully, but these errors were encountered: