Re: XQuartz and xorg-server

2021-01-23 Thread Ryan Schmidt



On Jan 20, 2021, at 17:32, Peter West wrote:

> I tried specifically building rgl from source. The source is available at 
> https://cran.r-project.org/src/contrib/rgl_0.104.16.tar.gz.
> 
> In R.app console, remove rgl package.
> 
> > remove.packages(“rgl”)
> > install.packages(, repos = NULL, type = “source”)
> 

> It doesn’t find X, so it skips OpenGL; configure in the source needs 
> tinkering.

I didn't have much luck with your command at first:


> install.packages("/tmp/rgl_0.104.16.tar.gz", repos = NULL, type = "source")
Warning in install.packages("/tmp/rgl_0.104.16.tar.gz", repos = NULL, type = 
"source") :
  'lib = 
"/opt/local/Library/Frameworks/R.framework/Versions/4.0/Resources/library"' is 
not writable
Would you like to use a personal library instead? (yes/No/cancel) y
Would you like to create a personal library
‘~/Library/R/4.0/library’
to install packages into? (yes/No/cancel) y
ERROR: dependencies ‘htmlwidgets’, ‘htmltools’, ‘knitr’, ‘jsonlite’, ‘shiny’, 
‘magrittr’, ‘crosstalk’, ‘manipulateWidget’ are not available for package ‘rgl’
* removing ‘/Users/rschmidt/Library/R/4.0/library/rgl’
Warning message:
In install.packages("/tmp/rgl_0.104.16.tar.gz", repos = NULL, type = "source") :
  installation of package ‘/tmp/rgl_0.104.16.tar.gz’ had non-zero exit status
> 


I found that I had to run


> install.packages("rgl")


which installed the dependencies first, and then rgl. In the configure output, 
I indeed see:


checking for X... no
configure: compiling without OpenGL support
configure: WARNING: X11 not found, continuing without OpenGL support.


It builds and installs, but evidently without X11 and OpenGL support.


I found the rgl source code at https://github.com/cran/rgl. I found in its 
configure.ac file that on macOS it explicitly adds /opt/X11 to the list of 
places where it looks for things. Since your X11 isn't there but is instead 
provided by MacPorts in /opt/local, you have to tell it that. It's pretty 
normal when building any software to have to tell it where the dependencies 
are. When you use MacPorts to build your software, we do this kind of thing for 
you so that any software you install with MacPorts can find any other software 
it needs that was also installed with MacPorts.

In the rgl readme, it mentions that the configure script supports these flags:


>   X11 WINDOWING SYSTEM OPTIONS
>   
> 
>   --x-includes=
> X11 C header files include path
> 
>   --x-libraries=
> X11 library linkage path


You can also learn this if you download the rgl source code manually, extract 
it, cd into its directory, and run ./configure --help.

I also found by searching that the r install.packages command accepts a 
configure.args argument for specifying arguments to pass to the configure 
script. So I tried this:


> install.packages("rgl", configure.args=c(rgl="--x-includes=/opt/local/include 
> --x-libraries=/opt/local/lib"))


This failed:


configure: error: in 
`/private/var/folders/0_/y8x8nfkh8xj125006s6dfkshgp/T/RtmpUbm2PQ/R.INSTALL128833eb7f828/rgl':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘rgl’
* removing ‘/Users/rschmidt/Library/R/4.0/library/rgl’


Unfortunately I don't know why because I can't look in the config.log because I 
don't know where it is.

Another possibility might be:


> install.packages("rgl", configure.vars=c(rgl="CPPFLAGS=-I/opt/local/include 
> LDFLAGS=-L/opt/local/lib"))


This would be a more general purpose solution that would work with any library 
dependencies, not just X11. But that failed the same way.

Perhaps these are problems specific to my computer and one of the above methods 
will work for you. If not, maybe you will know where r puts the build directory 
when it builds packages or, if it puts it in a temporary directory that it 
deletes automatically, how to tell it not to delete it so that we can have a 
look at it.




Re: XQuartz and xorg-server

2021-01-22 Thread Bill Cole

On 22 Jan 2021, at 20:27, Peter West wrote:

I assume all of these issues have been resolved for CPAN for perl and 
associated packages, but many R packages require compilation. Is that 
problem similar for CPAN?


MacPorts provides a very large collection of Perl module ports, but not 
all of what is available in CPAN. You can use CPAN to add modules to a 
MacPorts Perl world, but if you inadvertently add a module both via CPAN 
& MacPorts it can get messy.


--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire


Re: XQuartz and xorg-server

2021-01-22 Thread Peter West
R is in general a self-contained universe, as far as I can see. There is a 
mountain of packages that can be installed in the base system. In CRAN, 
packages are generally compiled into PIC code, or so the site says, but new 
versions of packages are often built from the R console, using the build 
environment assumed by R.app. Building R.app on your own involves Xcode and 
whatever libraries you want supported. CRAN provides a page full of compiled 
libraries which install into /usr/local for use in local R builds.

I assume all of these issues have been resolved for CPAN for perl and 
associated packages, but many R packages require compilation. Is that problem 
similar for CPAN?

Anyway, at the moment, I’ve gone back to the CRAN distributed R.app and XQuartz 
to try to build the package I want, within the distributed R environment.

Incidentally, there are alpha releases of XQuartz 2.8.0, being prepared by a 
bloke with an Apple email address. That’s interesting.

Peter

--
Peter West
p...@pbw.id.au
And when his family heard it, they went out to seize him, for they were saying, 
“He is out of his mind.”

> On 23 Jan 2021, at 8:31 am, Ken Cunningham  
> wrote:
> 
> If you’re trying to make a new port for something, and running into trouble, 
> I would suggest you open a ticket for it as a “request” ticket, post up what 
> you have, and we can work it through there if possible.
> 
> If you’re trying to build something that is already in MacPorts, but doesn’t 
> build for you, a ticket would be ideal.
> 
> If you’re trying to build something on your own, unrelated to MacPorts, but 
> using MacPorts parts, and it is not working, then show us the commands you’re 
> using so far (exact series of commands, devil is in the details) and someone 
> might be able to see what you need to do to get this working for you.
> 
> Best,
> 
> Ken





Re: XQuartz and xorg-server

2021-01-22 Thread Ken Cunningham
If you’re trying to make a new port for something, and running into trouble, I 
would suggest you open a ticket for it as a “request” ticket, post up what you 
have, and we can work it through there if possible.

If you’re trying to build something that is already in MacPorts, but doesn’t 
build for you, a ticket would be ideal.

If you’re trying to build something on your own, unrelated to MacPorts, but 
using MacPorts parts, and it is not working, then show us the commands you’re 
using so far (exact series of commands, devil is in the details) and someone 
might be able to see what you need to do to get this working for you.

Best,

Ken

Re: XQuartz and xorg-server

2021-01-21 Thread Peter West
Looking at the autoconf m4 files from /opt/local/share/autoconf/autoconf, I 
find two with lists of X11. autoconf.m4f, a generated file, and libs.m4, from 
which I assume autoconf.m4f was generated, have the following lists of X11 
directories.
ac_x_header_dirs='
/usr/X11/include
/usr/X11R7/include
/usr/X11R6/include
/usr/X11R5/include
/usr/X11R4/include

/usr/include/X11
/usr/include/X11R7
/usr/include/X11R6
/usr/include/X11R5
/usr/include/X11R4

/usr/local/X11/include
/usr/local/X11R7/include
/usr/local/X11R6/include
/usr/local/X11R5/include
/usr/local/X11R4/include

/usr/local/include/X11
/usr/local/include/X11R7
/usr/local/include/X11R6
/usr/local/include/X11R5
/usr/local/include/X11R4

/usr/X386/include
/usr/x386/include
/usr/XFree86/include/X11

/usr/include
/usr/local/include
/usr/unsupported/include
/usr/athena/include
/usr/local/x11r5/include
/usr/lpp/Xamples/include

/usr/openwin/include
/usr/openwin/share/include'

No /opt/local directories here. Is this a limitation that can be overriden in 
arguments to configure? I tried

autoconf -B /opt/local/include/X11 -B /opt/local/lib

but the configure comes out the same size, and when run tells me X11 not found.

Does the libs.m4 need to be tweaked?

Peter

> On 21 Jan 2021, at 9:32 am, Peter West  wrote:
> 
> I tried specifically building rgl from source. The source is available at 
> https://cran.r-project.org/src/contrib/rgl_0.104.16.tar.gz.
> 
> In R.app console, remove rgl package.
> 
> > remove.packages(“rgl”)
> > install.packages(, repos = NULL, type = “source”)
> 
> It doesn’t find X, so it skips OpenGL; configure in the source needs 
> tinkering.
> 
> Peter
> 
> --
> Peter West
> p...@pbw.id.au
> “So the Son of Man is lord even of the Sabbath..”
> 
> 
>> On 19 Jan 2021, at 4:38 pm, Peter West  wrote:
>> 
>> $ sudo port install xorg-server
>> $ sudo port install R
>> $ sudo port install R-app
>> 
>> 
>> Start MacPorts>R.app
>> 
>> In the R.app console
>> 
>> > install.packages(“rgl”)
>> 
>> This will involve a lot of compilation. The OpenMP problem seems to have 
>> been resolved by using the compiler /opt/local/bin/clang++-mp-9.0, and you 
>> will see plenty of this.
>> 
>> When that finishes, in the console
>> 
>> > library(rgl)
>> 
>> I get
>> This build of rgl does not include OpenGL functions.  Use
>>  rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).
>> 
>> So I should get output that way, but I’m curious about the “native” way of 
>> doing it.
>> 
>> Peter
>> 
>> 
>> --
>> Peter West
>> p...@pbw.id.au
>> “So the Son of Man is lord even of the Sabbath..”
>> 
>>> On 19 Jan 2021, at 12:58 pm, Ryan Schmidt  wrote:
>>> 
>>> 
>>> 
>>> On Jan 18, 2021, at 04:56, Peter West wrote:
>>> 
 I’ve removed XQuartz (again), and installed R and R-app from MacPorts. The 
 R install warned me that
 Clang compilers provided by Xcode do not support OpenMP. Some R packages 
 using OpenMP may require additional
  flags in the Makevar file (e.g. data.table) to build. Please consult 
 package documentation.
 
 I install.package’d data.table without whinging, then did the same for 
 rgl. It built, but when I loaded the library, I was informed that
 This build of rgl does not include OpenGL functions.
 
 Looking around for mentions of OpenGL, I couldn’t se anything that looked 
 like an OpenGL library.
>>> 
>>> I don't know anything about R or rgl. I tried "port search rgl" and I'm not 
>>> sure if any of those are what you're referring to.
>>> 
>>> If you can provide an exact step-by-step list of commands to run to observe 
>>> the problem, then I could try them on my system and see if I can figure out 
>>> what needs to be changed.
>>> 
>> 
> 



--
Peter West
p...@pbw.id.au
And whenever the unclean spirits saw him, they fell down before him and cried 
out, “You are the Son of God.”



Re: XQuartz and xorg-server

2021-01-20 Thread Peter West
I tried specifically building rgl from source. The source is available at 
https://cran.r-project.org/src/contrib/rgl_0.104.16.tar.gz.

In R.app console, remove rgl package.

> remove.packages(“rgl”)
> install.packages(, repos = NULL, type = “source”)

It doesn’t find X, so it skips OpenGL; configure in the source needs tinkering.

Peter

--
Peter West
p...@pbw.id.au
“So the Son of Man is lord even of the Sabbath..”


> On 19 Jan 2021, at 4:38 pm, Peter West  wrote:
> 
> $ sudo port install xorg-server
> $ sudo port install R
> $ sudo port install R-app
> 
> 
> Start MacPorts>R.app
> 
> In the R.app console
> 
> > install.packages(“rgl”)
> 
> This will involve a lot of compilation. The OpenMP problem seems to have been 
> resolved by using the compiler /opt/local/bin/clang++-mp-9.0, and you will 
> see plenty of this.
> 
> When that finishes, in the console
> 
> > library(rgl)
> 
> I get
> This build of rgl does not include OpenGL functions.  Use
>  rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).
> 
> So I should get output that way, but I’m curious about the “native” way of 
> doing it.
> 
> Peter
> 
> 
> --
> Peter West
> p...@pbw.id.au 
> “So the Son of Man is lord even of the Sabbath..”
> 
>> On 19 Jan 2021, at 12:58 pm, Ryan Schmidt > > wrote:
>> 
>> 
>> 
>> On Jan 18, 2021, at 04:56, Peter West wrote:
>> 
>>> I’ve removed XQuartz (again), and installed R and R-app from MacPorts. The 
>>> R install warned me that
>>> Clang compilers provided by Xcode do not support OpenMP. Some R packages 
>>> using OpenMP may require additional
>>>  flags in the Makevar file (e.g. data.table) to build. Please consult 
>>> package documentation.
>>> 
>>> I install.package’d data.table without whinging, then did the same for rgl. 
>>> It built, but when I loaded the library, I was informed that
>>> This build of rgl does not include OpenGL functions.
>>> 
>>> Looking around for mentions of OpenGL, I couldn’t se anything that looked 
>>> like an OpenGL library.
>> 
>> I don't know anything about R or rgl. I tried "port search rgl" and I'm not 
>> sure if any of those are what you're referring to.
>> 
>> If you can provide an exact step-by-step list of commands to run to observe 
>> the problem, then I could try them on my system and see if I can figure out 
>> what needs to be changed.
>> 
> 



Re: XQuartz and xorg-server

2021-01-18 Thread Peter West
$ sudo port install xorg-server
$ sudo port install R
$ sudo port install R-app


Start MacPorts>R.app

In the R.app console

> install.packages(“rgl”)

This will involve a lot of compilation. The OpenMP problem seems to have been 
resolved by using the compiler /opt/local/bin/clang++-mp-9.0, and you will see 
plenty of this.

When that finishes, in the console

> library(rgl)

I get
This build of rgl does not include OpenGL functions.  Use
 rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).

So I should get output that way, but I’m curious about the “native” way of 
doing it.

Peter


--
Peter West
p...@pbw.id.au
“So the Son of Man is lord even of the Sabbath..”

> On 19 Jan 2021, at 12:58 pm, Ryan Schmidt  wrote:
> 
> 
> 
> On Jan 18, 2021, at 04:56, Peter West wrote:
> 
>> I’ve removed XQuartz (again), and installed R and R-app from MacPorts. The R 
>> install warned me that
>> Clang compilers provided by Xcode do not support OpenMP. Some R packages 
>> using OpenMP may require additional
>>  flags in the Makevar file (e.g. data.table) to build. Please consult 
>> package documentation.
>> 
>> I install.package’d data.table without whinging, then did the same for rgl. 
>> It built, but when I loaded the library, I was informed that
>> This build of rgl does not include OpenGL functions.
>> 
>> Looking around for mentions of OpenGL, I couldn’t se anything that looked 
>> like an OpenGL library.
> 
> I don't know anything about R or rgl. I tried "port search rgl" and I'm not 
> sure if any of those are what you're referring to.
> 
> If you can provide an exact step-by-step list of commands to run to observe 
> the problem, then I could try them on my system and see if I can figure out 
> what needs to be changed.
> 



Re: XQuartz and xorg-server

2021-01-18 Thread Ryan Schmidt



On Jan 18, 2021, at 04:56, Peter West wrote:

> I’ve removed XQuartz (again), and installed R and R-app from MacPorts. The R 
> install warned me that
> Clang compilers provided by Xcode do not support OpenMP. Some R packages 
> using OpenMP may require additional
>   flags in the Makevar file (e.g. data.table) to build. Please consult 
> package documentation.
> 
> I install.package’d data.table without whinging, then did the same for rgl. 
> It built, but when I loaded the library, I was informed that
> This build of rgl does not include OpenGL functions.
> 
> Looking around for mentions of OpenGL, I couldn’t se anything that looked 
> like an OpenGL library.

I don't know anything about R or rgl. I tried "port search rgl" and I'm not 
sure if any of those are what you're referring to.

If you can provide an exact step-by-step list of commands to run to observe the 
problem, then I could try them on my system and see if I can figure out what 
needs to be changed.



Re: XQuartz and xorg-server

2021-01-18 Thread Peter West
I’ve removed XQuartz (again), and installed R and R-app from MacPorts. The R 
install warned me that
Clang compilers provided by Xcode do not support OpenMP. Some R packages using 
OpenMP may require additional
  flags in the Makevar file (e.g. data.table) to build. Please consult package 
documentation.

I install.package’d data.table without whinging, then did the same for rgl. It 
built, but when I loaded the library, I was informed that
This build of rgl does not include OpenGL functions.

Looking around for mentions of OpenGL, I couldn’t se anything that looked like 
an OpenGL library.

Any suggestions?

Peter


--
Peter West
p...@pbw.id.au
“But new wine is for fresh wineskins.”

> On 17 Jan 2021, at 3:44 pm, Ryan Schmidt  wrote:
> 
> On Jan 16, 2021, at 08:18, Peter West wrote:
> 
>> Following some general advice given earlier on the list, I had removed 
>> XQuartz and installed xorg-server. Now I am trying to load the rgl R 
>> library. At the end of the error message is
>> This build of rgl depends on XQuartz, which you can download from 
>> xquartz.org.
>> 
>> Am  stuck with using XQuartz if I want to run this package, or is it 
>> possible to switch between the two?
> 
> XQuartz and xorg-server are the same software, except that xorg-server is 
> several years more up to date. There would be no advantage to installing 
> XQuartz instead of xorg-server.
> 
> If the rgl R library is something you are installing outside of MacPorts, 
> then perhaps it is looking specifically for XQuartz in its install location 
> of /opt/X11. You may need to inform it that you have installed it to the 
> MacPorts prefix /opt/local instead.
> 



Re: XQuartz and xorg-server

2021-01-16 Thread Ryan Schmidt
On Jan 16, 2021, at 08:18, Peter West wrote:

> Following some general advice given earlier on the list, I had removed 
> XQuartz and installed xorg-server. Now I am trying to load the rgl R library. 
> At the end of the error message is
> This build of rgl depends on XQuartz, which you can download from xquartz.org.
> 
> Am  stuck with using XQuartz if I want to run this package, or is it possible 
> to switch between the two?

XQuartz and xorg-server are the same software, except that xorg-server is 
several years more up to date. There would be no advantage to installing 
XQuartz instead of xorg-server.

If the rgl R library is something you are installing outside of MacPorts, then 
perhaps it is looking specifically for XQuartz in its install location of 
/opt/X11. You may need to inform it that you have installed it to the MacPorts 
prefix /opt/local instead.