About the old binary version of iGraph

I want to restore to the R environment 3 years ago. I need to install the current version of iGraph. Do you know where to download the old binary version of iGraph? For example, where can I download the binary version of iGraph 1.2.3?

CRAN only stores Windows binaries for the latest release of each package. In order to install older versions, you must compile them from sources.

To compile packages, you must have RTools installed. Pick the RTools version that matches your R version. Additionally, igraph’s dependencies must be installed as well: libxml2, gmp, glpk. These dependencies are not optional on Windows. With recent versions of RTools, you can install these using pacman as explained in the RTools documentation, and here.

It’s frustrating. In the latest versions of R and rtools, libxml2, GMP and GLPK have been installed by command, but the following problems still occur。
----*******************************************************************************-----------------------------------

> install.packages("C:/Users/Administrator/Desktop/R/yilaibao/shinystan_2.6.0的依赖包/threejs_0.3.1的依赖包/igraph_1.2.1.tar.gz", repos = NULL, lib="C:/Program Files/R/R-4.2.1/library")
* installing *source* package 'igraph' ...
** 成功将'igraph'程序包解包并MD5和检查
** using staged installation
** libs
gfortran  -fno-optimize-sibling-calls    -O2  -mfpmath=sse -msse2 -mstackrealign  -c AMD/Source/amd.f -o AMD/Source/amd.o
gcc  -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I/include/libxml2 -I/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML -Wall -DPACKAGE_VERSION=\"1.2.0\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -Ics -I/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL=/**/ -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/include    -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -DINTERNAL_ARPACK -I. -I/include -DHAVE_GFORTRAN   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c AMD/Source/amd_1.c -o AMD/Source/amd_1.o
gcc  -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I/include/libxml2 -I/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML -Wall -DPACKAGE_VERSION=\"1.2.0\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -Ics -I/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL=/**/ -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/include    -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -DINTERNAL_ARPACK -I. -I/include -DHAVE_GFORTRAN   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c AMD/Source/amd_2.c -o AMD/Source/amd_2.o
gcc  -I"C:/PROGRA~1/R/R-42~1.1/include" -DNDEBUG -I/include/libxml2 -I/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML -Wall -DPACKAGE_VERSION=\"1.2.0\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -Ics -I/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL=/**/ -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/include    -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include"  -DINTERNAL_ARPACK -I. -I/include -DHAVE_GFORTRAN   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c AMD/Source/amd_aat.c -o AMD/Source/amd_aat.o
       if (igraph_i_interruption_handler) { if (igraph_allow_interruption(NULL) != IGRAPH_SUCCESS) return IGRAPH_INTERRUPTED; \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adjlist.c:217:5: note: in expansion of macro 'IGRAPH_ALLOW_INTERRUPTION'
     IGRAPH_ALLOW_INTERRUPTION();
     ^~~~~~~~~~~~~~~~~~~~~~~~~
adjlist.c: In function 'igraph_inclist_init':
igraph_interrupt_internal.h:58:12: error: 'igraph_i_interruption_handler' undeclared (first use in this function); did you mean 'igraph_set_interruption_handler'?
        if (igraph_i_interruption_handler) { if (igraph_allow_interruption(NULL) != IGRAPH_SUCCESS) return IGRAPH_INTERRUPTED; \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adjlist.c:578:5: note: in expansion of macro 'IGRAPH_ALLOW_INTERRUPTION'
     IGRAPH_ALLOW_INTERRUPTION();
     ^~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [C:/PROGRA~1/R/R-42~1.1/etc/x64/Makeconf:253: adjlist.o] Error 1
ERROR: compilation failed for package 'igraph'
* removing 'C:/Program Files/R/R-4.2.1/library/igraph'

It’s best to just state that compiling old software is often not going to be easy, and to make it work, you may need to recreate the environment which was current at the time when the software was released. We will not be able to offer much support for such very old versions, and we do not recommend using old versions for any new work.

That said, here are some tips which may be helpful.

  • Why do you need to install such an old version? What problem are you trying to solve? Given the difficulties, I would think twice before going down this route. Are you sure this is not an XY problem? If you observe (or suspect) a difference in behaviour compared to recent versions, you can ask us about what has changed, and we might be able to offer some hints. The NEWS file claims no user-visible changes between 1.2.1 and 1.2.6. 1.2.7 introduces quite a few changes under the hood, and so does 1.3.0. Consider these your milestone versions.

  • If you are determined to go down this route, I suggest you the following way to install the package: remotes::install_version('igraph', '1.2.6'). This automates the process, and eliminates some potential mistakes you might be making.

  • The build process is different between Windows and Linux/macOS. If you are determined to get old versions working, you may have better luck compiling on Linux.

  • Be prepared that you may need to recreate at least some of the environment which was current when that old version was released. On my macOS system, using GCC 12, Clang 14, and R 4.2.1, version 1.2.6 compiles fine, but 1.2.3 does not, probably due to a change in gfortran. It may be necessary to use an older gfortran.

It’s too difficult, which seriously affects my interest in learning

Are you looking to just learn igraph? Then why are you not using the latest version?

No, I’m studying the application of R language in finance. I recently bought a book with code on it, but it can’t run. The author said that it needs to be restored to the running environment three years ago. Do you need this code? I can email you

In that case, you should use the latest version of igraph.

If some code you found in the book behaves differently than the book claims, you are welcome to ask about it here on this forum.

More than likely, the change in the behaviour is due to a bugfix in igraph, or due to newly added checks that input passed to igraph functions is valid. You wouldn’t want to get incorrect results due to bugs, right? (Either bugs in old versions in igraph, or bugs in book’s code that old igraph versions would not alert you about.)


Note that there are almost a thousand packages that depend on igraph. Before a new version of igraph is published, we check that all of these thousand packages continue to function as before. This is required by CRAN policy. Backwards compatibility is not going to be broken arbitrarily.

Your statement is very correct. I can try it

Just chiming in on the compilation issues. The line above (taken directly from the third post in this topic) does not seem correct; it sets the include path to /include and /include/libxml2, which are very likely to be incorrect. The reason for that is a deeper change that happened between R 4.1 and R 4.2 in R itself. Let me elaborate on that a bit.

Before R 4.2, R used the msvcrt C runtime on Windows. In R 4.2, R switched to using the newer and better ucrt runtime. However, this meant that lots of packages that compiled just fine on R 4.1 did not compile on R 4.2. The solution from R’s authors was to require package authors to supply two build configuration files on Windows; Makevars.win is for R 4.1 and before, and Makevars.ucrt is for R 4.2 and after. Newer igraph versions supply both, so they compile just fine in both versions. Older igraph versions like igraph 1.2.1, which came before R started making the transition to ucrt, don’t supply Makevars.ucrt, and hence they cannot compile on Windows with newer versions of R. This is completely outside of our control; R 4.2 wasn’t around when igraph 1.2.1 was released so we couldn’t have prepared for that.

The point is: if you want to compile igraph 1.2.1, you need to go back in time to when igraph 1.2.1 was released, and try to replicate the build environment for that date. This includes installing an older version of R (4.1 would probably work; if it doesn’t, try 4.0), and the corresponding developer tools for that version of R. I know it’s complex, that’s why we are encouraging you to just stick to the latest version of R and igraph, and if something doesn’t work from the example code of your book, let’s try to fix what’s wrong with the code instead.

1 Like

I give you this code, can you run it? What is your email?

I have the source code of this book, but I have to travel under the latest R package. I have limited knowledge and can’t troubleshoot errors. What is your email? I’ll give you the source code. I want it to work normally under the latest R package. Thank you.

Unfortunately, going through the code in that book and fixing it for you is outside the scope of support that we can offer in these discussion forums. I’d recommend you to start processing the code yourself, and if you have specific problems that you run into and you cannot solve yourself on your own, show us what you tried so far and we’ll see what we can do there.

I’m disappointed to hear this explanation,But I can pay

Just show an example of an error. Then it will become clear what is going on. There is no guarantee that the code from the book will work in the obsolete version of R.

It is interesting to understand why old code no longer works.

If you want to pay, you could contribute to the igraph project.