Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGtk2 trouble #4

Closed
martin-hajek opened this issue Dec 30, 2021 · 59 comments
Closed

RGtk2 trouble #4

martin-hajek opened this issue Dec 30, 2021 · 59 comments
Labels
bug Something isn't working

Comments

@martin-hajek
Copy link

When I try your assistant in Win10, I get the message:

RQDAassist::install()
Your system is ready to build packages!
Installing 'RGtk2'. If it fails, use install.packages in R console ... Run library(RGtk2) in R to install Gtk+. Then, rerun this function.
‘gWidgets’ is already installed
‘gWidgetsRGtk2’ was not installed because RGtk2 is not ready
‘RQDA’ was not installed because RGtk2 is not ready
Warning message: package ‘cairoDevice’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

However, I am unable to install 'RGtk2' myself. If I install it from old sources I get the error:
Package 'RGtk2' was installed before R 4.0.0: please re-install it.

How to install 'RGtk2' on R 4.1.2 in Win10 (using RStudio) to get the RQDAassist work?

@BroVic
Copy link
Owner

BroVic commented Dec 30, 2021

Hi, thanks to your report, I just noticed that RGtk2 has recently been archived on CRAN. I will provide an update to the package to take care of this development. Cheers.

@BroVic BroVic added the bug Something isn't working label Dec 30, 2021
@BroVic
Copy link
Owner

BroVic commented Jan 2, 2022

Ref this issue.

Let us see if the RGtk2 archiving is resolved. In the meantime, I will work on a fix, but the way forward seems to be building RGtk2 from source. This is no trivial task because of the dependencies that have to be pre-installed.

@BroVic
Copy link
Owner

BroVic commented Jan 2, 2022

Okay, I have additional information. RQDA itself will no longer be maintained by the package author as stated in this commit. Likewise, this fork has effectively been retired. Unless something still happens at CRAN, this is likely the end of the road.

@mauriziopassariello
Copy link

Hi, I am having same trouble installing RQDA. Is there any workaround that works or should we just give up? are you aware of any other R package for qualitative analysis?
Thanks

@BroVic
Copy link
Owner

BroVic commented Jan 3, 2022

@mauriziopassariello
Personally, I can't afford to start off with new software immediately, so I'm trying to work around it. If I succeed, I will post the info on the thread.

@BroVic
Copy link
Owner

BroVic commented Jan 5, 2022

Quick announcement: I've been able to work around the issue, having successfully built RGtk2 on Windows. I will articulate this as a function later in the day (I'm in GMT+1) and provide details on the approach used.

@mauriziopassariello
Copy link

@BroVic any news about this? I forgot to mention I am using a Mac or Rstudio Cloud... I'd really need to use RQDA now!

@BroVic
Copy link
Owner

BroVic commented Jan 6, 2022

@mauriziopassariello I've just applied a fix but for now it's likely to work on Windows.

I don't own a Mac but I can dig around a little and see how you can go about it.

#6

@BroVic
Copy link
Owner

BroVic commented Jan 6, 2022

@mauriziopassariello

Try this:

  1. Get the Gtk+ distribution from http://r.research.att.com/libs/GTK_2.24.17-X11.pkg.
  2. Install RGtk2 using this
# install.packages("remotes")
remotes::install_version("RGtk2", "2.20.36", upgrade = "never", build = TRUE, repos = "https://cran.r-project.org", INSTALL_opts = "--no-multiarch")

This version of Gtk is the one that correctly matches the archived version of RGtk2 (as stated beginning line 79 of this file).

If the installation works, you have to wait for quite some time for the package to compile. This is the best I can give as I only have experience with Windows and Linux - if you know how to compile code and how PATH works on your machine you should be able to solve it. For additional clues on installing this package on Mac, you can also consult the README at https://github.com/RQDA/RQDA/blob/main/README.md.

@mauriziopassariello
Copy link

mauriziopassariello commented Jan 6, 2022 via email

@BroVic
Copy link
Owner

BroVic commented Jan 6, 2022

No, it's highly unlikely that you would be able to do this on the cloud unless you use configuration scripts to ensure the availability of the dependencies. However, I think with containerized environments this could be done, but I'm not sure how to go about that at the moment.

@mauriziopassariello
Copy link

