New location for sacado.hpp

68 views
Skip to first unread message

Matthew Rich

unread,
Jul 7, 2021, 11:41:20 AM7/7/21
to dea...@googlegroups.com
Hi all,

 I am a bit confused on step-33 which uses the differentiation of sacado. I installed the latest version. 9.3 which has trilinios in it, and therefore sacado. Browsing that directory I see other header files for the package but not sacado.hpp

The tutorial has the line
#include <Sacado.hpp>

Was this file renamed or something? I am on Debian and I have installed the trilinios through their package, which does have the header file. However I cannot get the program to work properly.

I am looking for guidance on this issue of getting the right headers in the program so I can run this tutorial and others leveraging the sacado package.

Thanks in advance,

Maty



Jean-Paul Pelteret

unread,
Jul 7, 2021, 12:51:26 PM7/7/21
to dea...@googlegroups.com
Hi Matthew,

I don’t quite understand exactly how you installed deal.II and Trilinos. Perhaps you can provide some more explicit details so that we can help you out.

* Is Trilinos installed using the apt package, and deal.II installed from source? If you built deal.II from source, may you please attach the build logs (summary.log and detailed.log) for us to look at.

* Did you install the Trilinos development packages (e.g. trilinos-dev or libtrilinos-sacado-dev), which should install the headers into a central location?

* When you built deal.II, and it detects Trilinos and Sacado, the following two variable is defined in config.h (this is also output to the console during configuration):
$ cat include/deal.II/base/config.h | grep SACADO
  #define DEAL_II_TRILINOS_WITH_SACADO
Do you see it there? If not, then deal.II did not successfully detect Sacado during configuration, and does not support it. If you try to configure step-33, an error should be emitted that expresses this.

When you #include <Sacado.hpp> then the compiler first looks for this header in the default location for the system, which I think is  /usr/include. If it doesn’t find it there then it looks in some other specific locations that deal.II (through the configured packages) suggests that it goes looking in.

As a side note, there are two new tutorials (step-71 and step-72) that cover the topic of auto-differentiation as well. You might want to consider looking at those before step-33. Step-33 uses Sacado at a low-level, and these two new tutorials introduce some wrappers that we’ve implemented inside the library that make using Sacado a bit more tractable.

Best,
Jean-Paul


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAN3OR9oH-Za8weU3xHrMs5H86VeJffqtnrNxo_xh%3DddjMhc88g%40mail.gmail.com.

Matthew Rich

unread,
Jul 7, 2021, 1:43:08 PM7/7/21
to deal.II User Group
Hi

Thanks for the prompt reply.

Yes I built deal.II from source but libtrilinos-sacado-dev was installed via the debian package and apt (log files attached). I have all the headers in my /usr/include/trilinos directory. Just skimming the summary file it appears that deal.II did not detect sacado. Not sure why not though.

Thanks for the tip on the new tutorials. I will check them out once I get this working.

Matt
summary.log
detailed.log

Matthew Rich

unread,
Jul 7, 2021, 2:11:10 PM7/7/21
to deal.II User Group
So I tried running cmake again to get trilinos picked up. It does not seem to be detected. I even try supplying the directory
with

 cmake -/usr/local ./  -DTRILINOS_DIR=/usr/include/trilinos

But it still does not get detected.

Should I build trilinos from source as well?  I attached another log where I pipe all cmake output to a file

Matt
other.log

Jean-Paul Pelteret

unread,
Jul 7, 2021, 2:15:48 PM7/7/21
to dea...@googlegroups.com
Hi Matthew,

If you look at either log file, then you’ll see that Trilinos was in fact not detected for some reason.

DEAL_II_WITH_TRILINOS = OFF

I’m no longer experienced in building deal.II using apt packages, but it might be that you have to install the entire trilinos-dev to get all of the headers. Some of the modules that Trilinos provides are mandatory, and some like Sacado are optional. It could be that some of the other necessary headers aren’t there for the mandatory modules, and so the configure-time checks for core Trilinos packages cannot pass.

Try that, and if it fails then you can also add this
-DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=“/usr"
 to the cmake command to explicitly state that you want Trilinos enabled. Then if it doesn’t detect it CMake should emit an error and you’ll know for sure that there’s still something wrong. From these lines
there should also be some messages that indicate exactly which modules it could not find.

I hope that this helps.

Best,
Jean-Paul


To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/e81216d4-e6bd-4a66-9196-1cd5d40d436an%40googlegroups.com.
<summary.log><detailed.log>

