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

clang-40 fails to build it with a lot of errors #271

Open
yurivict opened this issue Jan 6, 2018 · 7 comments
Open

clang-40 fails to build it with a lot of errors #271

yurivict opened this issue Jan 6, 2018 · 7 comments

Comments

@yurivict
Copy link

yurivict commented Jan 6, 2018

I am building the fork barche/coolfluid3 rev.f1bdfb6 and am getting these errors on FreeBSD 11.1:

In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/all_to_all.hpp:17:
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:43:81: error: cannot initialize return object of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
template <typename T> inline Datatype get_mpi_datatype_impl(const T& ) { return nullptr; };
                                                                                ^~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:52:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:64:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/reduce.hpp:17:
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/operations.hpp:45:23: error: cast from pointer to smaller type 'cf3::common::PE::Operation' (aka 'int') loses information
  static Operation op((Operation)nullptr);
                      ^~~~~~~~~~~~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/operations.hpp:46:11: error: cast from pointer to smaller type 'cf3::common::PE::Operation' (aka 'int') loses information
  if (op==(Operation)nullptr) {
          ^~~~~~~~~~~~~~~~~~
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/all_to_all.hpp:17:
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:43:81: error: cannot initialize return object of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
template <typename T> inline Datatype get_mpi_datatype_impl(const T& ) { return nullptr; };
                                                                                ^~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:52:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:64:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/operations.hpp:45:23: error: cast from pointer to smaller type 'cf3::common::PE::Operation' (aka 'int') loses information
  static Operation op((Operation)nullptr);
                      ^~~~~~~~~~~~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/operations.hpp:46:11: error: cast from pointer to smaller type 'cf3::common::PE::Operation' (aka 'int') loses information
  if (op==(Operation)nullptr) {
          ^~~~~~~~~~~~~~~~~~
--- cf3/common/CMakeFiles/coolfluid_common.dir/all ---
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/Action.cpp:9:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/Builder.hpp:16:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/Core.hpp:14:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/CommonAPI.hpp:12:
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/CF.hpp:151:41: error: invalid operands to binary expression ('int' and 'nullptr_t')
bool is_not_null ( T ptr ) { return ptr != nullptr; }
                                    ~~~ ^  ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/Comm.hpp:83:74: note: in instantiation of function template specialization 'cf3::is_not_null<int>' requested here
  bool is_active() const { return is_initialized() && !is_finalized() && is_not_null(m_comm); }
                                                                         ^
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/all_to_all.hpp:17:
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/datatype.hpp:51:49: error: invalid operands to binary expression ('cf3::common::PE::Datatype' (aka 'int') and 'nullptr_t')
  if (detail::get_mpi_datatype_impl(ref_of_type)!=nullptr) return detail::get_mpi_datatype_impl<T>(ref_of_type);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/all_reduce.hpp:65:21: note: in instantiation of function template specialization 'cf3::common::PE::get_mpi_datatype<unsigned int>' requested here
    Datatype type = get_mpi_datatype(*in_values);
                    ^
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/all_reduce.hpp:127:11: note: in instantiation of function template specialization 'cf3::common::PE::detail::all_reduce_impl<unsigned int, cf3::common::PE::plus>' requested here
  detail::all_reduce_impl(comm,op,in_values,in_n,0,out_buf,0,stride);
          ^
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/PE/Comm.hpp:284:16: note: in instantiation of function template specialization 'cf3::common::PE::all_reduce<unsigned int, cf3::common::PE::plus>' requested here
    return PE::all_reduce(communicator(), op, in_values, in_n, out_values, stride);
               ^
/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/solver/actions/Proto/NodeData.hpp:122:36: note: in instantiation of function template specialization 'cf3::common::PE::Comm::all_reduce<unsigned int, cf3::common::PE::plus>' requested here
      common::PE::Comm::instance().all_reduce(common::PE::plus(), &my_sync, 1, &global_sync);
                                   ^
@yurivict
Copy link
Author

yurivict commented Jan 9, 2018

@barche Jan, are you able to fix this?
I was going to create a FreeBSD port for coolfluid3.
Are you interested to help and fix the build issues?

Thanks!
Yuri

@barche
Copy link
Member

barche commented Jan 9, 2018

Hi Yuri,

Could you check with my fork and see if that builds? I've built it recently on MacOS.

Cheers,

Bart

@yurivict
Copy link
Author

yurivict commented Jan 9, 2018

Yes, I was building from your fork. Just created the bug here, because over there there is no bug page.
So the above errors are for your fork.

Cheers,
Yuri

barche added a commit to barche/coolfluid3 that referenced this issue Jan 11, 2018
@barche
Copy link
Member

barche commented Jan 11, 2018

Aha, missed that, it was only on the first line of your comment :)

I've not been able to reproduce the issue, but maybe something went wrong in the nullptr detection, which I deactivated in the latest commit.

@yurivict
Copy link
Author

In this line

/usr/ports/science/coolfluid3/work/coolfluid3-f1bdfb6/cf3/common/CF.hpp:151:41: error: invalid operands to binary expression ('int' and 'nullptr_t')
bool is_not_null ( T ptr ) { return ptr != nullptr; }

it looks like T is int.

I would love to port this project to FreeBSD. Fluids, physics - sounds very interesting. :-)

barche added a commit to barche/coolfluid3 that referenced this issue Jan 14, 2018
@barche
Copy link
Member

barche commented Jan 14, 2018

OK, hopefully my latest commit fixes this :)

@yurivict
Copy link
Author

Rev. dce73eb still has this error:

--- cf3/common/CMakeFiles/coolfluid_common.dir/all ---
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/ActionDirector.cpp:8:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/Builder.hpp:21:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/Log.hpp:12:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/LogStream.hpp:14:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/PE/Comm.hpp:17:
In file included from /usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/PE/all_to_all.hpp:17:
/usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/PE/datatype.hpp:43:81: error: cannot initialize return object of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
template <typename T> inline Datatype get_mpi_datatype_impl(const T& ) { return nullptr; };
                                                                                ^~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/PE/datatype.hpp:52:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~
/usr/ports/science/coolfluid3/work/coolfluid3-dce73eb/cf3/common/PE/datatype.hpp:64:19: error: cannot initialize a variable of type 'cf3::common::PE::Datatype' (aka 'int') with an rvalue of type 'nullptr_t'
  static Datatype type(nullptr);
                  ^    ~~~~~~~

waralex26 pushed a commit to waralex26/coolfluid3 that referenced this issue Mar 12, 2019
waralex26 pushed a commit to waralex26/coolfluid3 that referenced this issue Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants