heavywatal / rigraphlite

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

Installation fails on macOS #6

Open szhorvat opened 6 months ago

szhorvat commented 6 months ago

When I try to install this package on macOS, I get errors such as:

methods.cpp:./policy.hpp2::
71In file included from :./adjlist.hpp5::9 :
./policy.hpp:71:5: error: no matching function for call to 'igraph_vector_int_init_array'
error:    71 |     inog rmatchinga pfunctionh _forv ector_int_callinit_ar ray(dtoa t'igraph_vector_int_init_array'a, &(x
[0]), x.size());
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 |     igraph_vector_int_init_array(data, &(x[0]), x.size());

I am using macOS. The toolchain and dependencies are installed using MacPorts. A full installation transcript, as well as my .R/Makevars file are included. Note that I needed to disable ccache in the Makevars file, something I didn't need to do for other R packages.

Terminal transcript ``` ~ $ R R version 4.4.0 (2024-04-24) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > devtools::install_github("heavywatal/rigraphlite") Using GitHub PAT from the git credential store. Downloading GitHub repo heavywatal/rigraphlite@HEAD ── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── βœ” checking for file β€˜/private/var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T/Rtmp6tjzsQ/remotes155d0d55dcf2/heavywatal-rigraphlite-9de3d45/DESCRIPTION’ ... ─ preparing β€˜igraphlite’: βœ” checking DESCRIPTION meta-information ... ─ cleaning src ─ running β€˜cleanup’ ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building β€˜igraphlite_0.10.12.tar.gz’ * installing *source* package β€˜igraphlite’ ... ** using staged installation cmake version 3.29.2 CMake suite maintained and supported by Kitware (kitware.com/cmake). CXX: /opt/local/bin/clang++-mp-18 PWD: /private/var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T/RtmpKH0PaR/R.INSTALL156242fb50693/igraphlite R_PACKAGE_DIR: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-igraphlite/00new/igraphlite IGRAPH_INSTALL_PREFIX: FINAL_INSTDIR: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/igraphlite BUILD_DIR: /var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T//RtmpKH0PaR/igraphlite-build rm: /var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T//RtmpKH0PaR/igraphlite-build/CMake*: No such file or directory -- The C compiler identification is Clang 18.1.5 -- The CXX compiler identification is Clang 18.1.5 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /opt/local/bin/clang-mp-18 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /opt/local/bin/clang++-mp-18 - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- CMAKE_CURRENT_SOURCE_DIR="/private/var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T/RtmpKH0PaR/R.INSTALL156242fb50693/igraphlite/src" -- CMAKE_PREFIX_PATH="/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-igraphlite/00new/igraphlite" -- igraph_FOUND="1" ; igraph_DIR="/opt/local/lib/cmake/igraph" -- CMAKE_INSTALL_PREFIX="/opt/local" -- CPPFLAGS="-I/opt/local/include" -- LDFLAGS="-L/opt/local/lib -Wl,-rpath,/opt/local/lib" -- Configuring done (0.7s) -- Generating done (0.0s) -- Build files have been written to: /var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T/RtmpKH0PaR/igraphlite-build ninja: no work to do. -- Install configuration: "" -- /opt/local/lib/cmake/igraph ** libs using C++ compiler: β€˜clang version 18.1.5’ using SDK: β€˜β€™ /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c basic.cpp -o basic.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c generators.cpp -o generators.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c igraph.cpp -o igraph.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c init.cpp -o init.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c layout.cpp -o layout.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c methods.cpp -o methods.o /opt/local/bin/clang++-mp-18 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -I/opt/local/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I/opt/local/include -fPIC -falign-functions=64 -Wall -g -O2 -c structural.cpp -o structural.o In file included from structural.cpp:3: In file included from ./vector.hpp:7In file included from : methods.cpp:./policy.hpp2:: 71In file included from :./adjlist.hpp5::9 : ./policy.hpp:71:5: error: no matching function for call to 'igraph_vector_int_init_array' error: 71 | inog rmatchinga pfunctionh _forv ector_int_callinit_ar ray(dtoa t'igraph_vector_int_init_array'a, &(x [0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | igraph_vector_int_init_array(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:30:30/opt/local/include/igraph/igraph_vector_pmt.h::30 :30:note: candidate note: function not viable: no known conversioncandidate function not viable: from 'const typename storage_type<13>::type *' no known conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd (aka 'const int *')argument 30to | IGRAPH_ E'const igraph_integer_t *'X P(aka 'const long long *')ORT igr aforp h2nd_ eargumentrr or_t FUNCTION(i g30r | aIpGhR_AvPeHc_tEoXrP,O RiTnit_ar ray)(i g r| ap ^h _ 31 | error_t FUNCTTION(igraph_vYePctor, init_Ea(igraph_vectror)* v,r const BASE*a data, igraph_iynteger)_t lengt(h); | ~~~~~~~~~~~~~~~~ | ^/opt/local/include/igraph/igraph_pmt.h :177:31: note: expanded from macro 31'FUNCTION' | 177 | #defin e FUNC TION(a,c) CONCA T3(a,SH ORT,c)T Y | ^ P/opt/local/include/igraph/igraph_pmt.h:27:24:E (ignote: raexpandedp hfrom_ vmacroe c'CONCAT3' t27 | #define CoONCAT3(a,b,c) COrNCAT3x(a,b,)c) | ^ /opt/local/include/igraph/igraph_pmt.h:26:*25: note: expanded from macro 'CONCAT3x' 26 | #dvefine C,ONCAT3x(a,b ,c) a #c#o n_ ## b s## _ ## tc | ^ B:174:1: Anote: expanded from Shere 174E | *i gdraaptha_,v eicgtroar_int_ipnit_arrahy_i n | ^ teger_t length); | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded from macro 'CONCAT3' In file included from methods.cpp27: | 2#: In file included from ./adjlist.hpp:9: ./policy.hpp:87:d5: error: eno matching function ffor call to 'igraph_vector_int_view'in e87 | igrap h_vector_intC_view(daOta, &(Nx[0]), xC.size(A)); | T ^~~~~~~~~~~~~~~~~~~~~~ 3(a,b,c) CO/opt/local/include/igraph/igraph_vector_pmt.hN:C93A:42: note: candidate Tfunction not viable: no3 known conversion from 'const typename storage_type<13>::type *'x (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for( a2nd, bargument , c93) | IGRAPH_EXPOR T const T Y| PE ^( igrap/opt/local/include/igraph/igraph_pmt.hh:_26v:e25c:t or) *FUNCnote: TION(igraph_vecexpandedtor, view )(consfromt TYPE(i graph_vectomacror) *v, | ^ 'CONCAT3x' 94 | 26 | # d e f i n e conCst BASE O*NdCaAtTa3,x( a | ~~~~~~~~~~~~~~~~ ,b/opt/local/include/igraph/igraph_pmt.h,:c177:31: note: )expanded from macro 'FUNCTION' a177 | #def#i#ne FUNCT ION(a,c_) #C#O NbC A#T#3 (_a ,#S#H ORT,c)c | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: | note: expanded from macro 'CONCAT3' ^27 | #defin e CONCAT3(a,b,c) CONCAT3x(a,b,:c) | 173 ^: /opt/local/include/igraph/igraph_pmt.h:126:25: note: : expanded from macro 'CONCAT3x' 26 | #define note: COexpandedNCAT3x(a ,fromb,c) a #here# _ ## b # # _ ## c | ^ 173 | i:g117:1: note: raexpandedp from here h _117v | igraph_vecetor_intc_view | ^ tor_int_init_array | ^ In file included from structural.cpp:3: In file included from ./vector.hpp:7: ./policy.hpp:87:5: error: no matching function for call to 'igraph_vector_int_view' 87 | igraph_vector_int_view(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:93:42: note: candidate function not viable: no known conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd argument 93 | IGRAPH_EXPORT const TYPE(igraph_vector) *FUNCTION(igraph_vector, view)(const TYPE(igraph_vector) *v, | ^ 94 | const BASE *data, | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded from macro 'CONCAT3' 27 | #define CONCAT3(a,b,c) CONCAT3x(a,b,c) | ^ /opt/local/include/igraph/igraph_pmt.h:26:25: note: expanded from macro 'CONCAT3x' 26 | #define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c | ^ :116:1: note: expanded from here 116 | igraph_vector_int_view | ^ In file included from generators.cpp:2: In file included from ./vector.hpp:7: ./policy.hpp:71:5: error: no matching function for call to 'igraph_vector_int_init_array' 71 | igraph_vector_int_init_array(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:30:30: note: candidate function not viable: no known conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd argument 30 | IGRAPH_EXPORT igraph_error_t FUNCTION(igraph_vector, init_array)( | ^ 31 | TYPE(igraph_vector)* v, const BASE* data, igraph_integer_t length); | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded from macro 'CONCAT3' 27 | #define CONCAT3(a,b,c) CONCAT3x(a,b,c) | ^ /opt/local/include/igraph/igraph_pmt.h:26:25: note: expanded from macro 'CONCAT3x' 26 | #define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c | ^ :173:1: note: expanded from here 173 | igraph_vector_int_init_array | ^ In file included from generators.cpp:2: In file included from ./vector.hpp:7: ./policy.hpp:87:5: error: no matching function for call to 'igraph_vector_int_view' 87 | igraph_vector_int_view(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:93:42: note: candidate function not viable: no known conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd argument 93 | IGRAPH_EXPORT const TYPE(igraph_vector) *FUNCTION(igraph_vector, view)(const TYPE(igraph_vector) *v, | ^ 94 | const BASE *data, | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded from macro 'CONCAT3' 27 | #define CONCAT3(a,b,c) CONCAT3x(a,b,c) | ^ /opt/local/include/igraph/igraph_pmt.h:26:25: note: expanded from macro 'CONCAT3x' 26 | #define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c | ^ :116:1: note: expanded from here 116 | igraph_vector_int_view | ^ In file included from basic.cpp:2: In file included from ./vector.hpp:7: ./policy.hpp:71:5: error: no matching function for call to 'igraph_vector_int_init_array' 71 | igraph_vector_int_init_array(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:30:30: note: candidate function not viable: no known conversion In file included from fromlayout.cpp :'const typename storage_type<13>::type *'2 : In file included from (aka 'const int *')./vector.hpp :to7 : 'const igraph_integer_t *'./policy.hpp:71:5: error: (aka 'const long long *') for 2nd argument 30 | IGRAPH_no matching function for call to 'igraph_vector_int_init_array' E 71 | Xigraph_vector_PiOnt_init_arrRay(data, &(xT[0]), x.size() ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~i graph_error_t FUNCTION(/opt/local/include/igraph/igraph_vector_pmt.hi:g30r:a30p:h _note: candidate function not viable: no knownv conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to e'const igraph_integer_t *' (aka 'const long long *') for 2nd argument c t30o | rI,G RAPH_EXPORT iignraph_eriror_t FUNCTIOtN(igraph__vectora, init_arrrraayy))(( | ^ 31| | ^ TYPE(igraph_vector)* v , const B31ASE* da | t a , i g raph_int eger_t le ngth); | ~~~~~~~~~~~~~~~~T Y/opt/local/include/igraph/igraph_pmt.h:177:31: Pnote: expanded from Emacro( i'FUNCTION' 177 | g r a #define FpUNCTION(a,c) CONCAhT_3(a,SHORTv,c) | e ^c t/opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded ofrom macro 'CONCAT3' 27 | #define CONrC)A*T 3(a,b,cv) CONCAT,3x(a,b, c) | ^ co/opt/local/include/igraph/igraph_pmt.hn:s26t:25: note: expanded from macro 'CONCAT3x' B26 | #define CONCAAT3x(a,SbE,*c) a ## _ ## b ## _d ## c | a ^ ta,: 173i:1: note: expanded from ghere 173r | igraph_vectaor_int_init_arrayph | ^ _integer_t length); | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expandedIn file included from layout.cppfrom: 2macro: In file included from 'CONCAT3'./vector.hpp:7: ./policy.hpp:87 :5: error: no matching function for call to 27'igraph_vector_int_view' | # defi n87e | C igraph_vecOtor_int_Nview(data, &C(x[0]),A Tx3.(size());a | ^~~~~~~~~~~~~~~~~~~~~~ ,b,c) CONCAT3x/opt/local/include/igraph/igraph_vector_pmt.h(:a93,:42: note: b,candidatec )function not viable: no known conversion from| 'const typename storage_type<13>::type *' ^ (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd argument 93 | IGRAPH_EXPORT const/opt/local/include/igraph/igraph_pmt.h TYPE(ig:raph_ve26ctor) *FUNCT:ION(igr25a:p h_vector, viewnote: )(const TYPE(igexpandedraph_ve ctor) *vfrom, | ^ macro94 | 'CONCAT3x' 26 | # constd eBASE *dafta, | in ~~~~~~~~~~~~~~~~e CO/opt/local/include/igraph/igraph_pmt.h:177:31: note: NexpandedC from macro 'FUNCTION'A 177 | T 3 x (#ad,ebfine FUN,CTION(a,c) cCONCAT3()a ,SHORT,c) a| ^ /opt/local/include/igraph/igraph_pmt.h#:27:24: note: expanded from macro 'CONCAT3'# 27 | #defi n_e CONCAT3(a,b,c) CONC#A#T 3bx (#a#,b,c) | _ ^ ## /opt/local/include/igraph/igraph_pmt.hc:26 : 25| : ^ note: expanded from macro 'CONCAT3x' 26 | #define CONCAT3x(a,b,c:) a ## _ ##173 b ## :_ ## c 1 :| ^ note: :116expanded:1: note: expanded from herefrom 116 | igraphhere_vector_int_view | ^ 173 | igraph_vector_int_init_array | ^ In file included from basic.cpp:2: In file included from ./vector.hpp:7: ./policy.hpp:87:5: error: no matching function for call to 'igraph_vector_int_view' 87 | igraph_vector_int_view(data, &(x[0]), x.size()); | ^~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_vector_pmt.h:93:42: note: candidate function not viable: no known conversion from 'const typename storage_type<13>::type *' (aka 'const int *') to 'const igraph_integer_t *' (aka 'const long long *') for 2nd argument 93 | IGRAPH_EXPORT const TYPE(igraph_vector) *FUNCTION(igraph_vector, view)(const TYPE(igraph_vector) *v, | ^ 94 | const BASE *data, | ~~~~~~~~~~~~~~~~ /opt/local/include/igraph/igraph_pmt.h:177:31: note: expanded from macro 'FUNCTION' 177 | #define FUNCTION(a,c) CONCAT3(a,SHORT,c) | ^ /opt/local/include/igraph/igraph_pmt.h:27:24: note: expanded from macro 'CONCAT3' 27 | #define CONCAT3(a,b,c) CONCAT3x(a,b,c) | ^ /opt/local/include/igraph/igraph_pmt.h:26:25: note: expanded from macro 'CONCAT3x' 26 | #define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c | ^ :116:1: note: expanded from here 116 | igraph_vector_int_view | ^ 2 errors generated. make: *** [methods.o] Error 1 make: *** Waiting for unfinished jobs.... 2 errors generated. make: *** [structural.o] Error 1 2 errors generated. 2 errors generated. make: *** [layout.o] Error 1 make: *** [basic.o] Error 1 2 errors generated. make: *** [generators.o] Error 1 ERROR: compilation failed for package β€˜igraphlite’ * removing β€˜/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/igraphlite’ Warning message: In i.p(...) : installation of package β€˜/var/folders/fm/9634rg5100n44pfnr7g5r94c0000gq/T//Rtmp6tjzsQ/file155d05e5b42c7/igraphlite_0.10.12.tar.gz’ had non-zero exit status > ```
.R/Makevars file ``` #CCACHE=/opt/local/bin/ccache CC = $(CCACHE) /opt/local/bin/clang-mp-18 CXX = $(CCACHE) /opt/local/bin/clang++-mp-18 CXX11 = $(CCACHE) /opt/local/bin/clang++-mp-18 FC = $(CCACHE) /opt/local/bin/gfortran-mp-13 F77 = $(CCACHE) /opt/local/bin/gfortran-mp-13 FLIBS = -L/opt/local/lib/libgcc -lgfortran -lquadmath -lm -Wl,-rpath /opt/local/lib/gcc13 CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib MAKEFLAGS = -j8 CFLAGS = -Wno-unused-but-set-variable -Wno-uninitialized -O3 ```
szhorvat commented 6 months ago

