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

Click For Summary
The discussion revolves around troubleshooting issues with running a C++ code from the oomph-lib computational fluid dynamics software. The user initially encounters errors related to missing files and incorrect compilation commands, leading to confusion about the proper setup. After running the "./configure" and "./autogen.sh" scripts, the user successfully generates a Makefile but struggles with subsequent compilation commands, receiving errors like "Nothing to be done for 'all'" and issues related to dependencies. Suggestions include following the manual installation instructions, ensuring the Makefile points to the correct files, and using "make clean" before re-running "make." The user ultimately aims to run demo codes successfully before attempting to create their own code.
  • #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 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
2K
  • · 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
2K