@BroVic
I tried on my mac with your suggestion but failed :(
This is what I get:

remotes::install_version("RGtk2", "2.20.36", upgrade = "never", build = TRUE, repos = "https://cran.r-project.org", INSTALL_opts = "--no-multiarch")
Downloading package from url: https://cran.r-project.org/src/contrib/Archive/RGtk2/RGtk2_2.20.36.tar.gz
✓ checking for file ‘/private/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T/RtmpX435Ad/remotes25fb5bf4c1b8/RGtk2/DESCRIPTION’ ...
─ preparing ‘RGtk2’: (2s)
✓ checking DESCRIPTION meta-information
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts (7.6s)
─ checking for empty or unneeded directories (359ms)
─ building ‘RGtk2_2.20.36.tar.gz’

  • installing source package ‘RGtk2’ ...
    ** using staged installation
    checking for pkg-config... no
    checking for INTROSPECTION... no
    checking for GTK... no
    configure: error: GTK version 2.8.0 required
    ERROR: configuration failed for package ‘RGtk2’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RGtk2’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//RtmpX435Ad/file25fb24a35a5c/RGtk2_2.20.36.tar.gz’ had non-zero exit status

@BroVic
Copy link
Owner

BroVic commented Jan 7, 2022

@mauriziopassariello
TL;DR
First get GTK before installing RGtk2 otherwise you can't compile its C code.
---.
Yes, before running that function, you have to first get the GTK distribution. In my last comment, I gave you a link for that.

The next thing you have to ensure is that the compiler will see the GTK so that the library headers and binaries can be statically linked to build RGtk2. How exactly to do that on Mac, I can't tell you.

@BroVic
Copy link
Owner

BroVic commented Jan 11, 2022

The original issue has been resolved, so I am closing this. I will, however, work to automate this process on Mac as well.

@BroVic BroVic closed this as completed Jan 11, 2022
@martin-hajek
Copy link
Author

It worked for me. Thank you!

@mauriziopassariello
Copy link

mauriziopassariello commented Jan 11, 2022 via email

@BroVic
Copy link
Owner

BroVic commented Jan 11, 2022

@mauriziopassariello

Sure, I've asked a friend to lend me their Mac next weekend. Hopefully after that I will have some answers for you.

@BroVic BroVic reopened this Jan 11, 2022
@BroVic
Copy link
Owner

BroVic commented Jan 11, 2022

@martin-hajek Excellent news. Thank you!

@BroVic
Copy link
Owner

BroVic commented Jan 16, 2022

@mauriziopassariello

Try installing RGtk2 for Mac using this code:

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/macosx/contrib/4.1/RGtk2_2.20.36.2.tgz", repos=NULL)

Source: Rattle homepage

@mauriziopassariello
Copy link

@BroVic

Thanks. Some good news for me. I managed to install RGtk2 without issues. Then I ran the RQDA assistant but got the following error (after it ran for several minutes without complaints):

make: gfortran: No such file or directory
make: *** [dgetv0.o] Error 1
ERROR: compilation failed for package ‘igraph’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/igraph’

The downloaded source packages are in
‘/private/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T/RtmpUtuxRw/downloaded_packages’
ERROR: dependencies ‘gWidgetsRGtk2’, ‘igraph’ are not available for package ‘RQDA’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RQDA’
    Warning messages:
    1: In install.packages(pkgs, repos = .rstudioMirror(), quiet = !verbose, :
    installation of package ‘igraph’ had non-zero exit status
    2: In install_rgtk2_and_deps() :
    Automatic Gtk distribution is not (yet) supported for this platform
    3: In value[3L] : Gtk+ was not properly situated in RGtk2
    4: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//RtmpUtuxRw/remotes5cd832dba32c/cairoDevice’ had non-zero exit status
    5: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//RtmpUtuxRw/remotes5cd872b5b74a/gWidgetsRGtk2’ had non-zero exit status
    6: In i.p(...) : installation of package ‘igraph’ had non-zero exit status
    7: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//RtmpUtuxRw/remotes5cd86fc0f9e4/RQDA’ had non-zero exit status

What do you think the issue is? How ccan I proceed now?

Thanks,

Maurizio

@BroVic
Copy link
Owner

BroVic commented Jan 16, 2022

Okay @mauriziopassariello I thought I stated that RQDAassist does not currently support Mac (but it will soon). Now that you've installed RGtk2, try this:

# install.packages(c("remotes", "purrr"))

# when installing igraoh, make sure you install the binaries,
# and not the source to avoid possible compilation errors.
install.packages("igraph")

pkgs <- c( 
    cairoDevice = "2.28.2", 
    gWidgets = '0.0-54.2', 
    gWidgetsRGtk2 = '0.0-86', 
    RQDA = '0.3-1' 
  )

installer <- function(version, pkgname) {
  remotes::install_version(
    pkgname
    version,
    repos = "https://cran.r-project.org",
    upgrade = "never"
  )
}

purrr::iwalk(pkgs, installer)

Please note that I'm doing this on mobile, so I couldn't actually test this code.

@mauriziopassariello
Copy link

@BroVic

Thank you ever so much for helping out. I think I'm close to have it installed but not as yet! This is what happened:

  1. install.packages("igraph") no issues here

  2. pkgs <- c(
    cairoDevice = "2.28.2",
    gWidgets = '0.0-54.2',
    gWidgetsRGtk2 = '0.0-86',
    RQDA = '0.3-1'
    )
    It loads this

  3. I get an error here:
    installer <- function(version, pkgname) {
    remotes::install_version(
    pkgname
    version,
    repos = "https://cran.r-project.org",
    upgrade = "never"
    )
    }

It looks like there is a typo somewhere but I can't figure it out! This is the error:
Error: unexpected symbol in:
" pkgname
version"

    repos = "https://cran.r-project.org",

Error: unexpected ',' in " repos = "https://cran.r-project.org","

    upgrade = "never"
)

Error: unexpected ')' in " )"

}
Error: unexpected '}' in "}"

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

