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

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
34 replies · 6K views
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
Physics news on Phys.org
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:
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!
 
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!
 
I'm sorry, this was 3 years ago and I can't recall. I ended up using OpenFOAM for simulations. Best of luck