Re: [R] 32bit application

2023-06-28 Thread Ivan Krylov
В Wed, 28 Jun 2023 13:25:21 +0530
Venky Vulpine  пишет:

> After running " pacman -S mingw-w64-i686-gcc", it installed 15
> packages. Then I ran the " make all recommended MULTI=32" command.
> But it still shows the same issue.

Here's what I've been able to find out.

In addition to mingw-w64-i686-gcc, you also need to install the
following packages:

mingw-w64-i686-gcc-fortran
mingw-w64-i686-bzip2
mingw-w64-i686-xz
mingw-w64-i686-pcre2
mingw-w64-i686-icu
mingw-w64-i686-curl
mingw-w64-i686-libgcrypt
mingw-w64-i686-libpng
mingw-w64-i686-libjpeg
mingw-w64-i686-libtiff

(Type pacman -Sy followed by the package names, space-separated.)

When setting the $PATH, use the following prefix instead of
x86_64-w64-mingw32.static.posix:

export PATH=/mingw32/bin:"$PATH"

This gets you most of the way to start compiling R, except there are
quite a few things that the compiler doesn't like about the code for
some reason. They can be patched around using terrible hacks, making me
wonder how this worked in the past. I also had to disable the tcltk
package because the Tcl bundle is understandably 64-bit only. Did I
forget another setting that enables 32-bit compatibility?

The resulting command line to compile R is as follows:

make MULTI=32 BUILD_TCLTK=no all recommended \
 ICU_LIBS="-licuin -licuuc -licudt -lstdc++" \
 CURL_LIBS="-lcurl -lbcrypt -lzstd -lssl -lssh2 -lgcrypt -lcrypto -lgdi32 -lz 
-lws2_32 -lgdi32 -lcrypt32 -lidn2 -lunistring -liconv -lgpg-error -lwldap32 
-lwinmm"

And I had to apply the following patches:

Index: src/extra/intl/dcigettext.c
===
--- src/extra/intl/dcigettext.c (revision 84610)
+++ src/extra/intl/dcigettext.c (working copy)
@@ -157,7 +157,7 @@
 #  else
 /* This is naughty if already declared, but harmful on Win64 */
 #   ifndef _WIN64
-char *getcwd (char *, size_t);
+//char *getcwd (char *, size_t);
 #   endif
 #  endif
 # endif
Index: src/extra/trio/compat.c
===
--- src/extra/trio/compat.c (revision 84610)
+++ src/extra/trio/compat.c (working copy)
@@ -1,5 +1,6 @@
 /* Compatibility wrapper for R */
-#include 
+//#include 
+typedef struct FILE_ FILE;
 #include 
 #include 
 int trio_printf(const char *format, ...);
Index: src/gnuwin32/front-ends/graphappmain.c
===
--- src/gnuwin32/front-ends/graphappmain.c  (revision 84610)
+++ src/gnuwin32/front-ends/graphappmain.c  (working copy)
@@ -15,7 +15,7 @@
 {
 extern void AppMain(int argc, char **argv);
 
-#ifdef _W64
+#if 0
 __declspec(dllimport) extern int __argc;
 __declspec(dllimport) extern char **__argv;
 
@@ -22,11 +22,11 @@
 GA_startgraphapp(Instance, PrevInstance, CmdShow);
 AppMain(__argc, __argv);
 #else
-__declspec(dllimport) extern int _argc;
-__declspec(dllimport) extern char **_argv;
+extern int __argc;
+extern char **__argv;
 
 GA_startgraphapp(Instance, PrevInstance, CmdShow);
-AppMain(_argc, _argv);
+AppMain(__argc, __argv);
 #endif
 return 0;
 }
Index: src/main/main.c
===
--- src/main/main.c (revision 84610)
+++ src/main/main.c (working copy)
@@ -798,7 +798,7 @@
 
 extern void _invoke_watson(const wchar_t*, const wchar_t*, const wchar_t*,
 unsigned int, uintptr_t);
-
+#if 0
 static void invalid_parameter_handler_watson(
 const wchar_t* expression,
 const wchar_t* function,
@@ -809,6 +809,7 @@
 _invoke_watson(expression, function, file, line, reserved);
 }
 #endif
+#endif
 
 void setup_Rmainloop(void)
 {
@@ -823,8 +824,10 @@
char *p = getenv("_R_WIN_CHECK_INVALID_PARAMETERS_");
if (p && StringTrue(p))
_set_invalid_parameter_handler(invalid_parameter_handler_abort);
+#if 0
else if (p && !strcmp(p, "watson"))
_set_invalid_parameter_handler(invalid_parameter_handler_watson);
+#endif
 }
 #endif
 
I don't like these patches one bit and I'm sorry to post them here, but
I did get a 32-bit R.exe in the end. It seems to install packages (from
source) and run example code successfully.

-- 
Best regards,
Ivan
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 32bit application

2023-06-28 Thread Venky Vulpine
After running " pacman -S mingw-w64-i686-gcc", it installed 15 packages.
Then I ran the " make all recommended MULTI=32" command. But it still shows
the same issue.
It will be great if somewhere I get a 32bit installer for newer R versions.
But it seems it is discontinued.
Anyway, thanks @Ivan Krylov  for responding to
mails. It really means a lot.
Have a nice day!