@mauriziopassariello yea, I'm sorry there is a typo. Place a comma after pkgname.

@mauriziopassariello
Copy link

@BroVic

Argh still nothing! Although pkg-config is in the list of packages and ticked.

Downloading package from url: https://cran.r-project.org/src/contrib/Archive/cairoDevice/cairoDevice_2.28.2.tar.gz

  • installing source package ‘cairoDevice’ ...
    ** package ‘cairoDevice’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for pkg-config... no
    ERROR: Cannot find pkg-config.
    ERROR: configuration failed for package ‘cairoDevice’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/cairoDevice’
    Downloading package from url: https://cran.r-project.org/src/contrib/Archive/gWidgets/gWidgets_0.0-54.2.tar.gz
  • installing source package ‘gWidgets’ ...
    ** package ‘gWidgets’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (gWidgets)
    Downloading package from url: https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.tar.gz
    ERROR: dependency ‘cairoDevice’ is not available for package ‘gWidgetsRGtk2’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/gWidgetsRGtk2’
    Downloading package from url: https://cran.r-project.org/src/contrib/Archive/RQDA/RQDA_0.3-1.tar.gz
    ERROR: dependency ‘gWidgetsRGtk2’ is not available for package ‘RQDA’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RQDA’
    Warning messages:
    1: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//Rtmpp1w47i/remotes175be1dd46a6b/cairoDevice’ had non-zero exit status
    2: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//Rtmpp1w47i/remotes175be48767104/gWidgetsRGtk2’ had non-zero exit status
    3: In i.p(...) :
    installation of package ‘/var/folders/n_/js8ms9m56sx3pdn3nykw0r8h0000gn/T//Rtmpp1w47i/remotes175bef14c57/RQDA’ had non-zero exit status

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

@mauriziopassariello indeed, this is because cairoDevice needs GTK if it is to be built from source. And that was where you had the original problem. So, just like you did with RGtk2, you can try to install the binaries instead. I did a little poking around on the Microsoft CRAN mirror and got this link you can try. Run

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/macosx/contrib/4.1/cairoDevice_2.28.2.1.tgz", repos = NULL)

If it succeeds, remove cairoDevice from the last code I sent you, and run it again. I expect it to work this time.

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

Okay, try this:

# Link to GtK 
url <- "https://r.research.att.com/libs/GTK_2.24.17-X11.pkg"

# Download to location (temporary)
path <- file.path(tempdir(), basename(url))
download.file(url, path, mode = "wb")

# Unpack GTK using system command
system(paste("open", path))

Let's see if this works. Sorry that I'm not very proficient on Mac.

@mauriziopassariello
Copy link

@BroVic
The URL seems not to be working. Can I download it from anywhere else? I understand it needs to be a specific version to work.
" Sorry that I'm not very proficient on Mac." You are helping me and this is very much. appreciated.

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

