Running a C++ code from oomph-lib (a CFD software)

Click For Summary

Discussion Overview

The discussion revolves around running a C++ code using the oomph-lib computational fluid dynamics software. Participants are exploring the compilation process, troubleshooting installation issues, and seeking guidance on executing demo codes provided with the software.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant attempts to compile a C++ file directly using gcc and encounters include errors, suggesting a misunderstanding of the compilation process.
  • Another participant explains the importance of a makefile for compilation and indicates that the build path may not be set up correctly.
  • Several participants suggest following the installation guide and checking for errors in the autogen script.
  • There is mention of a missing 'build' directory, which is expected according to the installation instructions, leading to suggestions for a manual installation approach.
  • One participant reports that after running the manual installation, everything seems to be functioning well, but they express uncertainty about rerunning the autogen script.
  • Another participant proposes copying and editing the Makefile from the demo codes to run a new problem, indicating a potential workaround for the participant's issue.
  • There are discussions about errors encountered when rerunning the make command and suggestions to use "make clean" to resolve issues.
  • One participant expresses confusion about the compilation process and seeks advice on how to proceed after encountering errors.

Areas of Agreement / Disagreement

Participants generally agree on the importance of using a makefile for compilation, but there is no consensus on the best approach to resolve the specific issues faced by the original poster. Multiple competing views on troubleshooting and installation steps remain present.

Contextual Notes

Participants mention various installation scripts and files, but there are unresolved questions regarding the specific configurations and steps needed to successfully compile and run the codes. The discussion reflects uncertainty about the installation process and the implications of different commands.

  • #31
You can see what the -k option does by just going to the manual. In Linux, the manual for any command is found by typing 'man'. So if you type:

man make

it will tell you the options. What make check does is determined by what's in the Makefile. I suspect it runs all of the various codes, which you don't want to do. So let's say you edited the file called joes_poisson_code.cc. When you type:

make -k

it should make the new executable, which will probably be called joes_poisson_code. You want to run this code and not all of the others. So just type:

./joes_poisson_code

and this should run just that piece of code.
 
  • Like
Likes   Reactions: member 428835
Technology news on Phys.org
  • #32
phyzguy said:
You can see what the -k option does by just going to the manual. In Linux, the manual for any command is found by typing 'man'. So if you type:

man make

it will tell you the options. What make check does is determined by what's in the Makefile. I suspect it runs all of the various codes, which you don't want to do. So let's say you edited the file called joes_poisson_code.cc. When you type:

make -k

it should make the new executable, which will probably be called joes_poisson_code. You want to run this code and not all of the others. So just type:

./joes_poisson_code

and this should run just that piece of code.
Thanks for this! I appreciate it!

So I still haven't made my new user code, but I'm easily able to change the demo code and re-run it. The trick was to delete the executable, run " make check " in the directory with the .cc file, and then everything runs well.

Thanks so much for your help on this! I'll write if I have more questions, but you've helped so much!

I should add that you are correct: make check runs all the codes in the directory, but since there are only two, and one take about 5 seconds to run, it's not an issue. However, running make gives me errors, so I have to run make check.
 
Last edited by a moderator:
  • #33
joshmccraney said:
Thanks for this! I appreciate it!

So I still haven't made my new user code, but I'm easily able to change the demo code and re-run it. The trick was to delete the executable, run " make check " in the directory with the .cc file, and then everything runs well.

Thanks so much for your help on this! I'll write if I have more questions, but you've helped so much!

I should add that you are correct: make check runs all the codes in the directory, but since there are only two, and one take about 5 seconds to run, it's not an issue. However, running make gives me errors, so I have to run make check.
Glad I could help. Keep at it!
 
  • #34
joshmccraney said:
Thanks for this! I appreciate it!

So I still haven't made my new user code, but I'm easily able to change the demo code and re-run it. The trick was to delete the executable, run " make check " in the directory with the .cc file, and then everything runs well.

Thanks so much for your help on this! I'll write if I have more questions, but you've helped so much!

I should add that you are correct: make check runs all the codes in the directory, but since there are only two, and one take about 5 seconds to run, it's not an issue. However, running make gives me errors, so I have to run make check.
Hello @joshmccraney !
I'm trying to install oomph-lib too but I'm facing the same issue with

fatal error: generic.h: No such file or directory

I attempted to resolve this by providing the -L directory to the generic.h file in the Makefile.am but to no avail.

What do you mean by "deleting the executable"?

By the way, when I tried running make check -k after installation in the top-level directory oomph-lib all tests failed because they could not locate the generic.h file.

I've installed oomph-lib in my system via Docker Ubuntu following this link (I could not install it properly either on Mac OS Monterey and faced the same generic.h error). Thank you so much!
 
  • #35
I'm sorry, this was 3 years ago and I can't recall. I ended up using OpenFOAM for simulations. Best of luck
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K