[petsc-users] Static Library based app for petsc

Jed Brown jed at jedbrown.org
Tue Aug 24 23:31:22 CDT 2021


PETSc does not "wrap" cout.

Creating a library first, with an executable front-end that most/all initial users will use is generally good design. More users of the library emerge as people try to do more advanced/custom things that are not appropriate to do with the executable.

"Abhishek G.S." <gsabhishek1ags at gmail.com> writes:

> Hi,
> I am trying to develop a static-library-based app using petsc. The
> structure goes as,
> .
> ├── benchmarks
> │   └── Test1
> │       ├── main.cpp
> │       └── Makefile
> └── libTest
>     ├── build

Are build products meant to go into this build/ directory, not under lib/ as you have it?

>     ├── CMakeLists.txt
>     ├── include
>     │   ├── test.cpp

cpp files would usually go under src/ or almost anywhere but in include/

>     │   └── test.h
>     └── lib
>         └── libTest.a
>
> While this code compiles, I am unable to create a minimal working example
> for the same. The aim is to just print "Hello World". Why is it that
> nothing prints?. Is it something to do with the PETSC wrapper for cout?
> Also, I would like to know whether it's a good idea to go ahead with this
> kind of code structure.
>
> Thanks for the help.
>
> Code: https://github.com/gsabhishek/PetscStaticLibraryApp.git
>
> Thanks for the help


More information about the petsc-users mailing list