You need a particular version of Gtk. On Linux (Ubundu/Debian) one would do this:

$ sudo apt update
$ sudo apt install -y libgtk2.0-dev

I don't know how to do this on Mac, but an internet search led me to this document and this one. I would favour this one from the second link:

$ sudo port install pkgconfig
$ sudo port install gtk2

@mauriziopassariello
Copy link

This is all very frustrating. I am now sure I have installed both GTK and RGTK2. However, when I install the rest I get stuck and I get the error that I don't have GTK. Should GTK appear in my packages? Do I have. to load anything with library()?

Please install GTK+ from http://r.research.att.com/libs/GTK_2.18.5-X11.pkg
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error: package or namespace load failed for ‘gWidgetsRGtk2’:
.onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details:
call: .Call(name, ..., PACKAGE = PACKAGE)
error: "S_gtk_icon_factory_new" not available for .Call() for package "RGtk2"
Error: loading failed
Execution halted

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

... please ensure that GTK+ is installed and that it is on your PATH environment variable

Is GTK+ on your PATH?

Yes, it's frustrating, but take solace in the fact that you're learning new things along the way.

Somebody once wrote to me that when they ran library(RGtk2) on Mac, they were prompted to install Gtk+ automatically. I wonder why you couldn't....

@mauriziopassariello
Copy link

mauriziopassariello commented Jan 18, 2022 via email

@BroVic
Copy link
Owner

BroVic commented Jan 18, 2022

I don't know how it's done on Mac, but I'm sure an internet search should lead you to an article on that.

PATH is what enables applications to be found from anywhere on your computer. So, if RGtk2 depends on GTK, it has to see it before it can use it.

On Windows, the installed RGtk2 package actually has a folder called 'gtk' where the entire GTK distribution is copied into and that's how it's able to use it. On Linux it's not like that, as it depends on PATH to make GTK available, and since Mac is a Unix-like system, I should expect it to be somewhat similar.

It's almost midnight where I am, so if you have other questions I may not respond till tomorrow morning my time 😊

@mauriziopassariello
Copy link

@BroVic
I have tried to understand but unsuccessful so far. As you say GTK is installed but not "seen" by RGtk2. Can you point me to the right direction as how to use PATH to fix this problem? Think that once I solve this I should finally be there!

@BroVic
Copy link
Owner

BroVic commented Jan 20, 2022

Do you remember how you installed GTK? With that info I can at least do a search for a possible solution.

@mauriziopassariello
Copy link

@BroVic
I installed it by loading the library(RGtk2). Then you get a prompt to install GTK.

@BroVic
Copy link
Owner

BroVic commented Jan 21, 2022

If you installed GTK via that prompt, then you ought to have it. If you're still unable to install gWidgetsRGtk2 and RQDA, using the code I sent you, here's what I would do:

  • Check whether Gtk+ is on my system.
  • Check whether multiple GTK installations exist.

If you don't know how to conduct these checks on a Mac; you will have to search the web. For example, I found this link

Also, if you still have an error, restart R, reproduce the error, run sessionInfo() and post the output of both for us to see. Good luck. Yes, I also think you're close...

@seltheol
Copy link

I too have a problem installing RGtk2. I tried different ways to install it but all failed

> RQDAassist::install()
This installation may take some time. Continue (Y/N)? Y
Check if Gtk distribution is in place... yes
Set environment variable 'GTK_PATH'... Done
versuche URL 'https://cran.r-project.org/src/contrib/Archive/RGtk2/RGtk2_2.20.36.3.tar.gz'
 length 2792517 bytes (2.7 MB)
downloaded 2.7 MB

Extract RGtk2 archive... untar: using cmd = ‘tar.exe -xf "C:\Users\HP\AppData\Local\Temp\RtmpYJ1EMU/RGtk2_2.20.36.3.tar.gz" -C "C:/Users/HP/AppData/Local/Temp/RtmpYJ1EMU"’
Done
  
  
  
   checking for file 'C:\Users\HP\AppData\Local\Temp\RtmpYJ1EMU\RGtk2/DESCRIPTION' ...
  
√  checking for file 'C:\Users\HP\AppData\Local\Temp\RtmpYJ1EMU\RGtk2/DESCRIPTION' (432ms)

  
  
  
-  preparing 'RGtk2': (9.9s)
   checking DESCRIPTION meta-information ...
  
