heavywatal / rigraphlite

🚧 Lightweight R Interface to igraph Network Analysis Library
https://heavywatal.github.io/rigraphlite/
Other
11 stars 0 forks source link

Problems with installation #3

Closed anpefi closed 4 years ago

anpefi commented 5 years ago

Hi, I was trying to install rtumopp but I've run aground installing its dependence rigraphlite in different machines (Ubuntu, other linux and also in Mac).

When installing following the instructions in the README, I got the following

vector.hpp:7:34: fatal error: igraph/igraph_vector.h: No such file or directory

I tried to install rigraph/rigraph but that doesn't improve anything. I also tried to install igraph C library in my system, but then

In file included from vector.hpp:11,
                 from basic.cpp:2:
policy.hpp: In static member function ‘static void InitIndices::init(InitIndices::data_type*, const value_type&)’:
policy.hpp:59:35: error: invalid conversion from ‘const type*’ {aka ‘const double*’} to ‘igraph_real_t*’ {aka ‘double*’} [-fpermissive]
     igraph_vector_init_copy(data, &(x[0]), x.size());
In file included from /usr/local/include/igraph/igraph_vector.h:92,
                 from vector.hpp:7,
                 from basic.cpp:2:
/usr/local/include/igraph/igraph_vector_pmt.h:30:18: note:   initializing argument 2 of ‘int igraph_vector_init_copy(igraph_vector_t*, igraph_real_t*, long int)’
            BASE* data, long int length);
                  ^
/usr/lib/R/etc/Makeconf:176: recipe for target 'basic.o' failed
make: *** [basic.o] Error 1
ERROR: compilation failed for package ‘igraphlite’
* removing ‘/home/anpefi/R/x86_64-pc-linux-gnu-library/3.6/igraphlite’
Error: Failed to install 'igraphlite' from GitHub:

I cloned your fork of igraph and manually copied igraph_*.h files into a directory to be included (in Rcpp/include/igraph) and it compiled (only if igraph C library is already in the system), but:

installing to /home/anpefi/R/x86_64-pc-linux-gnu-library/3.6/igraphlite/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘igraphlite’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/anpefi/R/x86_64-pc-linux-gnu-library/3.6/igraphlite/libs/igraphlite.so':
  libigraph.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/anpefi/R/x86_64-pc-linux-gnu-library/3.6/igraphlite’
Error: Failed to install 'igraphlite' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmpzMEbWo/file21595b70f3fd/igraphlite_0.0.0.9000.tar.gz’ had non-zero exit status

I've also tried to follow step-by-step the last build in Travis-ci, but it also fails when checking:

R CMD check igraphlite_0.0.0.9000.tar.gz --as-cran; CHECK_RET=$?
* using log directory ‘/home/anpefi/soft/rigraphlite/igraphlite.Rcheck’
* using R version 3.6.1 (2019-07-05)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘igraphlite/DESCRIPTION’ ... OK
* this is package ‘igraphlite’ version ‘0.0.0.9000’
* package encoding: UTF-8
* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Watal M. Iwasaki <heavy.watal@gmail.com>’

New submission

Version contains large components (0.0.0.9000)

License components with restrictions and base license permitting such:
  MIT + file LICENSE
File 'LICENSE':
  MIT License

  Copyright (c) 2019 Watal M. Iwasaki

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘igraphlite’ can be installed ... ERROR
Installation failed.
See ‘/home/anpefi/soft/rigraphlite/igraphlite.Rcheck/00install.out’ for details.
* DONE

Status: 1 ERROR, 1 NOTE
See
  ‘/home/anpefi/soft/rigraphlite/igraphlite.Rcheck/00check.log’
for details.

I have run out of ideas. The installation should be simpler and I will have to replicate it on other computers because I want to other people explore tumopp. Could you help?

heavywatal commented 5 years ago

Thank you for the feedback, and sorry for the inconvenience. I will check and try to fix this soon.

rigraphlite does not depend on rigraph at all; it is intended to become a lightweight replacement of rigraph. C igraph is used internally, and fetched automatically with git if necessary. So basically users don't have to pre-install C igraph or rigraph by themselves. But users can use their own C igraph pre-installed somewhere in the system. Possible problem here might be that some existing igraph is interfering with the installation process. I am not sure. Give me a week.

ruping commented 4 years ago

I encountered the same issue in an Ubuntu 19.10 machine. It turns out that the pre-install of C igraph failed due to the missing of yacc and flex, I did the following to resolve the problem.

sudo apt-get install bison
sudo apt-get install byacc
sudo apt-get install flex
heavywatal commented 4 years ago

Thank you @ruping for finding the cause and its solution! Maybe Ubuntu on Travis and my machines happen to have those packages already for some other reasons, and the error could not be reproduced. I will close this issue after updating the document.

heavywatal commented 4 years ago

Strange... devtools::install_github("heavywatal/rigraphlite") just works on my Ubuntu 18.04 even after uninstalling bison, byacc, flex, and all the igraph-related things.

heavywatal commented 4 years ago

Confirmed this problem with a vanilla installation of Ubuntu 19.10 on a virtual environment.

heavywatal commented 4 years ago

The upstream C igraph released their versioned source code, which released this package from bootstrap.sh process. It means all the dev tools previously used (autoconf, automake, libtools, bison, and flex) are now required only when the user/developer explicitly specified the latest git source to build. Thank you for your feedback again, and sorry for inconvenience up to now, @anpefi, @ruping.

ruping commented 4 years ago

@heavywatal Thank you for letting us know! This is very nice work!