heal-research / pyoperon

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

Can't build on Ubuntu #1

Closed gAldeia closed 2 years ago

gAldeia commented 2 years ago

I'm trying to build the pyoperon package by following the instructions in BUILDING.md. I'm using vcpkg to install dependencies and managed to install all required dependencies, including the C++ operon version.

When I try to build pyoperon it gives me the following error:

guilherme@mini-ITX:~/Desktop/pyoperon$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Running vcpkg install
-- Running vcpkg install - failed
CMake Error at /opt/vcpkg/scripts/buildsystems/vcpkg.cmake:831 (message):
  vcpkg install failed.  See logs for more information:
  /home/guilherme/Desktop/pyoperon/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:5 (project)

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

The generated log file /home/guilherme/Desktop/pyoperon/build/vcpkg-manifest-install.log:

Fetching registry information from https://github.com/foolnotion/vcpkg-registry>
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
Error: Cycle detected during vstat:x64-linux:

I also tried to build C++ operon by giving the -DBUILD_PYBIND=ON option. It gives me the following output:

guilherme@mini-ITX:~/Desktop/operon$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_PYBIND=ON
-- Running vcpkg install
-- Running vcpkg install - done
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Taskflow found. Headers: /home/guilherme/Desktop/operon/build/vcpkg_installed/x64-linux/include
-- Could NOT find aria-csv (missing: aria-csv_DIR)
-- Disabled features:
 * USE_OPENLIBM, Link against Julia's openlibm, a high performance mathematical library [default=OFF].
 * USE_JEMALLOC, Link against jemalloc, a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support [default=OFF].
 * USE_TCMALLOC, Link against tcmalloc (thread-caching malloc), a malloc(3) implementation that reduces lock contention for multi-threaded programs [default=OFF].
 * USE_MIMALLOC, Link against mimalloc, a general purpose allocator with excellent performance characteristics [default=OFF].
 * USE_SINGLE_PRECISION, Perform model evaluation using floats (single precision) instead of doubles. Great for reducing runtime, might not be appropriate for all purposes [default=OFF].
 * USE_CERES_NNLS, Use the non-linear least squares optimizer from Ceres solver to tune model coefficients (if OFF, Eigen::LevenbergMarquardt will be used instead).

-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_PYBIND

-- Build files have been written to: /home/guilherme/Desktop/operon/build

I managed to install pyoperon via nix, but the package becomes available inside a new python installation that does not integrate with my other python packages, as well as it does not provide pip to install new ones.

Is there a way to make any of the building processes work? Or is there a way to use the nix version of pyoperon with my default anaconda3 python installation? My default python version is 3.9.7, which is pretty similar to the one nix installs.

foolnotion commented 2 years ago

Hi,

For the first problem, it seems that you are missing the build-essential package in ubuntu? CMake can't find make

For the second problem, unfortunately it's a vcpkg bug https://github.com/microsoft/vcpkg/issues/20503 and I'm trying to work around it

For the third problem, heal-research/operon now only contains the C++ library, so there is no BUILD_PYBIND option anymore.

About pyoperon via nix: you could just clone the repo and edit flake.nix, where you add all the other python packages that you are using. You can search for them here: https://search.nixos.org/packages?channel=nixos-unstable. After that just run nix develop and you're set.

I will leave this issue open until we find a convenient way to build on ubuntu.

gAldeia commented 2 years ago

I had build-essential installed, but it didn't work. One thing that I found weird is that Cmake wasn't able to find make only when building pyoperon, but not operon.

I managed to successfully build and install the pyoperon using the script you merged in srbench recently with no problems in a fresh new ubuntu 20.04 installation with only miniconda.

Thanks for your attention. I think this issue can be closed.