√  checking DESCRIPTION meta-information
-  cleaning src

  
  
  
-  checking for LF line-endings in source and make files and shell scripts (17.3s)

  
  
  
-  checking for empty or unneeded directories (1.4s)

  
  
  
-  building 'RGtk2_2.20.36.3.tar.gz' (905ms)

  
Warnung:
  
   Warnung: file 'RGtk2/cleanup' did not have execute permissions: corrected

  
Warnung:
  
   Warnung: file 'RGtk2/configure' did not have execute permissions: corrected

  
   

Running "C:/PROGRA~1/R/R-4.1.2/bin/i386/Rcmd.exe" INSTALL \
  "C:\Users\HP\AppData\Local\Temp\RtmpYJ1EMU/RGtk2_2.20.36.3.tar.gz" \
  --install-tests --no-multiarch --no-test-load
* installing to library 'C:/Users/HP/Documents/R/win-library/4.1'

* installing *source* package 'RGtk2' ...

** using staged installation

** libs

"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/libxml2  -IC:/GTK/include/gdk-pixbuf-2.0 -IC:/GTK/include -I. -DR_LEGACY_S_DEFS=1         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c RGtkDataFrame.c -o RGtkDataFrame.o
In file included from ./RGtk2/atk.h:4,
                 from RGtk2/gtk.h:4,
                 from RGtkDataFrame.h:1,
                 from RGtkDataFrame.c:1:
./RGtk2/gobject.h:7:10: fatal error: glib.h: No such file or directory
 #include <glib.h>
          ^~~~~~~~
compilation terminated.

make: *** [C:/PROGRA~1/R/R-4.1.2/etc/i386/Makeconf:238: RGtkDataFrame.o] Error 1
ERROR: compilation failed for package 'RGtk2'

* removing 'C:/Users/HP/Documents/R/win-library/4.1/RGtk2'

Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
  System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed
Copy Gtk+ distribution to RGtk2 package... Done
Installing 'cairoDevice' ... 
Downloading package from url: https://cran.r-project.org/src/contrib/Archive/cairoDevice/cairoDevice_2.28.2.tar.gz
Installiere Paket nach ‘C:/Users/HP/Documents/R/win-library/4.1’
(da ‘lib’ nicht spezifiziert)
* installing *source* package 'cairoDevice' ...
** package 'cairoDevice' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/cairo -IC:/GTK/include/gdk-pixbuf-2.0 -IC:/GTK/include -IC:/PROGRA~1/R/R-4.1.2/include         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c R_init_cairoDevice.c -o R_init_cairoDevice.o
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/cairo -IC:/GTK/include/gdk-pixbuf-2.0 -IC:/GTK/include -IC:/PROGRA~1/R/R-4.1.2/include         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c cairoDevice.c -o cairoDevice.o
In file included from cairoDevice.c:1:
cairoDevice.h:1:10: fatal error: gtk/gtk.h: No such file or directory
 #include <gtk/gtk.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-4.1.2/etc/i386/Makeconf:238: cairoDevice.o] Error 1
ERROR: compilation failed for package 'cairoDevice'
* removing 'C:/Users/HP/Documents/R/win-library/4.1/cairoDevice'
‘gWidgets’ is already installed
Warnmeldungen:
1: In i.p(...) :
  installation of package ‘C:/Users/HP/AppData/Local/Temp/RtmpYJ1EMU/remotes1fb0da5d12/cairoDevice’ had non-zero exit status
2: In .f(.x[[i]], .y[[i]], ...) :
  ‘gWidgetsRGtk2’ was not installed because RGtk2 is not ready
3: In .f(.x[[i]], .y[[i]], ...) :
  ‘RQDA’ was not installed because RGtk2 is not ready
> 

@BroVic
Copy link
Owner

BroVic commented Feb 10, 2022

Hi, the installation skipped the step where GTK is set up, and I wonder why. Please restart and reproduce the error - then run sessionInfo() and share the output. Let me see if it's a bug in the function. Cheers.

@seltheol
Copy link

Thank you. Here is it:

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8        pillar_1.7.0      compiler_4.1.2    prettyunits_1.1.1
 [5] remotes_2.4.2     tools_4.1.2       readtext_0.81     testthat_3.1.2   
 [9] pkgbuild_1.3.1    pkgload_1.2.4     bit_4.0.4         tibble_3.1.6     
[13] memoise_2.0.1     RSQLite_2.2.9     lifecycle_1.0.1   pkgconfig_2.0.3  
[17] rlang_1.0.1       cli_3.1.1         DBI_1.1.2         curl_4.3.2       
[21] fastmap_1.1.0     httr_1.4.2        withr_2.4.3       stringr_1.4.0    
[25] dplyr_1.0.8       desc_1.4.0        generics_0.1.2    fs_1.5.2         
[29] vctrs_0.3.8       devtools_2.4.3    tidyselect_1.1.1  RQDAassist_0.4.0 
[33] rprojroot_2.0.2   bit64_4.0.5       data.table_1.14.2 glue_1.6.1       
[37] R6_2.5.1          processx_3.5.2    fansi_1.0.2       sessioninfo_1.2.2
[41] callr_3.7.0       purrr_0.3.4       blob_1.2.2        magrittr_2.0.2   
[45] ps_1.6.0          ellipsis_0.3.2    usethis_2.1.5     utf8_1.2.2       
[49] stringi_1.7.6     cachem_1.0.6      crayon_1.4.2      brio_1.1.3       
> 

@BroVic
Copy link
Owner

BroVic commented Feb 11, 2022

@seltheol

Seen. I will get back to you on this a little later.

@BroVic
Copy link
Owner

BroVic commented Feb 11, 2022

@seltheol

Please reinstall this package, as I've just published an update that should take care of the issue you have. You could set verbose to TRUE so that the steps are visible. Also note that there are a few steps that will appear like the installation has stalled especially during byte-compilation. Do not interrupt it when you get to that point. One final thing I noted when I tested the function is that network connectivity also plays a role - sometimes you have to run the function again to overcome that.

@seltheol
Copy link

Thank you! I reinstalled it and tried it (three times) but I still have the same problem

@BroVic
Copy link
Owner

BroVic commented Feb 12, 2022

Okay, try running this code and if successful run the function again to install RQDA and it's other dependencies.

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip", repos=NULL)

Clarification: This will download RGtk2 binaries on storage at MRAN (Microsoft). If it installs, you need to run library(RGtk2) just one time, and you will be prompted to install Gtk+. Do that, and then run RQDAassist::install(). My hope is that cairoDevice is able to install, if it gets stuck at that point, let me know so I can look for binaries for you.

@BroVic
Copy link
Owner

BroVic commented Feb 12, 2022

Also, @seltheol, please do me a favour and share your last error messages, for diagnostics.

@seltheol
Copy link

Okay, try running this code and if successful run the function again to install RQDA and it's other dependencies.

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip", repos=NULL)

Clarification: This will download RGtk2 binaries on storage at MRAN (Microsoft). If it installs, you need to run library(RGtk2) just one time, and you will be prompted to install Gtk+. Do that, and then run RQDAassist::install(). My hope is that cairoDevice is able to install, if it gets stuck at that point, let me know so I can look for binaries for you.

