Giter Site home page Giter Site logo

patch about windows build about pqr HOT 5 CLOSED

radfordneal avatar radfordneal commented on July 23, 2024
patch about windows build

from pqr.

Comments (5)

radfordneal avatar radfordneal commented on July 23, 2024

Thanks for finding these problems. I'll put fixes for them similar to yours above in the new release (which should be out in a day or so), except that I think I won't change the default for R_MAT_MULT_WITH_BLAS_BY_DEFAULT.

Here's a diff of my current version:

diff --git a/src/gnuwin32/Makefile b/src/gnuwin32/Makefile
index d7563fa..86a13c7 100644
--- a/src/gnuwin32/Makefile
+++ b/src/gnuwin32/Makefile
@@ -147,15 +147,20 @@ dllversion.o: ../include/Rversion.h
 R.dll: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
        @$(ECHO) EXPORTS > R.def
        @$(NM) $^ | $(SED) -n  $(SYMPAT)  | $(SORT) | uniq > R0.def
-       @comm -23 R0.def Rdll.hide >> R.def
+ifeq "$(WIN)" "64"
+       @$(SED) -e's/@.*//' Rdll.hide | $(SORT) > R1.def
+else
+       @$(SORT) <Rdll.hide >R1.def
+endif
+       @$(COMM) -23 R0.def R1.def >> R.def
        $(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ R.def $^ $($*-DLLLIBS) $(DLLLIBS)
-       @$(RM) R.def R0.def
+       @$(RM) R.def R0.def R1.def

 R.exp: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
        @$(ECHO) LIBRARY R.dll > R.exp
        @$(ECHO) EXPORTS >> R.exp
        @$(NM) $^ | $(SED) -n $(SYMPAT) | $(SORT) | uniq > R0.def
-       @comm -23 R0.def Rdll.hide >> R.exp
+       @$(COMM) -23 R0.def Rdll.hide >> R.exp
        @$(RM) R0.def


@@ -207,10 +212,10 @@ front-ends:
        $(MK) -C ../extra/xz -f Makefile.win

 ../extra/helpers/libhelpers.a:
-  $(MK) -C ../extra/helpers -f Makefile.win
+       $(MK) -C ../extra/helpers -f Makefile.win

 ../extra/matprod/libmatprod.a:
-  $(MK) -C ../extra/matprod -f Makefile.win
+       $(MK) -C ../extra/matprod -f Makefile.win

 NEWSdocs:
        @$(MK) -C ../../doc -f Makefile.win
diff --git a/src/gnuwin32/MkRules.rules b/src/gnuwin32/MkRules.rules
index 2dfb033..0b94546 100644
--- a/src/gnuwin32/MkRules.rules
+++ b/src/gnuwin32/MkRules.rules
@@ -69,7 +69,8 @@ RESCOMP=$(BINPREF)windres $(RC_ARCH)
 # as set by make
 RM=rm -f
 SED=sed
-SORT=sort
+SORT=LC_COLLATE=C sort
+COMM=LC_COLLATE=C comm

 .SUFFIXES:
 .SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d .f90 .f95 .m .S
diff --git a/src/gnuwin32/fixed/h/config.h b/src/gnuwin32/fixed/h/config.h
index 16aa745..f140b3e 100644
--- a/src/gnuwin32/fixed/h/config.h
+++ b/src/gnuwin32/fixed/h/config.h
@@ -529,6 +529,9 @@
 /* Define this to enable helper threads. */
 #define R_HELPER_THREADS 1

+/* Define this to enable task merging. */
+#define R_TASK_MERGING 1
+
 /* Define to 1 if you have pangocairo. */
 /* #undef HAVE_PANGOCAIRO */

diff --git a/src/main/platform.c b/src/main/platform.c
index b425c45..f47ab0b 100644
--- a/src/main/platform.c
+++ b/src/main/platform.c
@@ -1323,7 +1323,9 @@ static SEXP do_fileexists(SEXP call, SEXP op, SEXP args, SEXP rho)

 #define CHOOSEBUFSIZE 1024

-#ifndef Win32
+#ifdef Win32 /* Windows version is in src/gnuwin32/extra.c */
+extern SEXP do_filechoose(SEXP call, SEXP op, SEXP args, SEXP rho);
+#else
 static SEXP do_filechoose(SEXP call, SEXP op, SEXP args, SEXP rho)
 {
     int _new, len;
diff --git a/src/main/util.c b/src/main/util.c
index cfba02c..72759d3 100644
--- a/src/main/util.c
+++ b/src/main/util.c
@@ -1144,7 +1144,9 @@ static SEXP do_dirname(SEXP call, SEXP op, SEXP args, SEXP rho)
 #endif


-#ifndef Win32 /* Windows version is in src/gnuwin32/extra.c */
+#ifdef Win32 /* Windows version is in src/gnuwin32/extra.c */
+extern SEXP do_normalizepath(SEXP call, SEXP op, SEXP args, SEXP rho);
+#else
 #ifndef HAVE_DECL_REALPATH
 extern char *realpath(const char *path, char *resolved_path);
 #endif

from pqr.

radfordneal avatar radfordneal commented on July 23, 2024

Above patch is now in the new release of 2014-02-23.

from pqr.

armgong avatar armgong commented on July 23, 2024

on windows makefile still need modify ,you patch have problem,define sort and comm add LC_COLLATE=C behind them not slove it,must like following

--- a/src/gnuwin32/Makefile
+++ b/src/gnuwin32/Makefile
@@ -144,26 +144,33 @@ fixed/fixdesc:

 dllversion.o: ../include/Rversion.h

+ifeq "$(WIN)" "64"
 R.dll: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
    @$(ECHO) EXPORTS > R.def
-   @$(NM) $^ | $(SED) -n  $(SYMPAT)  | $(SORT) | uniq > R0.def
-ifeq "$(WIN)" "64"
-   @$(SED) -e's/@.*//' Rdll.hide | $(SORT) > R1.def    
+   @$(NM) $^ | $(SED) -n  $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq > R0.def
+   @$(SED) -e's/@.*//' Rdll.hide | LC_COLLATE=C $(SORT) > R1.def
+   @LC_COLLATE=C comm -23 R0.def R1.def >> R.def
+   $(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ R.def $^ $($*-DLLLIBS) $(DLLLIBS)
+   @$(RM) R.def R0.def R1.def
 else
-   @$(SORT) <Rdll.hide >R1.def
-endif
-   @$(COMM) -23 R0.def R1.def >> R.def
+R.dll: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
+   @$(ECHO) EXPORTS > R.def
+   @$(NM) $^ | $(SED) -n  $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq > R0.def
+   @LC_COLLATE=C $(SORT) Rdll.hide > R1.def
+   @LC_COLLATE=C comm -23 R0.def R1.def >> R.def
    $(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ R.def $^ $($*-DLLLIBS) $(DLLLIBS)
    @$(RM) R.def R0.def R1.def
+endif

 R.exp: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
    @$(ECHO) LIBRARY R.dll > R.exp
    @$(ECHO) EXPORTS >> R.exp
-   @$(NM) $^ | $(SED) -n $(SYMPAT) | $(SORT) | uniq > R0.def
-   @$(COMM) -23 R0.def Rdll.hide >> R.exp
+   @$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq > R0.def
+   @LC_COLLATE=C comm -23 R0.def Rdll.hide >> R.exp
    @$(RM) R0.def


+
 Rdll: makeMakedeps libRblas.dll.a ../../$(BINDIR)/R.dll

 ../../$(BINDIR)/R.dll: FORCE

diff --git a/src/gnuwin32/MkRules.rules b/src/gnuwin32/MkRules.rules
index 0b94546..989975b 100644
--- a/src/gnuwin32/MkRules.rules
+++ b/src/gnuwin32/MkRules.rules
@@ -69,8 +69,8 @@ RESCOMP=$(BINPREF)windres $(RC_ARCH)
 # as set by make
 RM=rm -f
 SED=sed
-SORT=LC_COLLATE=C sort
-COMM=LC_COLLATE=C comm
+SORT=sort
+COMM=comm

from pqr.

radfordneal avatar radfordneal commented on July 23, 2024

Thanks. I think I tried to be too clever in setting the COLLATE stuff.

I plan to try Windows building myself soon, so I can catch these things.

Radford

On 9 July 2014 06:37, Yu Gong [email protected] wrote:

on windows makefile still need modify ,you patch have problem
--- a/src/gnuwin32/Makefile
+++ b/src/gnuwin32/Makefile
@@ -144,26 +144,33 @@ fixed/fixdesc:

dllversion.o: ../include/Rversion.h

+ifeq "$(WIN)" "64"
R.dll: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
@$(ECHO) EXPORTS > R.def

  • @$(NM) $^ | $(SED) -n $(SYMPAT) | $(SORT) | uniq > R0.def -ifeq
    "$(WIN)" "64"

  • @$(SED) -e's/@.*//' Rdll.hide | $(SORT) > R1.def

    • @$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq >
      R0.def
  • @$(SED) -e's/@.*//' Rdll.hide | LC_COLLATE=C $(SORT) > R1.def

  • @LC_COLLATE=C comm -23 R0.def R1.def >> R.def

  • $(DLL) -shared $(DLLFLAGS) $($-DLLFLAGS) -o $@ R.def $^ $($-DLLLIBS)
    $(DLLLIBS)

  • @$(RM) R.def R0.def R1.def else

  • @$(SORT) R1.def -endif

  • @$(COMM) -23 R0.def R1.def >> R.def +R.dll: $(OBJS) $(OBJS-EXTRA)
    $(MAINLIBS) $(EXTRALIBS) dllversion.o

  • @$(ECHO) EXPORTS > R.def

  • @$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq >
    R0.def

  • @LC_COLLATE=C $(SORT) Rdll.hide > R1.def

    @LC_COLLATE=C comm -23 R0.def R1.def >> R.def
    $(DLL) -shared $(DLLFLAGS) $($-DLLFLAGS) -o $@ R.def $^ $($-DLLLIBS)
    $(DLLLIBS)
    @$(RM) R.def R0.def R1.def
    +endif

    R.exp: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
    @$(ECHO) LIBRARY R.dll > R.exp
    @$(ECHO) EXPORTS >> R.exp

    • @$(NM) $^ | $(SED) -n $(SYMPAT) | $(SORT) | uniq > R0.def
  • @$(COMM) -23 R0.def Rdll.hide >> R.exp

  • @$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq >
    R0.def

  • @LC_COLLATE=C comm -23 R0.def Rdll.hide >> R.exp @$(RM) R0.def

Rdll: makeMakedeps libRblas.dll.a ../../$(BINDIR)/R.dll

../../$(BINDIR)/R.dll: FORCE

diff --git a/src/gnuwin32/MkRules.rules b/src/gnuwin32/MkRules.rules
index 0b94546..989975b 100644
--- a/src/gnuwin32/MkRules.rules
+++ b/src/gnuwin32/MkRules.rules
@@ -69,8 +69,8 @@ RESCOMP=$(BINPREF)windres $(RC_ARCH)

as set by make

RM=rm -f
SED=sed
-SORT=LC_COLLATE=C sort
-COMM=LC_COLLATE=C comm
+SORT=sort
+COMM=comm

Reply to this email directly or view it on GitHub
#23 (comment).

from pqr.

armgong avatar armgong commented on July 23, 2024

great,on windows i recommened Msys2 and mingw-build, better than rtools

from pqr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.