We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › build & run on linux x86_64
Page Index Toggle Pages: 1
build & run on linux x86_64 (Read 2732 times)
build & run on linux x86_64
Sep 23rd, 2008, 12:07pm
 
this patch is obsolete now.  please ignore it.

---
Hi,

The following patch makes processing build & run on linux x86_64 platform.  The idea is to use native java runtime and executable.  IMHO shipping and using platform specific binaries isn't really necessary here.

From: John Lee <john_lee@openmoko.com>
Date: Tue, 23 Sep 2008 16:42:53 +0800
Subject: [PATCH] use local rt libs and java executable to build and run.  this enables
processing on platforms other then i686.


Signed-off-by: John Lee <john_lee@openmoko.com>
---
processing/build/linux/dist/processing |    3 ---
processing/build/linux/make.sh         |   32 ++++++++------------------------
2 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/processing/build/linux/dist/processing b/processing/build/linux/dist/processing
index e02e551..5ae29ff 100755
--- a/processing/build/linux/dist/processing
+++ b/processing/build/linux/dist/processing
@@ -3,7 +3,6 @@
APPDIR="$(dirname -- "${0}")"
 
for LIB in \
-    java/lib/rt.jar \
    java/lib/tools.jar \
    lib/*.jar \
    ;
@@ -12,6 +11,4 @@ do
done
export CLASSPATH

-export PATH="${APPDIR}/java/bin:${PATH}"
-
java processing.app.Base
diff --git a/processing/build/linux/make.sh b/processing/build/linux/make.sh
index 8d2455a..4fadb71 100755
--- a/processing/build/linux/make.sh
+++ b/processing/build/linux/make.sh
@@ -1,5 +1,6 @@
#!/bin/sh

+JAVA=java

### -- SETUP WORK DIR -------------------------------------------

@@ -36,25 +37,8 @@ else

  install -m 755 dist/processing work/processing

-  ARCH=`uname -m`
-  if [ $ARCH = "i686" ]
-  then
-    echo Extracting JRE...
-    tar --extract --file=jre.tgz --ungzip --directory=work
-  else
-#    echo This is not my beautiful house.
-#    if [ $ARCH = "x86_64" ]
-#    then
-#      echo You gots the 64.
-#    fi
-    echo "
-The Java bundle that is included with Processing supports only i686 by default.
-To build the code, you will need to install the Java 1.5.0_15 JDK (not a JRE,
-and not any other version), and create a symlink to the directory where it is
-installed. Create the symlink in the \"work\" directory, and named it \"java\":
-ln -s /path/to/jdk1.5.0_15 `pwd`/work/java"
-    exit
-  fi
+  echo Extracting JRE...
+  tar --extract --file=jre.tgz --ungzip --directory=work
fi

cd ../..
@@ -72,7 +56,7 @@ cd core

perl preproc.pl
mkdir -p bin
-../build/linux/work/java/bin/java \
+${JAVA} \
    -cp ../build/linux/work/java/lib/tools.jar \
    com.sun.tools.javac.Main \
    -d bin -source 1.5 -target 1.5 src/processing/core/*.java
@@ -94,7 +78,7 @@ cd app
  echo Building antlr grammar code...

  # first build the default java goop
-../build/linux/work/java/bin/java \
+${JAVA} \
  -cp ../build/linux/work/lib/antlr.jar antlr.Tool \
  -o src/antlr/java \
  src/antlr/java/java.g
@@ -108,7 +92,7 @@ cd app
# so it's necessary to cd into the antlr/java folder, otherwise
# the JavaTokenTypes.txt file won't be found
cd src/antlr/java
-../../../../build/linux/work/java/bin/java \
+${JAVA} \
  -cp ../../../../build/linux/work/lib/antlr.jar antlr.Tool \
  -o ../../processing/app/preproc \
  -glib java.g \
@@ -126,7 +110,7 @@ cd app
rm -rf ../build/linux/work/classes
mkdir ../build/linux/work/classes

-../build/linux/work/java/bin/java \
+${JAVA} \
    -cp ../build/linux/work/java/lib/tools.jar \
    com.sun.tools.javac.Main \
    -source 1.5 -target 1.5 \
@@ -153,7 +137,7 @@ cd build/linux

PLATFORM=linux

-JAVAC="../build/linux/work/java/bin/java -cp ../build/linux/work/java/lib/tools.jar com.sun.tools.javac.Main -source 1.5 -target 1.5"
+JAVAC="${JAVA} -cp ../build/linux/work/java/lib/tools.jar com.sun.tools.javac.Main -source 1.5 -target 1.5"
CORE=../build/$PLATFORM/work/lib/core.jar
LIBRARIES=../build/$PLATFORM/work/libraries

--
1.5.6.5
Re: build & run on linux x86_64
Reply #1 - Dec 2nd, 2008, 2:24pm
 
Hi,

I am trying to run processing on a x86_64 ubuntu system and the solution you provide is unclear to me.

Should I get the source and recompile using your instructions? if yes where does the patch apply? I have never compiled processing from source so I am a bit new to the thing.

thanks for the help.
lluj.
Re: build & run on linux x86_64
Reply #2 - Dec 2nd, 2008, 2:39pm
 
just to add, I tried replacing the jogl and gluegen native libraries, since it was where I was having problems. and it did not seem to make any good.

Re: build & run on linux x86_64
Reply #3 - Jan 8th, 2009, 5:16pm
 
Hi again,

I may be wrong, but after trying to apply the above patch I got the impression that it doesnt fit the current version of the script make.sh.

So after quite a few recompiling, I managed to make processing 1.0 work under my ubuntu intrepid 64bit machine. so here is a shell script for anyone interested. Indeed recompiling and replacing jogl native libraries was the answer. And of course disabling (at least in my case) any visual effects for the desktop.

Code:

#!/bin/sh

# first of all you should check out processing from the svn server
svn co svn://processing.org/trunk/processing
# svn co -r XXX svn://processing.org/trunk/processing
# if this doesn't work install svn using 'sudo apt-get install subversion'

#make sure you have the right java sdk
sudo aptitude install sun-java6-jdk

sudo update-alternatives --config java
# and choose Sun Java 6

#make sure you have the jogl x64 amd native libraries in the /opengl/library
wget http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.1/jogl-1.1.1-linux-amd64.zip
unzip jogl-1.1.1-linux-amd64.zip
cp jogl-1.1.1-linux-amd64/lib/* processing/opengl/library/.

#run make.sh once
#this creates the necessary work folder
cd processing/build/linux/
./make.sh

# and exits with request to link the java sdk in the work folder
#mv ./work/java ./work/java.backup
ln -s /usr/lib/jvm/java-6-sun ./work/java

# run make.sh again which should compile processing
./make.sh

# and then start processing...
./run.sh &

# here you can test the openGL examples and if you have a blinking screen
# then you should disable visual effects under system->prefs->appearance

 

There still might be a better way to do it...

lluj
Re: build & run on linux x86_64
Reply #4 - Feb 2nd, 2009, 10:24am
 
I am running Ubuntu Inpredid64 on an Intel Quad-Core. A quick fix for me was to install the 32bit java (e.g. ia32-sun-java6-bin) instead of the 64bit version.
Runs smooth without desktop effects.
Page Index Toggle Pages: 1