Error when compiling a deal.II app using Trilinos on Apple M1

54 views
Skip to first unread message

blais...@gmail.com

unread,
Mar 14, 2022, 1:24:48 PM3/14/22
to deal.II User Group
Dear all,
Hope you are well
Using the candi master branch, I succeeded in compiling deal.II using candi. Everything was smooth. I don't know who took care of that, but awesome work.

When trying to compile an example that uses Trilinos (any), I get the following error that arise from an include in Trilinos

Users/blaisb/work/candi/trilinos-release-12-18-1/include/Tpetra_Import_def.hpp:1171:24: error: no member named 'bind1st' in namespace 'std'; did you mean 'boost::container::bind1st'?

                       std::bind1st (std::equal_to<int> (), -1));

                       ^~~~~

/Users/blaisb/work/candi/deal.II-master/include/deal.II/bundled/boost/container/detail/algorithm.hpp:55:24: note: 'boost::container::bind1st' declared here

inline binder1st<Func> bind1st(const Func& func, const T& arg)



Is there a way around this error? Should I try to manually fix it or switch to another trilinos version?

Thanks!

Bruno


Timo Heister

unread,
Mar 14, 2022, 8:57:01 PM3/14/22
to dea...@googlegroups.com
I worked on that. 😃

Interestingly, I didn't see this error in my testing of ASPECT. Are
you saying that a deal.II step like step-32 fails? I think we should
try updating Trilinos first.

Do you want to try 13.2 and see if that works? If not, I will update
the package in candi master when I get to it in a couple of days.
> --
> 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/fc6ad924-8776-4fa8-8a6f-5c96c44a0c47n%40googlegroups.com.

blais...@gmail.com

unread,
Mar 15, 2022, 10:55:35 AM3/15/22
to deal.II User Group
Step-32 worked. I think there was an issue with the way I set-up my dylib. I'll investigate, but it seems that since I was able to run step-32 with MPI, I should be ok on my side also :)
I'll keep you informed if this pops up again.

blais...@gmail.com

unread,
Mar 15, 2022, 10:58:16 AM3/15/22
to deal.II User Group
Still can't get it to work. It seems to be related to a specific Tpetra file:
"Tpetra_Import_def.hpp"
I'll try with a more recent version of Trilinos to see if this fixes thing. Do you think it might be that step-32 does not include this file ?

Timo Heister

unread,
Mar 15, 2022, 11:10:11 AM3/15/22
to dea...@googlegroups.com
What program causes the error? Can you post the complete error output?

Updating might help, yes. std::bind1st was removed in c++17 and so
trilinos needs to be updated.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/7f7277e9-5279-4bba-9bab-e75afb05986an%40googlegroups.com.



--
Timo Heister
http://www.math.clemson.edu/~heister/

Wolfgang Bangerth

unread,
Mar 15, 2022, 7:41:49 PM3/15/22
to dea...@googlegroups.com
On 3/14/22 11:24, blais...@gmail.com wrote:
> *Users/blaisb/work/candi/trilinos-release-12-18-1/include/Tpetra_Import_def.hpp:1171:24:
> **error: **no member named 'bind1st' in namespace 'std'; did you mean
> 'boost::container::bind1st'?*
>
>                        std::bind1st (std::equal_to<int> (), -1));
>
> *                       ^~~~~*
>

For reference, std::bind1st() is a function that was deprecated with C++11 and
removed with C++17. So if you have a compiler that defaults to C++17, then the
function will no longer exist -- you might want to check what compiler you are
using, and if you can pass -std=c++14 as a flag to "downgrade" it to C++14.

I looked around a little bit, and others have run into similar errors. See
here, for example:
https://github.com/dealii/dealii/issues/6125
On second read, this is actually one of our own github issues :-) But I also
looked into the current Trilinos sources and the file no longer contains the
call to bind1st:

https://github.com/trilinos/Trilinos/blob/master/packages/tpetra/core/src/Tpetra_Import_def.hpp#L1178-L1180
So you might be best served with just using a newer version of Trilinos.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Wolfgang Bangerth

unread,
Mar 15, 2022, 7:42:53 PM3/15/22
to dea...@googlegroups.com
On 3/14/22 11:24, blais...@gmail.com wrote:
> *Users/blaisb/work/candi/trilinos-release-12-18-1/include/Tpetra_Import_def.hpp:1171:24:
> **error: **no member named 'bind1st' in namespace 'std'; did you mean
> 'boost::container::bind1st'?*
>
>                        std::bind1st (std::equal_to<int> (), -1));
>
> *                       ^~~~~*
>

The patch to Trilinos is here:

https://github.com/trilinos/Trilinos/commit/285bbae1720f2cb4379e43ed338dbd2a23bf8ea6
It was committed in November of last year as part of
https://github.com/trilinos/Trilinos/pull/9960

blais...@gmail.com

unread,
Mar 15, 2022, 9:43:25 PM3/15/22
to deal.II User Group
Ohh but that explains everything. In the application that I am trying to compile we set the standard to CXX17 hence it must be forcing the compiler to do so.
Everything is clear with this. Thank you so much :)!
Again, amazing work on the whole candi endeavour.
Reply all
Reply to author
Forward
0 new messages