Sadly it still won´t install cairoDevice: `> install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip", repos=NULL)
Installiere Paket nach ‘C:/Users/HP/Documents/R/win-library/4.1’
(da ‘lib’ nicht spezifiziert)
versuche URL 'https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip'
Content type 'application/zip' length 16597400 bytes (15.8 MB)
downloaded 15.8 MB

package ‘RGtk2’ successfully unpacked and MD5 sums checked

library(RGtk2)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
kann shared object 'C:/Users/HP/Documents/R/win-library/4.1/RGtk2/libs/x64/RGtk2.dll' nicht laden:
LoadLibrary failure: %1 ist keine zulässige Win32-Anwendung.

versuche URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Content type 'application/zip' length 25830230 bytes (24.6 MB)
downloaded 24.6 MB

Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Warnmeldungen:
1: Failed to load RGtk2 dynamic library, attempting to install it.
2: In dir.create(config_path, recursive = TRUE) :
'C:\Users\HP\Documents\R\win-library\4.1\RGtk2\gtk\x64\etc\gtk-2.0' existiert bereits

library (RGtK2)
Fehler in library(RGtK2) : es gibt kein Paket namens ‘RGtK2’
RQDAassist::install()
This installation may take some time. Continue (Y/N)? Y
Check if Gtk distribution is in place... yes
Set environment variable 'GTK_PATH'... Done
Installing 'cairoDevice' ...
Downloading package from url: https://cran.r-project.org/src/contrib/Archive/cairoDevice/cairoDevice_2.28.2.tar.gz
Installiere Paket nach ‘C:/Users/HP/Documents/R/win-library/4.1’
(da ‘lib’ nicht spezifiziert)

  • installing source package 'cairoDevice' ...
    ** package 'cairoDevice' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    "C:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA1/R/R-4.1.2/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/cairo -IC:/GTK/include/gdk-pixbuf-2.0 -IC:/GTK/include -IC:/PROGRA1/R/R-4.1.2/include -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c R_init_cairoDevice.c -o R_init_cairoDevice.o
    "C:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA1/R/R-4.1.2/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/cairo -IC:/GTK/include/gdk-pixbuf-2.0 -IC:/GTK/include -IC:/PROGRA1/R/R-4.1.2/include -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cairoDevice.c -o cairoDevice.o
    In file included from cairoDevice.c:1:
    cairoDevice.h:1:10: fatal error: gtk/gtk.h: No such file or directory
    #include <gtk/gtk.h>
    ^~~~~~~~~~~
    compilation terminated.
    make: *** [C:/PROGRA~1/R/R-4.1.2/etc/x64/Makeconf:238: cairoDevice.o] Error 1
    ERROR: compilation failed for package 'cairoDevice'
  • removing 'C:/Users/HP/Documents/R/win-library/4.1/cairoDevice'
    Done
    gWidgets is already installed
    Installing 'gWidgetsRGtk2' ...
    Downloading package from url: https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.tar.gz
    Installiere Paket nach ‘C:/Users/HP/Documents/R/win-library/4.1’
    (da ‘lib’ nicht spezifiziert)
    ERROR: dependency 'cairoDevice' is not available for package 'gWidgetsRGtk2'
  • removing 'C:/Users/HP/Documents/R/win-library/4.1/gWidgetsRGtk2'
    Done
    Installing 'RQDA' ...
    Downloading package from url: https://cran.r-project.org/src/contrib/Archive/RQDA/RQDA_0.3-1.tar.gz
    Installiere Paket nach ‘C:/Users/HP/Documents/R/win-library/4.1’
    (da ‘lib’ nicht spezifiziert)
    ERROR: dependency 'gWidgetsRGtk2' is not available for package 'RQDA'
  • removing 'C:/Users/HP/Documents/R/win-library/4.1/RQDA'
    Done
    Warnmeldungen:
    1: In i.p(...) :
    installation of package ‘C:/Users/HP/AppData/Local/Temp/Rtmp0Ga3SZ/remotes671c256f3cd0/cairoDevice’ had non-zero exit status
    2: In i.p(...) :
    installation of package ‘C:/Users/HP/AppData/Local/Temp/Rtmp0Ga3SZ/remotes671c56dd3748/gWidgetsRGtk2’ had non-zero exit status
    3: In i.p(...) :
    installation of package ‘C:/Users/HP/AppData/Local/Temp/Rtmp0Ga3SZ/remotes671c7fbe4bea/RQDA’ had non-zero exit status

`

@BroVic
Copy link
Owner

BroVic commented Feb 13, 2022

Not to worry, I'm not all that surprised. Now install cairoDevice with this code

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/cairoDevice_2.28.2.1.zip", repos = NULL)

After this, you should be good to go to complete the rest of the installation.

@seltheol
Copy link

It worked perfectly! Thank you very much!

@BroVic
Copy link
Owner

BroVic commented Feb 13, 2022

Bitte!

@BroVic BroVic closed this as completed Feb 13, 2022
@KRYSTALM7
Copy link

@mauriziopassariello

Try this:

  1. Get the Gtk+ distribution from http://r.research.att.com/libs/GTK_2.24.17-X11.pkg.
  2. Install RGtk2 using this
# install.packages("remotes")
remotes::install_version("RGtk2", "2.20.36", upgrade = "never", build = TRUE, repos = "https://cran.r-project.org", INSTALL_opts = "--no-multiarch")

This version of Gtk is the one that correctly matches the archived version of RGtk2 (as stated beginning line 79 of this file).

