Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package fail to install on mac-os systems (apple-clang) #3

Closed
AlePalu opened this issue Dec 1, 2023 · 3 comments
Closed

package fail to install on mac-os systems (apple-clang) #3

AlePalu opened this issue Dec 1, 2023 · 3 comments

Comments

@AlePalu
Copy link
Member

AlePalu commented Dec 1, 2023

Installing the R package on a mac-os system makes the compilation fail. Error reported:

In file included from R_Model.cpp:23:
   In file included from fdaPDE/fdaPDE/models.h:20:
   In file included from fdaPDE/fdaPDE/models/model_base.h:20:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/mesh.h:20:
   fdaPDE/fdaPDE/core/fdaPDE/mesh/mesh.h:202:56: error: declaration of 'N' shadows template parameter
       static constexpr bool is_manifold = is_manifold<M, N>::value;
                                                          ^
   fdaPDE/fdaPDE/core/fdaPDE/mesh/mesh.h:59:22: note: template parameter is declared here
   template <int M, int N> class Mesh {
                        ^
   fdaPDE/fdaPDE/core/fdaPDE/mesh/mesh.h:202:56: error: default initialization of an object of const type 'const bool'
       static constexpr bool is_manifold = is_manifold<M, N>::value;
                                                          ^
                                                            = false
   fdaPDE/fdaPDE/core/fdaPDE/mesh/mesh.h:202:57: error: expected ';' at end of declaration list
       static constexpr bool is_manifold = is_manifold<M, N>::value;
                                                           ^
                                                           ;
   In file included from R_Model.cpp:23:
   In file included from fdaPDE/fdaPDE/models.h:20:
   In file included from fdaPDE/fdaPDE/models/model_base.h:21:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/utils.h:24:
   fdaPDE/fdaPDE/core/fdaPDE/utils/type_erasure.h:222:28: error: use 'template' keyword to treat 'fn_ptrs' as a dependent template name
           size_ = (size<typename I::fn_ptrs<T_>>::value + ...);
                                     ^
                                     template 
   fdaPDE/fdaPDE/core/fdaPDE/utils/type_erasure.h:225:55: error: use 'template' keyword to treat 'fn_ptrs' as a dependent template name
           init_vtable<0, T_>(typename merge<typename I::fn_ptrs<T_>...>::type(), vtable_);
                                                         ^
                                                         template 
   fdaPDE/fdaPDE/core/fdaPDE/utils/type_erasure.h:230:67: error: use 'template' keyword to treat 'fn_ptrs' as a dependent template name
               base_ += size<typename std::decay<decltype(i)>::type::fn_ptrs<T_>>::value;
                                                                     ^
                                                                     template 
   In file included from R_Model.cpp:23:
   In file included from fdaPDE/fdaPDE/models.h:20:
   In file included from fdaPDE/fdaPDE/models/model_base.h:22:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/pde.h:20:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/pde/pde.h:29:
   fdaPDE/fdaPDE/core/fdaPDE/pde/differential_operators.h:48:51: error: template template argument has different template parameters than its corresponding template template parameter
       static constexpr bool value = has_instance_of<dT, decltype(std::declval<E>().get_operator_type())>::value;
                                                     ^
   fdaPDE/fdaPDE/core/fdaPDE/pde/differential_operators.h:36:1: note: too many template parameters in template template argument
   FDAPDE_DEFINE_DIFFERENTIAL_OPERATOR(dT,          dt         );
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fdaPDE/fdaPDE/core/fdaPDE/pde/differential_operators.h:28:5: note: expanded from macro 'FDAPDE_DEFINE_DIFFERENTIAL_OPERATOR'
       template <typename T, typename... Ts> class OP { };                                                                \
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fdaPDE/fdaPDE/core/fdaPDE/utils/traits.h:58:11: note: previous template template parameter is here
   template <template <typename F> typename E, typename Tuple> struct has_instance_of { };
             ^~~~~~~~~~~~~~~~~~~~~
   In file included from R_Model.cpp:23:
   In file included from fdaPDE/fdaPDE/models.h:20:
   In file included from fdaPDE/fdaPDE/models/model_base.h:22:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/pde.h:20:
   In file included from fdaPDE/fdaPDE/core/fdaPDE/pde/pde.h:29:
   fdaPDE/fdaPDE/core/fdaPDE/pde/differential_operators.h:48:27: error: default initialization of an object of const type 'const bool'
       static constexpr bool value = has_instance_of<dT, decltype(std::declval<E>().get_operator_type())>::value;
                             ^
                                   = false

Problem seems related to some apple-clang aspects which are ignored when compiling with gcc.

Compiler details:

─  installing source package ‘fdaPDE2’ ...
   ** using staged installation
   ** libs
   using C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
   using C++17
   using SDK: ‘MacOSX14.0.sdk’
@AlePalu
Copy link
Member Author

AlePalu commented Dec 4, 2023

fdaPDE/fdaPDE-core@52ea8b3 solves the problem for the fdaPDE-core library

@AlePalu
Copy link
Member Author

AlePalu commented Dec 5, 2023

fdaPDE/fdaPDE-cpp@d197e82 solves the compilation problem also for the fdaPDE-cpp library. Waiting for an installation test of the R package on an actual macOS system.

@AlePalu
Copy link
Member Author

AlePalu commented Dec 13, 2023

Solved.

@AlePalu AlePalu closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant