Skip to content
Prev 8440 / 15075 Next

Installing or Compiling EDGE

On Oct 11, 2011, at 6:49 AM, Morri Feldman wrote:

            
You, you can't store 64-bit pointer into a 32-bit integer so that code won't work in 64-bit mode.
The package is a bit of a mess - for several reasons. In has no global CC definition (and always overrides the system one), so you'll need to edit src/Makevars as well as all other Makefiles and add -arch i386 to the compiler lines. Also you'll need to edit src/Makevars and replace the RCMD=R line for Darwin with RCMD=R --arch i386

Once you have done that, you're almost there - you can compile it, but you'll also need to edit edge.r and fix the version check (it is so old that it considers only one digit of the minor number so 2.14 < 2.4 in that logic).

That's it. Below is the diff of all needed changes.

Cheers,
Simon


diff -ru edge_1.1.290/edge.r edge_1.1.290-i386/edge.r
--- edge_1.1.290/edge.r	2007-07-06 15:12:38.000000000 -0400
+++ edge_1.1.290-i386/edge.r	2011-10-11 10:43:40.000000000 -0400
@@ -8,7 +8,7 @@
 ## this or any files in this software package.
 #########################################################
 Rversion <- R.Version()
-if(Rversion$major < "2" || as.numeric(substring(Rversion$minor, 0, 1)) < 4)
+if(Rversion$major < "2" || as.numeric(gsub("\\..*","",Rversion$minor)) < 4)
 {
   stop("R version greater than or equal to 2.4.0 required")
 }
diff -ru edge_1.1.290/src/Makevars edge_1.1.290-i386/src/Makevars
--- edge_1.1.290/src/Makevars	2006-03-07 12:50:29.000000000 -0500
+++ edge_1.1.290-i386/src/Makevars	2011-10-11 10:24:48.000000000 -0400
@@ -28,7 +28,7 @@
 OS_FLAGS=-DMAC_OS_X -Dassert\(expr\)= -fPIC
 PKG_KNNLIBS=-L/sw/lib
 SOEXT=.so
-RCMD=R
+RCMD=R --arch i386
 RCMD_CMD=CMD
 endif

@@ -58,8 +58,8 @@
 PKG_CXXFLAGS=$(OS_FLAGS) $(INCLUDEDIRS) $(EDGELIBVERSION) $(DEBUG) -D__STDC_LIMIT_MACROS -Wall
 PKG_CFLAGS=$(OS_FLAGS) $(INCLUDEDIRS) $(EDGELIBVERSION) $(DEBUG) -D__STDC_LIMIT_MACROS -Wall

-CC=gcc 
+CC=gcc -arch i386
 CCOPTS=-c -g 
-CXX=g++ 
+CXX=g++ -arch i386
 CXXOPTS=-c -g 

diff -ru edge_1.1.290/src/cluster/TestFramework/Makefile edge_1.1.290-i386/src/cluster/TestFramework/Makefile
--- edge_1.1.290/src/cluster/TestFramework/Makefile	2005-09-23 18:22:56.000000000 -0400
+++ edge_1.1.290-i386/src/cluster/TestFramework/Makefile	2011-10-11 10:27:13.000000000 -0400
@@ -1,5 +1,5 @@
 SRCBASE=../..
-CC=g++
+CC=g++ -arch i386
 CCOPTS=-c -g

 LIBOBJECTS=UnitTestRunner.o UnitTestClass.o
diff -ru edge_1.1.290/src/cluster/Tests/Makefile edge_1.1.290-i386/src/cluster/Tests/Makefile
--- edge_1.1.290/src/cluster/Tests/Makefile	2006-03-02 14:50:12.000000000 -0500
+++ edge_1.1.290-i386/src/cluster/Tests/Makefile	2011-10-11 10:26:12.000000000 -0400
@@ -1,7 +1,7 @@
 SRCBASE=../..
 include ../../Makevars

-CC=g++
+CC=g++ -arch i386
 CCOPTS=-I.. -I../TestFramework -I../../threads -D__STDC_LIMIT_MACROS -ftrapv
 LINKOPTS=-L../TestFramework -L.. -L../../threads

diff -ru edge_1.1.290/src/threads/Tests/Makefile edge_1.1.290-i386/src/threads/Tests/Makefile
--- edge_1.1.290/src/threads/Tests/Makefile	2005-09-23 18:22:56.000000000 -0400
+++ edge_1.1.290-i386/src/threads/Tests/Makefile	2011-10-11 10:27:38.000000000 -0400
@@ -1,7 +1,7 @@
 SRCBASE=../..
 include ../../Makevars

-CC=g++
+CC=g++ -arch i386
 CCOPTS=-c -g

 OBJECTS=main.o