heal-research / pyoperon

Python bindings and scikit-learn interface for the Operon library for symbolic regression.
MIT License
34 stars 10 forks source link

explicit clang compiler specification required under conda on Linux #13

Closed jose-d closed 4 months ago

jose-d commented 4 months ago

greetings from Prague;

we tried to install pyoperon at our HPC cluster using the README.md instructions at Rocky Linux 8.9, and without explicitly specifying:

export CXX=${CONDA_PREFIX}/bin/clang++
export CC=${CONDA_PREFIX}/bin/clang

the build fails.

Investigation revealed, that conda uses gcc compiler suite by default, and results of gcc on this code aren't satisfying. Namely multiple instances of error similar to:

/home/jose/projects/pyoperon_v4/pyoperon/operon/include/operon/interpreter/dispatch_table.hpp:111:2: error: extra ';' [-Werror=pedantic]
  111 | };

and

/home/jose/projects/pyoperon_v4/pyoperon/operon/include/operon/interpreter/dispatch_table.hpp:165:71: internal compiler error: Segmentation fault
  165 |     using Typ = std::conditional_t<detail::ExtentsLike<Lst>, decltype([]<auto... Idx>(std::index_sequence<Idx...>){
      |                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166 |                     return std::make_tuple(std::tuple_element_t<Idx, Tup>{}...);
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  167 |                 }(std::make_index_sequence<sizeof...(Ts)-1>{})), Tup>;

I tested multiple version of GCC and after better understanding of codebase I understood (hopefully correctly) that the code is supposed to be built by clang.

specifying

export CXX=${CONDA_PREFIX}/bin/clang++
export CC=${CONDA_PREFIX}/bin/clang

makes the build work flawlessly, so perhaps it could be useful to add this hint into README.md, or possibly directly into ./script/dependencies.sh ?

cheers

josef

foolnotion commented 4 months ago

Hi, thanks for the report. Indeed, gcc fails to build operon due to a bug that I reported half a year ago. We already used those exports in the CI, I've now also updated the README. Normally this shouldn't be necessary but conda is weird and kinda broken.