Jean-Paul Pelteret

unread,
Jul 7, 2021, 2:36:36 PM7/7/21
to dea...@googlegroups.com
Hi again Matthew,

I’ve also found this build log for the Debian deal.II apt package
and you can see that in amongst all of the dependencies are listed the "trilinos-all-dev” and " trilinos-dev” packages. They are meta-packages for all of the development files for Trilinos. I reckon that you should install these packages, and then give it another try. 

Best,
Jean-Paul

Matthew Rich

unread,
Jul 7, 2021, 2:49:39 PM7/7/21
to deal.II User Group
Thanks that worked!

I needed to install the full trilinos-all-dev to get all the packages. I also needed to install libptscotch-dev.

So my last question is what is the difference between a flag being ON vs set up with external dependencies ( which is what trilinos is set at now)

Will I be able to run those tutorials now? or is there still more work to be done.

Thank you for all your help resolving this issue.

Jean-Paul Pelteret

unread,
Jul 7, 2021, 3:16:38 PM7/7/21
to dea...@googlegroups.com
Hi Matthew,

Great, I’m glad to hear that! 

So my last question is what is the difference between a flag being ON vs set up with external dependencies ( which is what trilinos is set at now) 

When you set one of these flags to “ON”, you are demanding from CMake that this option be enabled and expect that the associated package must be set up correctly. Similarly, when the flag is set to “OFF” then the auto-detection for that package will be skipped (and, even if you tell deal.II where that library is by providing its path, it will ignore it anyway). When you leave flag this out altogether  you rely on the auto-detection mechanism to find the package and if it cannot be found (or there’s some detected compatibility issue) then you give CMake the leeway to disable and ignore this package. So, in summary, it just gives the granularity to say “Yes, I definitely want this dependency enabled” or “No, under all circumstances ignore this optional dependency” or “if you find it and it works, then I want this enabled".

When the package is said to be an "external dependency”, then it just means that the user or OS has provided said package. We bundle a few mandatory packages ourselves (e.g. the boost libraries), so that if the user hasn’t got them installed then we can fall back to these packages that are maintained within deal.II itself. 

Will I be able to run those tutorials now? or is there still more work to be done. 

For step-72 and step-33, I’d say yes

But to run step-71 you’ll also need to install SymEngine

I don’t think that there’s an Ubuntu package for that yet, but it’s not too hard to install by hand. You can take a look at their GitHub page for build instructions. At the bottom of the page there is their "Recommended options to build”, which you might want to take note of.

Best,
Jean-Paul

Matthew Rich

unread,
Jul 8, 2021, 1:40:52 PM7/8/21
to deal.II User Group
So I thought I was in good shape. I had cmake run with the proper flags and everything and built deal.ii

But.....

I tried to build step-33 and got the following

-- Using the deal.II-9.3.1 installation found at /usr/local/deal.II
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_add_test.cmake
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_initialize_cached_variables.cmake
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_invoke_autopilot.cmake
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_pickup_tests.cmake
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_query_git_information.cmake
-- Include macro /usr/local/deal.II/share/deal.II/macros/macro_deal_ii_setup_target.cmake
CMake Error at CMakeLists.txt:44 (MESSAGE):
 

  Error! This tutorial requires a deal.II library that was configured with
  the following options:

      DEAL_II_WITH_MUPARSER = ON
      DEAL_II_TRILINOS_WITH_SACADO = ON

  However, the deal.II library found at /usr/local/deal.II was configured
  with these options:

      DEAL_II_WITH_MUPARSER = ON
      DEAL_II_TRILINOS_WITH_SACADO =

  This conflicts with the requirements.


-- Configuring incomplete, errors occurred!
I tried to redo cmake with this DEAL_II_TRILINOS_WITH_SACADO but it doesn't exist. I can run with -DDEAL_II_WITH_TRILINOS=ON but that does not appear to be sufficent. In the log cmake finds Sacado. I am not sure what to do...

Matthew Rich

unread,
Jul 9, 2021, 10:55:09 AM7/9/21
to deal.II User Group
OK now I am finally all set. 

For other people who had this issue I needed to run CMAKE with the following flags....

cmake -/"install dir" /"location of deal.ii source",  -DDEAL_II_WITH_MPI=ON -DDEAL_II_TRILINOS_WITH_SACADO=ON, -DTRILINOS_DIR=/usr/

without the sacado flag it does not work
Reply all
Reply to author
Forward
0 new messages