Skip to content

MAINT: Minor compiler fixes#10

Open
HaoZeke wants to merge 2 commits intolab-cosmo:masterfrom
HaoZeke:minorFixes
Open

MAINT: Minor compiler fixes#10
HaoZeke wants to merge 2 commits intolab-cosmo:masterfrom
HaoZeke:minorFixes

Conversation

@HaoZeke
Copy link
Copy Markdown
Member

@HaoZeke HaoZeke commented Aug 4, 2025

There's one in ioparser but this was enough for me to get around:

In file included from dimreduce.hpp:9:
../libs/tbdefs.hpp: In instantiation of 'std::ostream& toolbox::mpiostream::operator<<(T) [with T = std::valarray<double>; std::ostream = std::basic_ostream<char>]':
../libs/minsearch.hpp:758:18:   required from 'void toolbox::sim_annealing(FCLASS&, const std::valarray<double>&, std::valarray<double>&, double&, AnnealingOptions, std::valarray<std::valarray<double> >, RNG) [with FCLASS = NLDRITERChi; RNG = MTRndUniform; AnnealingOptions = _AnnealingOpts]'
../libs/minsearch.hpp:809:39:   required from 'void toolbox::sim_annealing(FCLASS&, const std::valarray<double>&, std::valarray<double>&, double&, AnnealingOptions, std::valarray<std::valarray<double> >) [with FCLASS = NLDRITERChi; AnnealingOptions = _AnnealingOpts]'
libdimred.cpp:1603:30:   required from here
../libs/tbdefs.hpp:413:18: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char'} and 'std::valarray<double>')
  413 |         return os<<data;
      |                ~~^~~~~~
In file included from /home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/iostream:41,
                 from ../libs/tbdefs.hpp:19:
/home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/ostream:110:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  110 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/ostream:110:36: note:   no known conversion for argument 1 from 'std::valarray<double>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
  110 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/ostream:119:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
  119 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/ostream:119:32: note:   no known conversion for argument 1 from 'std::valarray<double>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
  119 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/rgoswami/Git/Github/epfl/lab-cosmo/rgShowcase/.pixi/envs/eon/lib/gcc/x86_64-conda-linux-gnu/13.3.0/include/c++/ostream:129:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  129 |       operator<<(ios_base& (*__pf) (ios_base&))

The (re)definition also required changes to distinguish between the ioparser variant.

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

Successfully merging this pull request may close these issues.

1 participant