If the installation works, you have to wait for quite some time for the package to compile. This is the best I can give as I only have experience with Windows and Linux - if you know how to compile code and how PATH works on your machine you should be able to solve it. For additional clues on installing this package on Mac, you can also consult README at https://github.com/RQDA/RQDA/blob/main/README.md.

  • installing source package 'RGtk2' ...
    ** using staged installation
    ** libs
    gcc -I"C:/R/R-4.2.3/include" -DNDEBUG -D_R_=1 -DUSE_R=1 -mms-bitfields -I/include/gtk-2.0 -I/lib/gtk-2.0/include -I/include/atk-1.0 -I/include/cairo -I/include/pango-1.0 -I/include/glib-2.0 -I/lib/glib-2.0/include -I/include/libxml2 -I/include/gdk-pixbuf-2.0 -I/include -I. -I"C:/R/Rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c RGtkDataFrame.c -o RGtkDataFrame.o
    In file included from ./RGtk2/atk.h:4,
    from RGtk2/gtk.h:4,
    from RGtkDataFrame.h:1,
    from RGtkDataFrame.c:1:
    ./RGtk2/gobject.h:7:10: fatal error: glib.h: No such file or directory
    7 | #include <glib.h>
    | ^~~~~~~~
    compilation terminated.
    make: *** [C:/R/R-4.2.3/etc/x64/Makeconf:253: RGtkDataFrame.o] Error 1
    ERROR: compilation failed for package 'RGtk2'
  • removing 'C:/R/R-4.2.3/library/RGtk2'

@KRYSTALM7
Copy link

This is the error i am getting

@BroVic
Copy link
Owner

BroVic commented Apr 14, 2023

Please restart R, reproduce the error, and post the output of sessionInfo().

@roohy466
Copy link

Hi There, I am trying to install the RGtk2 in a docker but I get this error. Any help really appreciated!

      #19 112.5 In file included from /usr/include/glib-2.0/glib/galloca.h:32,
      #19 112.5                  from /usr/include/glib-2.0/glib.h:30,
      #19 112.5                  from ./RGtk2/gobject.h:7,
      #19 112.5                  from RGtk2/cairo.h:7,
      #19 112.5                  from cairoConversion.c:1:
      #19 112.5 /usr/include/glib-2.0/glib/gtypes.h:553:8: note: declared here
      #19 112.5   553 | struct _GTimeVal
      #19 112.5       |        ^~~~~~~~~
      #19 112.5 cairoConversion.c: In function 'asRCairoPath':
      #19 112.5 cairoConversion.c:45:25: error: 'PROBLEM' undeclared (first use in this function)
      #19 112.5    45 |                         PROBLEM "Converting Cairo path: did not understand type %d", data->header.type
      #19 112.5       |                         ^~~~~~~
      #19 112.5 cairoConversion.c:45:25: note: each undeclared identifier is reported only once for each function it appears in
      #19 112.5 cairoConversion.c:45:32: error: expected ';' before string constant
      #19 112.5    45 |                         PROBLEM "Converting Cairo path: did not understand type %d", data->header.type
      #19 112.5       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      #19 112.5       |                                ;
      #19 112.5 cairoConversion.c: In function 'asCCairoPath':
      #19 112.5 cairoConversion.c:95:33: error: 'PROBLEM' undeclared (first use in this function)
      #19 112.5    95 |                                 PROBLEM "Converting Cairo path: did not understand type %d", type
      #19 112.5       |                                 ^~~~~~~
      #19 112.5 cairoConversion.c:95:40: error: expected ';' before string constant
      #19 112.5    95 |                                 PROBLEM "Converting Cairo path: did not understand type %d", type
      #19 112.5       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      #19 112.5       |                                        ;
      #19 112.6 make: *** [/usr/lib/R/etc/Makeconf:191: cairoConversion.o] Error 1
      #19 112.6 ERROR: compilation failed for package 'RGtk2'
      #19 112.6 * removing '/usr/local/lib/R/site-library/RGtk2'

@BroVic
Copy link
Owner

BroVic commented Sep 20, 2023

Hello, @roohy466

The package has only been properly tested on Windows, but I will investigate this. Please send the output of sessionInfo() as well.

@roohy466
Copy link

sessionInfo()

  > sessionInfo()
  R version 4.3.1 (2023-06-16)
  Platform: x86_64-pc-linux-gnu (64-bit)
  Running under: Ubuntu 22.04.3 LTS
  
  Matrix products: default
  BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
  LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
  
  locale:
  [1] C
  
  time zone: Etc/UTC
  tzcode source: system (glibc)
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  loaded via a namespace (and not attached):
  [1] compiler_4.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants