Hi,
I’m trying to install igraph package in R 4.3.1 inside Centos/Red Hat 8 through install.packages(‘igraph’) but I have encountered this error:
vendor/cigraph/src/internal/glpk_support.h:39:10:
fatal error: glpk.h: No such file or directory
39 | #include <glpk.h>
| ^~~~~~~~
compilation terminated.
make: *** [/opt/R/4.3.1/lib/R/etc/Makeconf:191: vendor/cigraph/src/community/optimal_modularity.o] Error 1
ERROR: compilation failed for package ‘igraph’
`
The glpk was installed and, before the attempt of igraph installation, I also loaded the corresponding environment module through module load glpk. I think that the compiler doesn’t see the include folder of the glpk package that is present in the system. So I have tried to insert inside the C_INCLUDE_PATH the path to the include folder of glpk using this command:
Sys.setenv(C_INCLUDE_PATH="/share/apps/spack/latest-2024-01-17/linux-centos8-skylake_avx512/gcc-8.4.1/glpk-4.65-p4yflusvdbtjwtt5mhqkfobr5nxubp3f/include")
But also in this case I encountered an error that is reported below:
ld cannot find -lglpk
To solve this last error, I have tried to load the corresponding libglpk.so library and retry to launch install.packages(‘igraph’) but it gives the same error.
Could you have any suggestions to solve the issue?
Thank you in advance,
Greetings
Jessica