Thanks,
Venkatesh U

On Wed, Jun 28, 2023 at 1:15 PM Ivan Krylov  wrote:

> On Wed, 28 Jun 2023 13:02:41 +0530
> Venky Vulpine  wrote:
>
> > C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
> > incompatible
> >
> c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingw32.a
> > when searching for -lmingw32
>
> This is what progress looks like!
>
> The current problem is that you have 64-bit import libraries installed
> under .../x86_64-w64-mingw32.static.posix/... and there are probably no
> 32-bit import libraries bundled with Rtools.
>
> If you run `pacman -S mingw-w64-i686-gcc`, do you get a number of
> packages installed? When you retry the command, does it still fail with
> the same error message? (In that case, more adjustments will be needed
> in order to tell the linker where to find the 32-bit import libraries.)
>
> --
> Best regards,
> Ivan
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 32bit application

2023-06-28 Thread Venky Vulpine
After doing "make clean".
I entered the "make all recommended MULTI=32" and got the following error:

make all recommended MULTI=32
make[1]: 'MkRules' is up to date.
make --no-print-directory -C front-ends Rpwd
make -C ../../include -f Makefile.win version
make Rpwd.exe
gcc -std=gnu99 -m32 -I../../include -DR_ARCH='"i386"'  -O3 -Wall -pedantic
  -c rpwd.c -o rpwd.o
windres -F pe-i386   -i rcico.rc -o rcico.o
gcc -std=gnu99 -m32 -s  -o Rpwd.exe rpwd.o rcico.o
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingw32.a
when searching for -lmingw32
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../..\libmingw32.a
when searching for -lmingw32
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingw32.a
when searching for -lmingw32
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find
-lmingw32
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingw32.a
when searching for -lmingw32
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/libgcc.a
when searching for -lgcc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0\libgcc.a
when searching for -lgcc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/libgcc.a
when searching for -lgcc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lgcc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/libgcc.a
when searching for -lgcc
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmoldname.a
when searching for -lmoldname
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../..\libmoldname.a
when searching for -lmoldname
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmoldname.a
when searching for -lmoldname
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find
-lmoldname
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmoldname.a
when searching for -lmoldname
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingwex.a
when searching for -lmingwex
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../..\libmingwex.a
when searching for -lmingwex
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingwex.a
when searching for -lmingwex
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find
-lmingwex
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingwex.a
when searching for -lmingwex
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmsvcrt.a
when searching for -lmsvcrt
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../..\libmsvcrt.a
when searching for -lmsvcrt
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
incompatible
c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmsvcrt.a
when 

Re: [R] 32bit application

2023-06-28 Thread Ivan Krylov
On Wed, 28 Jun 2023 13:02:41 +0530
Venky Vulpine  wrote:

> C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: skipping
> incompatible
> c:/rtools42/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/10.4.0/../../../libmingw32.a
> when searching for -lmingw32

This is what progress looks like!

The current problem is that you have 64-bit import libraries installed
under .../x86_64-w64-mingw32.static.posix/... and there are probably no
32-bit import libraries bundled with Rtools.

If you run `pacman -S mingw-w64-i686-gcc`, do you get a number of
packages installed? When you retry the command, does it still fail with
the same error message? (In that case, more adjustments will be needed
in order to tell the linker where to find the 32-bit import libraries.)

-- 
Best regards,
Ivan

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 32bit application

2023-06-28 Thread Ivan Krylov
On Wed, 28 Jun 2023 08:54:14 +0530
Venky Vulpine  wrote:

> [image: image.png]

Please copy and paste the error text from the command line window. For
historical reasons, you need to use Ctrl+Insert in order to copy text
from it and Shift+Insert in order to paste text into it.

It seems that the assembler is being invoked in 64-bit mode for 32-bit
assembly. I think I gave you the wrong parameter to set in order to
switch into 32-bit mode. Run `make clean` in order to remove the already
existing object files (I think they ended up being 64-bit) and then run:

  make all recommended MULTI=32

-- 
Best regards,
Ivan

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 32bit application

2023-06-27 Thread Ivan Krylov
В Tue, 27 Jun 2023 11:03:23 +0530
Venky Vulpine  пишет:

> Is there a way to build a 32bit R setup or is there any solution for
> the people who definitely need 32bit R on windows.

While 32-bit builds of R are not supported on Windows, they might still
work (and they do work on other platforms).

Try following the guide at
 to
compile R. (I think you'll need a 64-bit Windows installation in order
to follow the guide. If you don't have one, setting up
cross-compilation from a 32-bit computer for 64-bit Windows ought to be
possible but may be tricky.)

When you run `make all recommended`, add WIN=32 to the command line:

  make all recommended WIN=32

Does it give you a 32-bit R.exe?

-- 
Best regards,
Ivan

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] 32bit application

2023-06-27 Thread Venky Vulpine
Hi Team,

It seems from 4.2.3, R setup is not having a 32bit package as like the
previous version.
Is there a way to build a 32bit R setup or is there any solution for the
people who definitely need 32bit R on windows.
Please let me know.

Thanks,
Venkatesh U

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.