It seems things are going wrong when rigraphlite finds the external C/igraph library on my system (version 0.10.12) and tries to use that. If I uninstall it, then the rigraphlite installation succeeds.

szhorvat commented 6 months ago

Looking more carefully, I can see that the issue is that rigraphlite requires a 32-bit igraph_integer_t, while on most systems igraph is configured with a 64-bit integer. Thus it might make sense to not try to use an external library at all, since it will almost never be compatible.

I'm not sure if there's a good way to communicate package configuration, such as IGRAPH_INTEGER_SIZE, though CMake packages.

But in the source code you can protect for this with something like

#if IGRAPH_INTEGER_SIZE != 32
#error "rigraphlite requires igraph to be configured with a 32-bit integer size"
#endif
szhorvat commented 6 months ago

I now exposed IGRAPH_INTEGER_SIZE through igraph's CMake package file, see https://github.com/igraph/igraph/pull/2606 This will be available in the next igraph version, either 0.10.13 or 1.0, whichever comes first. The you will be able to check whether the external igraph is suitable, directly from CMake.

heavywatal commented 6 months ago

Thank you very much for trying this package and giving a close look at the installation problems. You are absolutely right. Currently this package requires IGRAPH_INTEGER_SIZE=32 for efficient conversion (or for doing many things without conversion) between igraph_vector_int_t and Rcpp::IntegerVector.

Thus it might make sense to not try to use an external library at all, since it will almost never be compatible.

This seems to be the way to go for now. I will try IGRAPH_INTEGER_SIZE exposed by igraph CMake in the near future. In the long run, of course, this package should become compatible with general 64-bit installation.