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

Cmake not able to find OpenMP while installing LGBM on PopOS 22 Jammy #5349

Closed
miguel-testlio opened this issue Jul 4, 2022 · 5 comments
Closed
Labels

Comments

@miguel-testlio
Copy link

Description

Hi,

I'm trying to install the lightgbm GPU package on Pop!_OS 22.04 LTS. I'm following the instructions posted on the official docs. I'm stuck in the "Build LGBM" section, at the step cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..
The paths and options of this command specified for my sistem differs from the original posted on the site. This is the cmake call i'm actually using:

sudo cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/lib/x86_64-linux-gnu/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/lib/nvidia-cuda-toolkit/bin/include/ -DOpenMP_C_FLAGS=-fopenmp=lomp -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_libomp_LIBRARY=/usr/lib/llvm-14/lib/libomp.so ..

This is giving the follwing the error:

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindOpenMP.cmake:544 (find_package_handle_standard_args)
  CMakeLists.txt:144 (find_package)

I assume that cmake is asking me to set up those missing flags but i don't know how to set them. I tried many alleged solutions founf on the web, like this and this among others, but none of them worked for me. I would appreciate your help here. Thank you very much

My system information is this:

H/W path                    Device          Class          Description
======================================================================
                                            system         TRX40 DESIGNARE (Default string)
/0                                          bus            TRX40 DESIGNARE
/0/0                                        memory         64KiB BIOS
/0/b                                        memory         64GiB System Memory
/0/b/0                                      memory         [empty]
/0/b/1                                      memory         16GiB DIMM DDR4 Synchronous Unbuffered
/0/b/2                                      memory         [empty]
/0/b/3                                      memory         16GiB DIMM DDR4 Synchronous Unbuffered
/0/b/4                                      memory         [empty]
/0/b/5                                      memory         16GiB DIMM DDR4 Synchronous Unbuffered
/0/b/6                                      memory         [empty]
/0/b/7                                      memory         16GiB DIMM DDR4 Synchronous Unbuffered
/0/e                                        memory         1536KiB L1 cache
/0/f                                        memory         12MiB L2 cache
/0/10                                       memory         128MiB L3 cache
/0/11                                       processor      AMD Ryzen Threadripper 3960X 24-Core P
/0/100                                      bridge         Starship/Matisse Root Complex
/0/100/0.2                                  generic        Starship/Matisse IOMMU
/0/100/1.2                                  bridge         Starship/Matisse GPP Bridge
/0/100/1.2/0                /dev/nvme0      storage        Samsung SSD 970 EVO Plus 1TB
/0/100/1.2/0/0              hwmon1          disk           NVMe disk
/0/100/1.2/0/2              /dev/ng0n1      disk           NVMe disk
/0/100/1.2/0/1              /dev/nvme0n1    disk           1TB NVMe disk
/0/100/1.2/0/1/1            /dev/nvme0n1p1  volume         99MiB Windows FAT volume
/0/100/1.2/0/1/2            /dev/nvme0n1p2  volume         15MiB reserved partition
/0/100/1.2/0/1/3            /dev/nvme0n1p3  volume         930GiB Windows NTFS volume
/0/100/1.2/0/1/4            /dev/nvme0n1p4  volume         521MiB Windows NTFS volume
/0/100/7.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/100/7.1/0                                generic        Starship/Matisse PCIe Dummy Function
/0/100/8.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/100/8.1/0                                generic        Starship/Matisse Reserved SPP
/0/100/8.1/0.3                              bus            Starship USB 3.0 Host Controller
/0/100/8.1/0.3/0            usb1            bus            xHCI Host Controller
/0/100/8.1/0.3/1            usb2            bus            xHCI Host Controller
/0/100/8.1/0.3/1/1          card1           multimedia     Logitech BRIO Consumer Control
/0/100/8.1/0.3/1/2          scsi10          storage        Extreme Pro 55AF
/0/100/8.1/0.3/1/2/0.0.0    /dev/sdb        disk           1TB Extreme Pro 55AF
/0/100/8.1/0.3/1/2/0.0.0/1  /dev/sdb1       volume         931GiB Windows NTFS volume
/0/100/8.1/0.3/1/2/0.0.1                    generic        SES Device
/0/100/14                                   bus            FCH SMBus Controller
/0/100/14.3                                 bridge         FCH LPC Bridge
/0/100/14.3/0                               system         PnP device PNP0c01
/0/100/14.3/1                               system         PnP device PNP0c02
/0/100/14.3/2                               system         PnP device PNP0c02
/0/100/14.3/3                               system         PnP device PNP0b00
/0/100/14.3/4                               system         PnP device PNP0c02
/0/100/14.3/5                               system         PnP device PNP0c02
/0/100/14.3/6                               system         PnP device PNP0c02
/0/100/14.3/7                               system         PnP device PNP0c02
/0/100/14.3/8                               system         PnP device PNP0c02
/0/101                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/102                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/103                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/104                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/105                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/106                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/107                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/108                                      bridge         Starship Device 24; Function 0
/0/109                                      bridge         Starship Device 24; Function 1
/0/10a                                      bridge         Starship Device 24; Function 2
/0/10b                                      bridge         Starship Device 24; Function 3
/0/10c                                      bridge         Starship Device 24; Function 4
/0/10d                                      bridge         Starship Device 24; Function 5
/0/10e                                      bridge         Starship Device 24; Function 6
/0/10f                                      bridge         Starship Device 24; Function 7
/0/110                                      bridge         Starship/Matisse Root Complex
/0/110/0.2                                  generic        Starship/Matisse IOMMU
/0/110/3.1                                  bridge         Starship/Matisse GPP Bridge
/0/110/3.1/0                                display        GA102 [GeForce RTX 3090]
/0/110/3.1/0.1              card0           multimedia     GA102 High Definition Audio Controller
/0/110/3.1/0.1/0            input20         input          HDA NVidia HDMI/DP,pcm=3
/0/110/3.1/0.1/1            input21         input          HDA NVidia HDMI/DP,pcm=7
/0/110/3.1/0.1/2            input22         input          HDA NVidia HDMI/DP,pcm=8
/0/110/3.1/0.1/3            input23         input          HDA NVidia HDMI/DP,pcm=9
/0/110/3.1/0.1/4            input24         input          HDA NVidia HDMI/DP,pcm=10
/0/110/3.1/0.1/5            input25         input          HDA NVidia HDMI/DP,pcm=11
/0/110/3.1/0.1/6            input26         input          HDA NVidia HDMI/DP,pcm=12
/0/110/7.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/110/7.1/0                                generic        Starship/Matisse PCIe Dummy Function
/0/110/8.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/110/8.1/0                                generic        Starship/Matisse Reserved SPP
/0/110/8.1/0.1                              generic        Starship/Matisse Cryptographic Coproce
/0/110/8.1/0.3                              bus            Starship USB 3.0 Host Controller
/0/110/8.1/0.3/0            usb3            bus            xHCI Host Controller
/0/110/8.1/0.3/1            usb4            bus            xHCI Host Controller
/0/110/8.1/0.4              card2           multimedia     Starship/Matisse HD Audio Controller
/0/111                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/112                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/113                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/114                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/115                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/116                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/117                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/118                                      bridge         Starship/Matisse Root Complex
/0/118/0.2                                  generic        Starship/Matisse IOMMU
/0/118/1.1                                  bridge         Starship/Matisse GPP Bridge
/0/118/1.1/0                                bridge         Matisse Switch Upstream
/0/118/1.1/0/3                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/3/0            enp67s0         network        I210 Gigabit Network Connection
/0/118/1.1/0/4                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/4/0            card3           multimedia     Sound Core3D [Sound Blaster Recon3D / 
/0/118/1.1/0/4/0/0          input27         input          HDA Creative Mic
/0/118/1.1/0/4/0/1          input28         input          HDA Creative Line Out Surround
/0/118/1.1/0/4/0/2          input29         input          HDA Creative Line Out CLFE
/0/118/1.1/0/4/0/3          input30         input          HDA Creative Front Headphone
/0/118/1.1/0/5                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/5/0            enp69s0         network        I210 Gigabit Network Connection
/0/118/1.1/0/6                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/6/0            wlo2            network        Wi-Fi 6 AX200
/0/118/1.1/0/8                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/8/0                            generic        Starship/Matisse Reserved SPP
/0/118/1.1/0/8/0.1                          bus            Matisse USB 3.0 Host Controller
/0/118/1.1/0/8/0.1/0        usb5            bus            xHCI Host Controller
/0/118/1.1/0/8/0.1/0/1                      bus            USB2.0 Hub
/0/118/1.1/0/8/0.1/0/1/1    card4           multimedia     GeneralPlus USB Audio Device
/0/118/1.1/0/8/0.1/0/1/2                    bus            USB2.0 Hub
/0/118/1.1/0/8/0.1/0/1/2/1  input15         input          Razer Razer Mouse Dock
/0/118/1.1/0/8/0.1/0/1/4                    bus            USB2.0 Hub
/0/118/1.1/0/8/0.1/0/4                      bus            USB2.0 Hub
/0/118/1.1/0/8/0.1/0/4/2    input10         input          Razer Razer BlackWidow V3 Pro
/0/118/1.1/0/8/0.1/0/5      card6           multimedia     USB Audio
/0/118/1.1/0/8/0.1/0/6                      input          ITE Device(8595)
/0/118/1.1/0/8/0.1/1        usb6            bus            xHCI Host Controller
/0/118/1.1/0/8/0.3                          bus            Matisse USB 3.0 Host Controller
/0/118/1.1/0/8/0.3/0        usb7            bus            xHCI Host Controller
/0/118/1.1/0/8/0.3/0/4                      bus            USB hub
/0/118/1.1/0/8/0.3/0/4/1    card5           multimedia     Jabra Link 380
/0/118/1.1/0/8/0.3/0/5                      communication  AX200 Bluetooth
/0/118/1.1/0/8/0.3/0/6                      bus            USB2.0 Hub
/0/118/1.1/0/8/0.3/0/6/1                    input          NZXT USB Device
/0/118/1.1/0/8/0.3/0/6/2    input11         input          Razer Razer Basilisk Ultimate Dongle
/0/118/1.1/0/8/0.3/1        usb8            bus            xHCI Host Controller
/0/118/1.1/0/9                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/9/0                            storage        FCH SATA Controller [AHCI mode]
/0/118/1.1/0/a                              bridge         Matisse PCIe GPP Bridge
/0/118/1.1/0/a/0            scsi4           storage        FCH SATA Controller [AHCI mode]
/0/118/1.1/0/a/0/0.0.0      /dev/sda        disk           500GB Samsung SSD 850
/0/118/1.1/0/a/0/0.0.0/0    /dev/sda        disk           500GB 
/0/118/1.1/0/a/0/0.0.0/0/1                  volume         511MiB Windows FAT volume
/0/118/1.1/0/a/0/0.0.0/0/2  /dev/sda2       volume         465GiB EXT4 volume
/0/118/3.1                                  bridge         Starship/Matisse GPP Bridge
/0/118/3.1/0                /dev/nvme1      storage        CT1000P5PSSD8
/0/118/3.1/0/0              hwmon2          disk           NVMe disk
/0/118/3.1/0/2              /dev/ng1n1      disk           NVMe disk
/0/118/3.1/0/1              /dev/nvme1n1    disk           1TB NVMe disk
/0/118/3.1/0/1/1            /dev/nvme1n1p1  volume         15MiB reserved partition
/0/118/3.1/0/1/2            /dev/nvme1n1p2  volume         931GiB Windows NTFS volume
/0/118/7.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/118/7.1/0                                generic        Starship/Matisse PCIe Dummy Function
/0/118/8.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/118/8.1/0                                generic        Starship/Matisse Reserved SPP
/0/119                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11a                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11b                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11c                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11d                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11e                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/11f                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/120                                      bridge         Starship/Matisse Root Complex
/0/120/0.2                                  generic        Starship/Matisse IOMMU
/0/120/7.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/120/7.1/0                                generic        Starship/Matisse PCIe Dummy Function
/0/120/8.1                                  bridge         Starship/Matisse Internal PCIe GPP Bri
/0/120/8.1/0                                generic        Starship/Matisse Reserved SPP
/0/121                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/122                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/123                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/124                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/125                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/126                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/0/127                                      bridge         Starship/Matisse PCIe Dummy Host Bridg
/1                          /dev/fb0        display        EFI VGA
/2                          input0          input          Power Button
/3                          input1          input          Power Button

Cuda setup information

Mon Jul  4 11:26:15 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07    Driver Version: 515.48.07    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:21:00.0  On |                  N/A |
|  0%   49C    P5    89W / 350W |   1016MiB / 24576MiB |     13%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      4012      G   /usr/lib/xorg/Xorg                381MiB |
|    0   N/A  N/A      4123      G   /usr/bin/gnome-shell               53MiB |
|    0   N/A  N/A      5016      G   ...veSuggestionsOnlyOnDemand       48MiB |
|    0   N/A  N/A      5140      G   ...b/thunderbird/thunderbird       63MiB |
|    0   N/A  N/A      5478      G   ...in,WebAssemblyTrapHandler      360MiB |
|    0   N/A  N/A      5915      G   /app/bin/vlc.bin                  103MiB |
+-----------------------------------------------------------------------------+
@jameslamb
Copy link
Collaborator

Thanks very much for your interest in LightGBM!

I've re-pasted the command from the description here with one argument per line, so it's easier to see what's been provided:

sudo cmake \
    -DUSE_GPU=1 \
    -DOpenCL_LIBRARY=/usr/lib/x86_64-linux-gnu/libOpenCL.so \
    -DOpenCL_INCLUDE_DIR=/usr/lib/nvidia-cuda-toolkit/bin/include/ \
    -DOpenMP_C_FLAGS=-fopenmp=lomp \
    -DOpenMP_C_LIB_NAMES="libomp" \
    -DOpenMP_libomp_LIBRARY=/usr/lib/llvm-14/lib/libomp.so \
    ..

I have two suggestions to try:

  1. include -DOpenMP_CXX_FLAGS and -DOpenMP_CXX_LIB_NAMES with the same values as the equivalent *_C_* flags you've already provided
  2. try omitting any OpenMP-related arguments to CMake, and let CMake's built-in OpenMP search mechanism search for libomp (https://cmake.org/cmake/help/v3.22/module/FindOpenMP.html)

@miguel-testlio
Copy link
Author

Hey, thank you very much for your response.

First suggestion didn't help, but the second one worked. It started compiling, but after that i started to get these messages during compilation:

In file included from /usr/include/CL/cl.h:20,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/cl.hpp:19,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/config.hpp:16,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/buffer.hpp:14,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/core.hpp:18,
                 from /home/miguel_testlio/LightGBM/src/treelearner/gpu_tree_learner.h:33,
                 from /home/miguel_testlio/LightGBM/src/treelearner/tree_learner.cpp:8:
/usr/include/CL/cl_version.h:22:104: note: ‘#pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)’
   22 | ge("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")
      |                                                                                           ^

In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/utility/program_cache.hpp:17,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/detail/meta_kernel.hpp:40,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/types/complex.hpp:20,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/types.hpp:18,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/core.hpp:25,
                 from /home/miguel_testlio/LightGBM/src/treelearner/gpu_tree_learner.h:33,
                 from /home/miguel_testlio/LightGBM/src/treelearner/tree_learner.cpp:8:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
[ 90%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/voting_parallel_tree_learner.cpp.o
In file included from /usr/include/CL/cl.h:20,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/cl.hpp:19,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/config.hpp:16,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/buffer.hpp:14,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/core.hpp:18,
                 from /home/miguel_testlio/LightGBM/src/treelearner/gpu_tree_learner.h:33,
                 from /home/miguel_testlio/LightGBM/src/treelearner/parallel_tree_learner.h:16,
                 from /home/miguel_testlio/LightGBM/src/treelearner/voting_parallel_tree_learner.cpp:11:
/usr/include/CL/cl_version.h:22:104: note: ‘#pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)’
   22 | ge("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")
      |                                                                                           ^

In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/utility/program_cache.hpp:17,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/detail/meta_kernel.hpp:40,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/types/complex.hpp:20,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/types.hpp:18,
                 from /home/miguel_testlio/LightGBM/external_libs/compute/include/boost/compute/core.hpp:25,
                 from /home/miguel_testlio/LightGBM/src/treelearner/gpu_tree_learner.h:33,
                 from /home/miguel_testlio/LightGBM/src/treelearner/parallel_tree_learner.h:16,
                 from /home/miguel_testlio/LightGBM/src/treelearner/voting_parallel_tree_learner.cpp:11:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
[ 90%] Built target lightgbm_objs
[ 92%] Building CXX object CMakeFiles/lightgbm.dir/src/main.cpp.o
[ 94%] Building CXX object CMakeFiles/lightgbm.dir/src/application/application.cpp.o
[ 96%] Linking CXX executable ../lightgbm
[ 96%] Built target lightgbm
[ 98%] Building CXX object CMakeFiles/lightgbm_capi_objs.dir/src/c_api.cpp.o
[ 98%] Built target lightgbm_capi_objs
[100%] Linking CXX shared library ../lib_lightgbm.so
[100%] Built target _lightgbm

It finished the compilation successfully, but then if i go to Python and try to import the library i would get:

import lightgbm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/miguel_testlio/LightGBM/python-package/lightgbm/__init__.py", line 8, in <module>
    from .basic import Booster, Dataset, Sequence, register_logger
  File "/home/miguel_testlio/LightGBM/python-package/lightgbm/basic.py", line 125, in <module>
    _LIB = _load_lib()
  File "/home/miguel_testlio/LightGBM/python-package/lightgbm/basic.py", line 116, in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
  File "/home/miguel_testlio/anaconda3/lib/python3.9/ctypes/__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "/home/miguel_testlio/anaconda3/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/miguel_testlio/anaconda3/lib/python3.9/site-packages/scipy/sparse/../../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/miguel_testlio/LightGBM/lib_lightgbm.so)

Any suggestions?

Thank you very much again

@jameslamb
Copy link
Collaborator

jameslamb commented Jul 20, 2022

Any suggestions?

Yes, we've seen that problem before in the situation "building LightGBM from source inside a conda environment, on an OS with a much newer libstdc++ than the newest one that conda ships".

See "Workarounds with no changes to LightGBM" in #5106 (comment) for some suggested workarounds. For your case, I recommend following the suggestion "Use conda's CMake and compilers to build LightGBM from source".

Specifically, install C and C++ compilers from conda in your environment.

conda install -y \
    -n "${YOUR_CONDA_ENVIRONMENT_NAME}" \
    cmake \
    gcc_linux-64 \
    gxx_linux-64

Then activate your conda environment and install lightgbm.

@github-actions
Copy link

This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants