shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Python Anaconda Manual Installation Shogun #5102

Closed Arcane192 closed 3 years ago

Arcane192 commented 4 years ago

Hallo i have followed up your instructions to install Shogun manual. Installing it the other way there is a licence issue with SVMLight and i cant import it from python.

So as i read the way to have all packages available is to install it by this way:

conda create -n shogun4 python=3.6
conda activate shogun4
conda install cmake 
conda install -c creditx gcc-7
# conda install a series of other dependencies

# download source code and GPL license
git clone https://github.com/shogun-toolbox/shogun.git
cd shogun/src
git clone https://github.com/shogun-toolbox/shogun-gpl.git
cp shogun-gpl/* gpl/ -R

cd ..
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/export/home/kici/anaconda3/envs/shogun4 -DPYTHON_EXECUTABLE=/export/home/kici/anaconda3/envs/shogun4/bin/python -DPYTHON_INCLUDE_DIR=/export/home/kici/anaconda3/envs/shogun4/include/python3.6m -DPYTHON_LIBRARY=/export/home/kici/anaconda3/envs/shogun4/lib/libpython3.6m.so -DINTERFACE_PYTHON=ON ..

But cmake this gives me this output:

-- dir='/home/kici/shogun/src'
-- dir='/home/kici/shogun/build/src'
-- dir='/home/kici/shogun/src/gpl'
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
-- Using system's malloc
-- Could NOT find OPENCL (missing: OPENCL_LIBRARY OPENCL_INCLUDE_DIR) 
-- Could NOT find ViennaCL (missing: VIENNACL_INCLUDE_DIR VIENNACL_ENCODED_VERSION OpenCL_INCLUDE_DIRS OpenCL_LIBRARIES) (Required is at least version "1.5.0")
-- Could NOT find rxcpp (missing: rxcpp_INCLUDE_DIR) 
-- Could NOT find TFLogger (missing: TFLogger_DIR)
-- Found MKL using as BLAS/LAPACK backend.
-- Could NOT find spdlog (missing: spdlog_DIR)
-- Could NOT find GLPK (missing: GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) 
-- Could NOT find LibArchive (missing: LibArchive_LIBRARY LibArchive_INCLUDE_DIR) 
-- Could NOT find CPLEX (missing: CPLEX_LIBRARY CPLEX_INCLUDE_DIR) 
-- Could NOT find MOSEK (missing: MOSEK_DIR MOSEK_INCLUDE_DIR MOSEK_LIBRARY MOSEK_LIBRARIES) 
-- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) 
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
-- Could NOT find SNAPPY (missing: SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR) 
-- Lzo includes and libraries NOT found. 
-- Could NOT find NLOPT (missing: NLOPT_LIBRARY NLOPT_INCLUDE_DIR) 
-- Could NOT find LPSOLVE (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_DIR) 
-- Could NOT find ColPack (missing: COLPACK_LIBRARIES COLPACK_LIBRARY_DIR COLPACK_INCLUDE_DIR) 
-- Could NOT find ARPREC (missing: ARPREC_LIBRARIES ARPREC_INCLUDE_DIR) 
-- Linker: GNU gold
CMake Warning (dev) at src/interfaces/python/CMakeLists.txt:3 (FIND_PACKAGE):
  Ignoring EXACT since no version is requested.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at cmake/FindNumPy.cmake:62 (message):
  NumPy import failure:

Call Stack (most recent call first):
  src/interfaces/python/CMakeLists.txt:4 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/kici/shogun/build/CMakeFiles/CMakeOutput.log".
See also "/home/kici/shogun/build/CMakeFiles/CMakeError.log".

I have Numpy installed. Any idea how to solve this?

Thanks!

karlnapf commented 4 years ago

is numpy available as an import within the conda environment you are running from. Try import numpy in a Python interpreter

Arcane192 commented 4 years ago

Hi karlnapf,

(base) kici@kici-Hyrican-PC:~$ conda activate shogun4
(shogun4) kici@kici-Hyrican-PC:~$ python
Python 3.6.10 |Anaconda, Inc.| (default, May  8 2020, 02:54:21) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> 

This is my output. I think numpy is installed correctly.

karlnapf commented 4 years ago

ok, another option you have is to explicitly pass the python environment paths to cmake when confguring shogun. Have a look here: https://github.com/shogun-toolbox/shogun/blob/develop/doc/readme/INSTALL.md#customized-python-environments-

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue is now being closed due to a lack of activity. Feel free to reopen it.