From 7198641e0f9ac1f630c9541774eff421bdad026e Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Wed, 14 Dec 2011 15:44:35 +0530 Subject: [PATCH 01/49] Remesh refresh --- .../netbeans/mesh/AbstractGroupAction.java | 72 ++++++++++++++++++- .../jcae/netbeans/mesh/ViewGroupAction.java | 38 +++++++++- 2 files changed, 106 insertions(+), 4 deletions(-) diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AbstractGroupAction.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AbstractGroupAction.java index 0ce0c423f..1218c7a9d 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AbstractGroupAction.java +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AbstractGroupAction.java @@ -30,6 +30,7 @@ import javax.xml.parsers.ParserConfigurationException; import org.jcae.mesh.xmldata.Group; import org.jcae.netbeans.viewer3d.ViewManager; +import org.jcae.vtk.AmibeToMesh; import org.jcae.vtk.View; import org.openide.explorer.ExplorerManager; import org.openide.nodes.Node; @@ -42,6 +43,8 @@ public abstract class AbstractGroupAction extends CookieAction { + Node[] temp; + protected int mode() { return CookieAction.MODE_ALL; @@ -65,6 +68,8 @@ public int compare(Group t, Group t1) { protected void performAction(Node[] arg0) { + + temp = arg0; ExplorerManager em = ((ExplorerManager.Provider) TopComponent.getRegistry().getActivated()).getExplorerManager(); try @@ -77,7 +82,9 @@ protected void performAction(Node[] arg0) { AmibeDataObject ado = n.getLookup().lookup(AmibeDataObject.class); if(ado != null && ado.getGroups() != null) - groups2Group.put(n, createTreeSet(ado.getGroups().getGroups())); + { + groups2Group.put(n, createTreeSet(ado.getGroups().getGroups())); + } } //GroupNode @@ -116,7 +123,68 @@ protected void performAction(Node[] arg0) } } - private String[] groupsToID(Collection groupsToDisplay) + protected void refreshView(Node[] arg0) + { + //ExplorerManager em = ((ExplorerManager.Provider) TopComponent.getRegistry().getActivated()).getExplorerManager(); + try + { + HashMap> groups2Group = new HashMap>(); + + for(Node n:arg0) + { + AmibeDataObject ado = n.getLookup().lookup(AmibeDataObject.class); + if(ado != null && ado.getGroups() != null) + { + //ado.addListenerFileChange(); + groups2Group.put(n, createTreeSet(ado.getGroups().getGroups())); + } + } + + //GroupNode + for(Node n:arg0) + { + GroupNode gn = n.getLookup().lookup(GroupNode.class); + if(gn != null) + { + Node amibeNode=n.getParentNode().getParentNode(); + Collection c=groups2Group.get(amibeNode); + if(c==null) + { + c=createTreeSet(gn.getGroup()); + groups2Group.put(amibeNode, c); + } + else + c.add(gn.getGroup()); + } + } + + + View v = ViewManager.getDefault().getCurrentView(); + for(Entry> e:groups2Group.entrySet()) + { + String[] groupsToDisplay = groupsToID(e.getValue()); + AmibeNViewable interactor = AmibeNViewable.get(e.getKey(), v); + AmibeDataObject ado = e.getKey().getLookup().lookup(AmibeDataObject.class); + if(interactor != null) + { + AmibeToMesh reader = new AmibeToMesh(ado.getGroups().getMeshFile(), groupsToDisplay); + interactor.addTriangles(reader.getTriangles()); + interactor.addBeams(reader.getBeams()); + v.Render(); + } + } + } + catch(IOException ex) + { + Exceptions.printStackTrace(ex); + } + catch(SAXException ex) + { + Exceptions.printStackTrace(ex); + } + } + + private String[] groupsToID(Collection groupsToDisplay) { String[] idGroupsDisplayed = new String[groupsToDisplay.size()]; int i = 0; diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java index b8c6a4e11..cda25f79f 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java @@ -28,18 +28,47 @@ import org.jcae.vtk.AmibeToMesh; import org.jcae.vtk.View; import org.openide.explorer.ExplorerManager; +import org.openide.filesystems.FileAttributeEvent; +import org.openide.filesystems.FileChangeListener; +import org.openide.filesystems.FileEvent; +import org.openide.filesystems.FileRenameEvent; import org.openide.loaders.DataObject; import org.openide.nodes.Node; import org.openide.util.WeakListeners; import org.xml.sax.SAXException; -public class ViewGroupAction extends AbstractGroupAction -{ +public class ViewGroupAction extends AbstractGroupAction implements FileChangeListener +{ public String getName() { return "View"; } + public void fileFolderCreated(FileEvent fe) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void fileDataCreated(FileEvent fe) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void fileChanged(FileEvent fe) { + if(fe.getFile().getName().equalsIgnoreCase("jcae3d")) + refreshView(temp); + } + + public void fileDeleted(FileEvent fe) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void fileRenamed(FileRenameEvent fre) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void fileAttributeChanged(FileAttributeEvent fae) { + //throw new UnsupportedOperationException("Not supported yet."); + } + /** * A viewable which remove it self from the view if the underlying * DataObject is removed @@ -73,8 +102,12 @@ protected void processGroups(String[] idGroupsDisplayed, final View view, Node n ExplorerManager em) throws ParserConfigurationException, SAXException, IOException { + AmibeNViewable interactor = AmibeNViewable.get(node, view); AmibeDataObject ado = node.getLookup().lookup(AmibeDataObject.class); + + ado.getPrimaryFile().addRecursiveListener(this); + if(interactor == null) { AViewable v = new AViewable(node, em, view); @@ -91,4 +124,5 @@ protected void processGroups(String[] idGroupsDisplayed, final View view, Node n interactor.addBeams(reader.getBeams()); view.Render(); } + } From 4ccd27aacfc2339f91ccb6e97ac28836e2267c53 Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Wed, 14 Dec 2011 18:21:17 +0530 Subject: [PATCH 02/49] ViewGroupAction fixed --- .../jcae/netbeans/mesh/ViewGroupAction.java | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java index cda25f79f..50ccca69f 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java @@ -31,44 +31,20 @@ import org.openide.filesystems.FileAttributeEvent; import org.openide.filesystems.FileChangeListener; import org.openide.filesystems.FileEvent; +import org.openide.filesystems.FileObject; import org.openide.filesystems.FileRenameEvent; import org.openide.loaders.DataObject; import org.openide.nodes.Node; import org.openide.util.WeakListeners; import org.xml.sax.SAXException; -public class ViewGroupAction extends AbstractGroupAction implements FileChangeListener +public class ViewGroupAction extends AbstractGroupAction { public String getName() { return "View"; } - public void fileFolderCreated(FileEvent fe) { - throw new UnsupportedOperationException("Not supported yet."); - } - - public void fileDataCreated(FileEvent fe) { - throw new UnsupportedOperationException("Not supported yet."); - } - - public void fileChanged(FileEvent fe) { - if(fe.getFile().getName().equalsIgnoreCase("jcae3d")) - refreshView(temp); - } - - public void fileDeleted(FileEvent fe) { - throw new UnsupportedOperationException("Not supported yet."); - } - - public void fileRenamed(FileRenameEvent fre) { - throw new UnsupportedOperationException("Not supported yet."); - } - - public void fileAttributeChanged(FileAttributeEvent fae) { - //throw new UnsupportedOperationException("Not supported yet."); - } - /** * A viewable which remove it self from the view if the underlying * DataObject is removed @@ -106,8 +82,24 @@ protected void processGroups(String[] idGroupsDisplayed, final View view, Node n AmibeNViewable interactor = AmibeNViewable.get(node, view); AmibeDataObject ado = node.getLookup().lookup(AmibeDataObject.class); - ado.getPrimaryFile().addRecursiveListener(this); + //ado.getPrimaryFile().addRecursiveListener(this); + FileObject[] amibeChildren = ado.getPrimaryFile().getChildren(); + for(int i=0; i< amibeChildren.length; i++) + if(amibeChildren[i].getName().equalsIgnoreCase("jcae3d")) + { + amibeChildren[i].addFileChangeListener(new FileChangeListener() { + public void fileFolderCreated(FileEvent fe) {} + public void fileDataCreated(FileEvent fe) {} + public void fileChanged(FileEvent fe) { + if(fe.getFile().getName().equalsIgnoreCase("jcae3d")) + refreshView(temp); + } + public void fileDeleted(FileEvent fe) {} + public void fileRenamed(FileRenameEvent fre) {} + public void fileAttributeChanged(FileAttributeEvent fae) {} + }); + } if(interactor == null) { AViewable v = new AViewable(node, em, view); From 2c56ab1776aab983bc0c712a7865ba7277ead13b Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Wed, 14 Dec 2011 18:23:24 +0530 Subject: [PATCH 03/49] ViewGroupAction - Minor change --- jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java index 50ccca69f..77f8da11b 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/ViewGroupAction.java @@ -92,7 +92,6 @@ protected void processGroups(String[] idGroupsDisplayed, final View view, Node n public void fileFolderCreated(FileEvent fe) {} public void fileDataCreated(FileEvent fe) {} public void fileChanged(FileEvent fe) { - if(fe.getFile().getName().equalsIgnoreCase("jcae3d")) refreshView(temp); } public void fileDeleted(FileEvent fe) {} From e93d51b3c5613e87fb3b90b6701af63c627d9d48 Mon Sep 17 00:00:00 2001 From: mohit Date: Fri, 16 Mar 2012 14:23:57 +0530 Subject: [PATCH 04/49] jCAE linux installer added --- jCAE-auto-installer.sh | 508 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 508 insertions(+) create mode 100755 jCAE-auto-installer.sh diff --git a/jCAE-auto-installer.sh b/jCAE-auto-installer.sh new file mode 100755 index 000000000..85e6e7a84 --- /dev/null +++ b/jCAE-auto-installer.sh @@ -0,0 +1,508 @@ +#!/bin/sh + +################################################## +## Important Instruction +################################################## +# +# Environment variable $JAVA_HOME must be set before +# running this script, like +# export $JAVA_HOME=/usr/lib/jvm/java-6-openjdk/ + + + +################################################## +## Detect dependencies +################################################## +# This does not take care of version numbers. + +# Step 1: Check for gcc +echo "Looking for GCC" +GCC_V=$(gcc --version | grep gcc) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "gcc Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $GCC_V "\033[0m" +fi + +# Step 2: Check for git +echo "Looking for GIT" +GIT_V=$(git --version | grep git) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "git Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $GIT_V "\033[0m" +fi + +# Step 3: Check for cmake +echo "Looking for CMAKE" +CMAKE_V=$(cmake --version | grep cmake) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "cmake Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $CMAKE_V "\033[0m" +fi + +# Step 4: Check for swig +echo "Looking for SWIG" +SWIG_V=$(swig -version | grep SWIG) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "swig Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $SWIG_V "\033[0m" +fi + +# Step 5: Check for mesa-common-dev +echo "Looking for mesa-common-dev" +MCD_V=$(dpkg -l | grep mesa-common-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $MCD_V "\033[0m" +fi + +# Step 6: Check for libxt-dev +echo "Looking for libxt-dev" +LIBXT_V=$(dpkg -l | grep libxt-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "libxt-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBXT_V "\033[0m" +fi + +# Step 7: Check for freeglut3-dev +echo "Looking for freeglut3-dev" +LIBFG3_V=$(dpkg -l | grep freeglut3-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBFG3_V "\033[0m" +fi + +# Step 8: Check for openjdk-6-jdk +echo "Looking for openjdk-6-jdk" +LIBJDK_V=$(dpkg -l | grep openjdk-6-jdk) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "openjdk-6-jdk Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBJDK_V "\033[0m" +fi + +# Step 9: Check for quilt +echo "Looking for quilt" +LIBQLT_V=$(quilt --version) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "quilt Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBQLT_V "\033[0m" +fi + +# Step 10: Check for ant +echo "Looking for ant" +LIBANT_V=$(ant -version) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "ant Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBANT_V "\033[0m" +fi + + +################################################## +## Get and Install OCE 0.9.0 +################################################## + +rootDir=$PWD + +echo -e "\033[32m Fetching oce from Github \033[0m" +git clone https://github.com/tpaviot/oce.git + +if [ $? -eq 0 ] +then + mkdir oceBuild + cd oce + git checkout OCE-0.9.0 + mkdir build + cd build + flags="-DOCE_INSTALL_PREFIX:PATH=../../oceBuild" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + cmake $flags .. +else + echo -e "\033[31m" "Unable to fetch oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce cmake successful \033[0m" + make -j2 +else + echo -e "\033[31m" "Unable to cmake oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce make successful \033[0m" + make install +else + echo -e "\033[31m" "Unable to make oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce install successful \033[0m" + make install +else + echo -e "\033[31m" "Unable to install oce" "\033[0m" + exit 1 +fi + + +################################################## +## Get, Patch (from jCAE) and Install VTK +## Get jCAE (installation later) +################################################## + +cd $rootDir + +# Get vtk-5.6.1, unzip +wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz +tar -xf vtk-5.6.1.tar.gz + +# Get jCAE source (so early to get vtk patch) +git clone -b refresh https://github.com/mohitgargk/jCAE.git + +# Apply patch +cd VTK +./../jCAE/vtk-util/patch/5.6/apply.sh +mkdir vtkBuild + +# Build vtk +mkdir build +cd build + +flags="-DCMAKE_INSTALL_PREFIX:PATH=../../vtkBuild" +flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" +flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" +cmake $flags .. + +make -j2 +make install + + +################################################## +## Get and Install JYTHON +################################################## + +cd $rootDir + +echo -e "\033[32m" "Fetching Jython" "\033[0m" +wget http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Jython server Not found" "\033[0m" + exit 1 +else + java -jar jython_installer-2.5.2.jar -s -d jython +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Jython could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Jython Installed successfully" "\033[0m" +fi + +################################################## +## Get and Install VECMATH +################################################## + +cd $rootDir + +echo -e "\033[32m" "Fetching vecmath" "\033[0m" +wget http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Vecmath server Not found" "\033[0m" + exit 1 +else + dpkg-deb -x libvecmath-java_1.5.2-2_all.deb vecmath +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Vecmath could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Vecmath Installed successfully" "\033[0m" +fi + + +################################################## +## Get and Install TROVE +################################################## + +cd $rootDir + +echo -e "\033[32m" "Fetching trove" "\033[0m" +wget http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "trove server Not found" "\033[0m" + exit 1 +else + dpkg-deb -x libtrove-java_2.1.0-2_all.deb trove +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "trove could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "trove Installed successfully" "\033[0m" +fi + + +################################################## +## Get and Install Netbeans 7.1 +################################################## + +cd $rootDir + +echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" +wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" + exit 1 +else + chmod a+x netbeans-7.1-ml-linux.sh + mkdir nb + ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" +fi + +################################################## +## Get and Install XALAN +## Get XSLs for build-impl.xml creation +################################################## + +cd $rootDir + +wget http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +tar xvf xalan-j_2_7_1-bin-2jars.tar.gz +rm xalan-j_2_7_1-bin-2jars.tar.gz +cd xalan-j_2_7_1 +export CLASSPATH=$CLASSPATH:$PWD/xalan.jar +export CLASSPATH=$CLASSPATH:$PWD/serializer.jar +export CLASSPATH=$CLASSPATH:$PWD/xercesImpl.jar +export CLASSPATH=$CLASSPATH:$PWD/xml-apis.jar +export CLASSPATH=$CLASSPATH:$PWD/xsltc.jar + + +cd $rootDir +mkdir xsls +cd xsls +wget http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +mv build-impl.xsl project-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl +mv build-impl.xsl suite-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl +mv build-impl.xsl module-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl + + +################################################## +## jCAE INSTALLATION +################################################## + +#------------------------------------------------- +## Set envirmonment variables +#------------------------------------------------- + +cd $rootDir + +export jythonPath=$rootDir/$(find jython/ -iname jython.jar) +export trovePath=$rootDir/$(find trove/ -iname trove.jar) +export vecmathPath=$rootDir/$(find vecmath/ -iname vecmath.jar) +export vtkPath=$rootDir/$(find vtkBuild/ -iname vtk.jar) + +touch jcae.config + +echo "libs.trove.classpath=$trovePath" >> jcae.config +echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config +echo "libs.VTK.classpath=$vtkPath" >> jcae.config + +echo "arch.linux=true" >> jcae.config +echo "path.occ.linux=$rootDir/oceBuild/" >> jcae.config +echo "path.jython.linux=$rootDir/jython/" >> jcae.config +echo "vtk.dir.linux=$rootDir/vtkBuild/" >> jcae.config +echo "path.occjava.linux=$rootDir/occjavaBuild/libOccJava.so" >> jcae.config +echo "libs.trove.classpath=$rootDir/trove/usr/share/java/trove.jar" >> jcae.config +echo "libs.VTK.classpath=$rootDir/vtkBuild/lib/vtk-5.6/java/vtk.jar" >> jcae.config +echo "libs.vecmath.classpath=$rootDir/vecmath/usr/share/java/vecmath.jar" >> jcae.config + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$rootDir/oceBuild/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$rootDir/vtkBuild/lib/vtk-5.6/ + +#------------------------------------------------- +## Build jCAE projects (vtk-util, occjava, etc) +#------------------------------------------------- + + +## build OccJava +cd $rootDir +cd jCAE/occjava/ +mkdir build +cd build +cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. +make +mkdir ../../../occjavaBuild +cp *.so* ../../../occjavaBuild/ + + +## building vtk-util +cd $rootDir +cd jCAE/vtk-util/ +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +ant config +ant clean +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" + +## building jcae/occjava +cd $rootDir +cd jCAE/jcae/occjava +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar + +## building amibe +cd $rootDir +cd jCAE/amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" -f nbbuild.xml jar + + +## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) +cd $rootDir +cd jCAE/jcae/vtk-amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar + +## building vtk-amibe-occ +cd $rootDir +cd jCAE/vtk-amibe-occ +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar + + +#------------------------------------------------- +## Build jCAE modules +#------------------------------------------------- + +cd $rootDir +cd jCAE/jcae + +modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" +for module in $modules +do + cd "$module" + java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/module-build-impl.xsl -OUT ./nbproject/build-impl.xml + cd .. +done + + +#------------------------------------------------- +## Generate platform.xml. +#------------------------------------------------- + +# This is a now an automated step. +cd $rootDir +cd jCAE/jcae +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/platform.xsl -OUT ./nbproject/platform.xml + +#------------------------------------------------- +## Build suite as Zip distribution +#------------------------------------------------- +cd $rootDir +cd jCAE/jcae/ +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config > nbproject/private/private.properties + +mkdir vtk/nbproject/private +cp nbproject/private/private.properties vtk/nbproject/private/ + +mkdir vecmath/nbproject/private +cp nbproject/private/private.properties vecmath/nbproject/private/ + +mkdir trove/nbproject/private +cp nbproject/private/private.properties trove/nbproject/private/ + +echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties + +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/suite-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" build-zip +cd $rootDir + +mv jCAE/jcae/dist jCAE-zipped + +#------------------------------------------------- +## Clean +#------------------------------------------------- + +rm jython*.jar +rm libtrove*.deb +rm libvecmath*.deb +rm vtk-5.6.1.tar.gz +rm -rf VTK +rm -rf oce +rm netbeans-7.1-ml-linux.sh + From e70adb381d1f15117a7f6c62a8d3884c2acb66d9 Mon Sep 17 00:00:00 2001 From: mohitgargk Date: Wed, 25 Apr 2012 20:34:16 +0530 Subject: [PATCH 05/49] Added installer support for mingw. libgcc_s_sjlj-1.dll and libstdc++-6.dll --- jcae/occjava-nb/build.xml | 2 ++ jcae/occjava-nb/nbproject/project.properties | 4 ++-- jcae/vtk/build.xml | 2 ++ jcae/vtk/nbproject/project.properties | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jcae/occjava-nb/build.xml b/jcae/occjava-nb/build.xml index 31c76575d..a279a9f04 100644 --- a/jcae/occjava-nb/build.xml +++ b/jcae/occjava-nb/build.xml @@ -19,6 +19,8 @@ + + diff --git a/jcae/occjava-nb/nbproject/project.properties b/jcae/occjava-nb/nbproject/project.properties index d3bd61800..4a1bf890f 100644 --- a/jcae/occjava-nb/nbproject/project.properties +++ b/jcae/occjava-nb/nbproject/project.properties @@ -2,5 +2,5 @@ is.autoload=true nbm.is.global=true extra.module.files=modules/lib/OccJava.dll,modules/lib/libOccJava.so, \ modules/ext/occjava.jar,modules/lib/TK*.dll,modules/lib/libTK*-*.so, \ - modules/lib/TK*.dll,modules/lib/libTK*.so.1 - +modules/lib/TK*.dll,modules/lib/libTK*.so.1,modules/lib/libgcc_s_sjlj-1.dll, \ +modules/lib/libstdc++-6.dll diff --git a/jcae/vtk/build.xml b/jcae/vtk/build.xml index 8fd3b2bf0..0c3a18c15 100644 --- a/jcae/vtk/build.xml +++ b/jcae/vtk/build.xml @@ -18,6 +18,8 @@ + + diff --git a/jcae/vtk/nbproject/project.properties b/jcae/vtk/nbproject/project.properties index e9ab4ae7a..6a81dddda 100644 --- a/jcae/vtk/nbproject/project.properties +++ b/jcae/vtk/nbproject/project.properties @@ -3,7 +3,9 @@ extra.module.files=modules/ext/vtk.jar \ modules/lib/libvtk*.so \ modules/lib/vtk*.dll \ modules/lib/mingwm*.dll \ - modules/lib/Microsoft.VC*.CRT/* + modules/lib/Microsoft.VC*.CRT/* \ + modules/lib/libgcc_s_sjlj-1.dll \ + modules/lib/libstdc++-6.dll is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 From 9b1ba888d5cd5ded9143e779e4ef585fd1a620a5 Mon Sep 17 00:00:00 2001 From: mohitgargk Date: Wed, 25 Apr 2012 21:03:26 +0530 Subject: [PATCH 06/49] Installer scripts added --- jCAE-auto-installer-linux.sh | 478 +++++++++++++++++++++++++++++++++++ jCAE-auto-installer.sh | 317 ++++++++++++++--------- 2 files changed, 680 insertions(+), 115 deletions(-) create mode 100755 jCAE-auto-installer-linux.sh diff --git a/jCAE-auto-installer-linux.sh b/jCAE-auto-installer-linux.sh new file mode 100755 index 000000000..a60c1d95b --- /dev/null +++ b/jCAE-auto-installer-linux.sh @@ -0,0 +1,478 @@ +#!/bin/sh + +################################################## +## Detect dependencies +################################################## +# This does not take care of version numbers. + +# Step 1: Check for gcc +echo "Looking for GCC" +GCC_V=$(gcc --version | grep gcc) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "gcc Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $GCC_V "\033[0m" +fi + +# Step 2: Check for git +echo "Looking for GIT" +GIT_V=$(git --version | grep git) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "git Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $GIT_V "\033[0m" +fi + +# Step 3: Check for cmake +echo "Looking for CMAKE" +CMAKE_V=$(cmake --version | grep cmake) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "cmake Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $CMAKE_V "\033[0m" +fi + +# Step 4: Check for swig +echo "Looking for SWIG" +SWIG_V=$(swig -version | grep SWIG) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "swig Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $SWIG_V "\033[0m" +fi + +# Step 5: Check for mesa-common-dev +echo "Looking for mesa-common-dev" +MCD_V=$(dpkg -l | grep mesa-common-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $MCD_V "\033[0m" +fi + +# Step 6: Check for libxt-dev +echo "Looking for libxt-dev" +LIBXT_V=$(dpkg -l | grep libxt-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "libxt-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBXT_V "\033[0m" +fi + +# Step 7: Check for freeglut3-dev +echo "Looking for freeglut3-dev" +LIBFG3_V=$(dpkg -l | grep freeglut3-dev) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBFG3_V "\033[0m" +fi + +# Step 8: Check for openjdk-6-jdk +echo "Looking for openjdk-6-jdk" +LIBJDK_V=$(dpkg -l | grep openjdk-6-jdk) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "openjdk-6-jdk Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBJDK_V "\033[0m" +fi + +# Step 9: Check for quilt +echo "Looking for quilt" +LIBQLT_V=$(quilt --version) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "quilt Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBQLT_V "\033[0m" +fi + +# Step 10: Check for ant +echo "Looking for ant" +LIBANT_V=$(ant -version) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "ant Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBANT_V "\033[0m" +fi + + +################################################## +## Get and Install OCE 0.9.0 +################################################## + +echo -e "\033[32m Fetching oce from Github \033[0m" +git clone https://github.com/tpaviot/oce.git + +if [ $? -eq 0 ] +then + mkdir oceBuild + cd oce + git checkout OCE-0.9.0 + mkdir build + cd build + flags="-DOCE_INSTALL_PREFIX:PATH=../../oceBuild" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + cmake $flags .. +else + echo -e "\033[31m" "Unable to fetch oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce cmake successful \033[0m" + make -j2 +else + echo -e "\033[31m" "Unable to cmake oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce make successful \033[0m" + make install +else + echo -e "\033[31m" "Unable to make oce" "\033[0m" + exit 1 +fi + +if [ $? -eq 0 ] +then + echo -e "\033[32m oce install successful \033[0m" + make install +else + echo -e "\033[31m" "Unable to install oce" "\033[0m" + exit 1 +fi + +cd ../.. + + +################################################## +## Get, Patch (from jCAE) and Install VTK +## Get jCAE (installation later) +################################################## + +# Get vtk-5.6.1, unzip +wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz +tar -xf vtk-5.6.1.tar.gz + +# Get jCAE source (so early to get vtk patch) +git clone -b refresh https://github.com/mohitgargk/jCAE.git + +# Apply patch +cd VTK +./../jCAE/vtk-util/patch/5.6/apply.sh +mkdir vtkBuild + +# Build vtk +mkdir build +cd build + +flags="-DCMAKE_INSTALL_PREFIX:PATH=../../vtkBuild" +flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" +flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" +cmake $flags .. + +make -j2 +make install + +cd ../.. + +################################################## +## Get and Install JYTHON +################################################## + +echo -e "\033[32m" "Fetching Jython" "\033[0m" +wget http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Jython server Not found" "\033[0m" + exit 1 +else + java -jar jython_installer-2.5.2.jar -s -d jython +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Jython could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Jython Installed successfully" "\033[0m" +fi + +################################################## +## Get and Install VECMATH +################################################## + +echo -e "\033[32m" "Fetching vecmath" "\033[0m" +wget http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Vecmath server Not found" "\033[0m" + exit 1 +else + dpkg-deb -x libvecmath-java_1.5.2-2_all.deb vecmath +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Vecmath could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Vecmath Installed successfully" "\033[0m" +fi + + +################################################## +## Get and Install TROVE +################################################## + +echo -e "\033[32m" "Fetching trove" "\033[0m" +wget http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "trove server Not found" "\033[0m" + exit 1 +else + dpkg-deb -x libtrove-java_2.1.0-2_all.deb trove +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "trove could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "trove Installed successfully" "\033[0m" +fi + + +################################################## +## Get and Install Netbeans 7.1 +################################################## + +echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" +wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" + exit 1 +else + chmod a+x netbeans-7.1-ml-linux.sh + mkdir nb + ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" +fi + +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" +fi + +################################################## +## Get and Install XALAN +## Get XSLs for build-impl.xml creation +################################################## + +wget http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +tar xvf xalan-j_2_7_1-bin-2jars.tar.gz +rm xalan-j_2_7_1-bin-2jars.tar.gz +cd xalan-j_2_7_1 +export CLASSPATH=$CLASSPATH:$PWD/xalan.jar +export CLASSPATH=$CLASSPATH:$PWD/serializer.jar +export CLASSPATH=$CLASSPATH:$PWD/xercesImpl.jar +export CLASSPATH=$CLASSPATH:$PWD/xml-apis.jar +export CLASSPATH=$CLASSPATH:$PWD/xsltc.jar +cd .. + +mkdir xsls +cd xsls +wget http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +mv build-impl.xsl project-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl +mv build-impl.xsl suite-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl +mv build-impl.xsl module-build-impl.xsl +wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl +cd .. + + +################################################## +## jCAE INSTALLATION +################################################## + +#------------------------------------------------- +## Set envirmonment variables +#------------------------------------------------- +export mypwd=$PWD + +export jythonPath=$PWD/$(find jython/ -iname jython.jar) +export trovePath=$PWD/$(find trove/ -iname trove.jar) +export vecmathPath=$PWD/$(find vecmath/ -iname vecmath.jar) +export vtkPath=$PWD/$(find vtkBuild/ -iname vtk.jar) + +touch jcae.config + +echo "libs.trove.classpath=$trovePath" >> jcae.config +echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config +echo "libs.VTK.classpath=$vtkPath" >> jcae.config + +echo "arch.linux=true" >> jcae.config +echo "path.occ.linux=$PWD/oceBuild/" >> jcae.config +echo "path.jython.linux=$PWD/jython/" >> jcae.config +echo "vtk.dir.linux=$PWD/vtkBuild/" >> jcae.config +echo "path.occjava.linux=$PWD/occjavaBuild/libOccJava.so" >> jcae.config +echo "libs.trove.classpath=$PWD/trove/usr/share/java/trove.jar" >> jcae.config +echo "libs.VTK.classpath=$PWD/vtkBuild/lib/vtk-5.6/java/vtk.jar" >> jcae.config +echo "libs.vecmath.classpath=$PWD/vecmath/usr/share/java/vecmath.jar" >> jcae.config + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/oceBuild/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/vtkBuild/lib/vtk-5.6/ + +#------------------------------------------------- +## Build jCAE projects (vtk-util, occjava, etc) +#------------------------------------------------- + +## build OccJava +cd jCAE/occjava/ +mkdir build +cd build +cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. +make +mkdir ../../../occjavaBuild +cp *.so* ../../../occjavaBuild/ +cd ../../../ + +## building vtk-util +cd jCAE/vtk-util/ +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +ant config +ant clean +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" +cd ../.. + +## building jcae/occjava +cd jCAE/jcae/occjava +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../../.. + +## building amibe +cd jCAE/amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -f nbbuild.xml jar +cd ../.. + +## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) +cd jCAE/jcae/vtk-amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../../.. + +## building vtk-amibe-occ +cd jCAE/vtk-amibe-occ +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../.. + +#------------------------------------------------- +## Build jCAE modules +#------------------------------------------------- + +cd jCAE/jcae + +modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" +for module in $modules +do + cd "$module" + java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/module-build-impl.xsl -OUT ./nbproject/build-impl.xml + cd .. +done + + +#------------------------------------------------- +## Generate platform.xml. +#------------------------------------------------- + +# This is a now an automated step. +cd jCAE/jcae +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/platform.xsl -OUT ./nbproject/platform.xml + +#------------------------------------------------- +## Build suite as Zip distribution +#------------------------------------------------- +mkdir nbproject/private +touch nbproject/private/private.properties +cat ../../jcae.config > nbproject/private/private.properties + +mkdir vtk/nbproject/private +cp nbproject/private/private.properties vtk/nbproject/private/ + +mkdir vecmath/nbproject/private +cp nbproject/private/private.properties vecmath/nbproject/private/ + +mkdir trove/nbproject/private +cp nbproject/private/private.properties trove/nbproject/private/ + +echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties + +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/suite-build-impl.xsl -OUT ./nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" build-zip +cd ../.. + +mv jCAE/jcae/dist jCAE-zipped + +#------------------------------------------------- +## Clean +#------------------------------------------------- + +rm jython*.jar +rm libtrove*.deb +rm libvecmath*.deb +rm vtk-5.6.1.tar.gz +rm -rf VTK +rm -rf oce +rm netbeans-7.1-ml-linux.sh + diff --git a/jCAE-auto-installer.sh b/jCAE-auto-installer.sh index 85e6e7a84..d8d5431c5 100755 --- a/jCAE-auto-installer.sh +++ b/jCAE-auto-installer.sh @@ -1,12 +1,31 @@ #!/bin/sh ################################################## -## Important Instruction +## Preliminaries ################################################## + +#In addition to dependencies mentioned in the linux installer, the required packages are: + + +#1. mingw-w64 debian package (http://packages.debian.org/sid/mingw-w64) +# - This will require editing /etc/apt/sources.list +# Steps +# $ sudo echo 'deb http://ftp.de.debian.org/debian sid main' >> /etc/apt/sources.list +# $ sudo apt-get install mingw-w64 +# + +#2. wine 1.2 +# $ sudo apt-get install wine1.2 + +#Some other steps need to be performed before moving ahead # -# Environment variable $JAVA_HOME must be set before -# running this script, like -# export $JAVA_HOME=/usr/lib/jvm/java-6-openjdk/ +#1. sudo gedit /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake +# - This requires to be automated + +# +#2. JDK +# - This step assumes http://download.oracle.com/otn-pub/java/jdk/6u31-b05/jdk-6u31-windows-i586.exe to be downlaoded in pwd +# - wget is not possible for this link as licence agreement comes before download @@ -125,28 +144,129 @@ else echo -e "\033[32m" $LIBANT_V "\033[0m" fi +# Step 11: Check for gcc-mingw-w64 +echo "Looking for gcc-mingw-w64" +LIBMINGW_V=$(dpkg -l | grep gcc-mingw-w64) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "gcc-mingw-w64 Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBMINGW_V "\033[0m" +fi + +# Step 12: Check for wine +echo "Looking for wine" +LIBWINE_V=$(wine --version) +if [ $? -eq 1 ] +then + echo -e "\033[31m" "wine Not found" "\033[0m" + exit 1 +else + echo -e "\033[32m" $LIBWINE_V "\033[0m" +fi ################################################## -## Get and Install OCE 0.9.0 +## Install JDK 1.6 u31 on wine +################################################## +# +# This step assumes http://download.oracle.com/otn-pub/java/jdk/6u31-b05/jdk-6u31-windows-i586.exe to be downlaoded in pwd + +wine dummy # to initiate wine, to create ~/.wine folder +mkdir ~/.wine/drive_c/programs/ +mkdir ~/.wine/drive_c/programs/Java + +wine jdk-6u31-windows-i586.exe /s /v"/qn INSTALLDIR=$HOME/.wine/drive_c/programs/Java/" + +################################################## +## Get, Patch (from jCAE) and Install VTK +## Get jCAE (installation later) ################################################## -rootDir=$PWD +export mypwd=$PWD + +# Get vtk-5.6.1, unzip +wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz +tar -xf vtk-5.6.1.tar.gz + +# Get jCAE source (so early to get vtk patch) +git clone https://github.com/mohitgargk/jCAE.git + +# Apply patch +cd VTK +./../jCAE/vtk-util/patch/5.6/apply.sh +cd .. + +# Native Build +mkdir vtkBuild +cd vtkBuild + +flags="-DBUILD_SHARED_LIBS:BOOL=ON" +flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" +cmake $flags ../VTK +make -j4 +cd .. + +# Cross build +mkdir vtkWinBuild +mkdir vtkWinInstall + +cd vtkWinBuild +cp ../jCAE/vtk-util/toolchain-i686-w64-mingw32.cmake . +flags=" -DBUILD_SHARED_LIBS:BOOL=ON" +flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" +flags="$flags -DBUILD_TESTING:BOOL=OFF" +flags="$flags -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--kill-at" +flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + +flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" +flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib" +flags="$flags -DJAVA_COMPILE:FILEPATH=/usr/bin/javac" +flags="$flags -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" +flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32" +flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib" +flags="$flags -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe" +flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$mypwd/vtkWinInstall/" +flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake" +flags="$flags -DVTKCompileTools_DIR:FILEPATH=$mypwd/vtkBuild/" + +cmake $flags ../VTK +cmake $flags ../VTK + +make -j4 +make install + +cd .. + + +################################################## +## Get and Install OCE 0.9.0 +################################################## echo -e "\033[32m Fetching oce from Github \033[0m" git clone https://github.com/tpaviot/oce.git if [ $? -eq 0 ] then - mkdir oceBuild + mkdir oceBuild oceWinInstall cd oce - git checkout OCE-0.9.0 - mkdir build - cd build - flags="-DOCE_INSTALL_PREFIX:PATH=../../oceBuild" + git checkout OCE-0.9.0 + cd ../oceBuild + cp ../jCAE/vtk-util/toolchain-i686-w64-mingw32.cmake . + flags="-DOCE_INSTALL_PREFIX:PATH=$mypwd/oceWinInstall" flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" flags="$flags -DOCE_DISABLE_X11=ON" - cmake $flags .. + flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=/usr/bin/javac" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake" + cmake $flags ../oce else echo -e "\033[31m" "Unable to fetch oce" "\033[0m" exit 1 @@ -155,7 +275,7 @@ fi if [ $? -eq 0 ] then echo -e "\033[32m oce cmake successful \033[0m" - make -j2 + make -j4 else echo -e "\033[31m" "Unable to cmake oce" "\033[0m" exit 1 @@ -173,51 +293,61 @@ fi if [ $? -eq 0 ] then echo -e "\033[32m oce install successful \033[0m" - make install else echo -e "\033[31m" "Unable to install oce" "\033[0m" exit 1 fi +cd .. ################################################## -## Get, Patch (from jCAE) and Install VTK -## Get jCAE (installation later) +## PATCH # Copy libgcc_s_sjlj-1.dll libstdc++-6.dll ################################################## -cd $rootDir +cd oceWinInstall/Win32/bin/ -# Get vtk-5.6.1, unzip -wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz -tar -xf vtk-5.6.1.tar.gz +Is64=$(objdump -f TKBO.dll | grep 64) -# Get jCAE source (so early to get vtk patch) -git clone -b refresh https://github.com/mohitgargk/jCAE.git +if [$Is64 -eq ""] +then + cp $(find /usr/lib/ -path *i686* -iname libstdc++-6.dll) . + cp $(find /usr/lib/ -path *i686* -iname libgcc_s_sjlj-1.dll) . +else + cp $(find /usr/lib/ -path *x86_64* -iname libstdc++-6.dll) . + cp $(find /usr/lib/ -path *x86_64* -iname libgcc_s_sjlj-1.dll) . +fi -# Apply patch -cd VTK -./../jCAE/vtk-util/patch/5.6/apply.sh -mkdir vtkBuild +cd ../../../ -# Build vtk -mkdir build -cd build +################################################## +## Get and Install Netbeans 7.1 +################################################## -flags="-DCMAKE_INSTALL_PREFIX:PATH=../../vtkBuild" -flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" -flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" -cmake $flags .. +echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" +wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh -make -j2 -make install +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" + exit 1 +else + chmod a+x netbeans-7.1-ml-linux.sh + mkdir nb + ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" +fi +if [ $? -eq 1 ] +then + echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" + exit 1 +else + echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" +fi ################################################## ## Get and Install JYTHON ################################################## -cd $rootDir - echo -e "\033[32m" "Fetching Jython" "\033[0m" wget http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar @@ -241,8 +371,6 @@ fi ## Get and Install VECMATH ################################################## -cd $rootDir - echo -e "\033[32m" "Fetching vecmath" "\033[0m" wget http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb @@ -267,8 +395,6 @@ fi ## Get and Install TROVE ################################################## -cd $rootDir - echo -e "\033[32m" "Fetching trove" "\033[0m" wget http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb @@ -288,43 +414,13 @@ else echo -e "\033[32m" "trove Installed successfully" "\033[0m" fi - -################################################## -## Get and Install Netbeans 7.1 -################################################## - -cd $rootDir - -echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" -wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh - -if [ $? -eq 1 ] -then - echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" - exit 1 -else - chmod a+x netbeans-7.1-ml-linux.sh - mkdir nb - ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" -fi - -if [ $? -eq 1 ] -then - echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" -fi - ################################################## ## Get and Install XALAN ## Get XSLs for build-impl.xml creation ################################################## -cd $rootDir - wget http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz -tar xvf xalan-j_2_7_1-bin-2jars.tar.gz +tar xf xalan-j_2_7_1-bin-2jars.tar.gz rm xalan-j_2_7_1-bin-2jars.tar.gz cd xalan-j_2_7_1 export CLASSPATH=$CLASSPATH:$PWD/xalan.jar @@ -332,9 +428,8 @@ export CLASSPATH=$CLASSPATH:$PWD/serializer.jar export CLASSPATH=$CLASSPATH:$PWD/xercesImpl.jar export CLASSPATH=$CLASSPATH:$PWD/xml-apis.jar export CLASSPATH=$CLASSPATH:$PWD/xsltc.jar +cd .. - -cd $rootDir mkdir xsls cd xsls wget http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl @@ -344,22 +439,23 @@ mv build-impl.xsl suite-build-impl.xsl wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl mv build-impl.xsl module-build-impl.xsl wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl +cd .. ################################################## ## jCAE INSTALLATION ################################################## + #------------------------------------------------- ## Set envirmonment variables #------------------------------------------------- +export mypwd=$PWD -cd $rootDir - -export jythonPath=$rootDir/$(find jython/ -iname jython.jar) -export trovePath=$rootDir/$(find trove/ -iname trove.jar) -export vecmathPath=$rootDir/$(find vecmath/ -iname vecmath.jar) -export vtkPath=$rootDir/$(find vtkBuild/ -iname vtk.jar) +export jythonPath=$mypwd/$(find jython/ -iname jython.jar) +export trovePath=$mypwd/$(find trove/ -iname trove.jar) +export vecmathPath=$mypwd/$(find vecmath/ -iname vecmath.jar) +export vtkPath=$mypwd/$(find vtkWinInstall/ -iname vtk.jar) touch jcae.config @@ -367,87 +463,81 @@ echo "libs.trove.classpath=$trovePath" >> jcae.config echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config echo "libs.VTK.classpath=$vtkPath" >> jcae.config -echo "arch.linux=true" >> jcae.config -echo "path.occ.linux=$rootDir/oceBuild/" >> jcae.config -echo "path.jython.linux=$rootDir/jython/" >> jcae.config -echo "vtk.dir.linux=$rootDir/vtkBuild/" >> jcae.config -echo "path.occjava.linux=$rootDir/occjavaBuild/libOccJava.so" >> jcae.config -echo "libs.trove.classpath=$rootDir/trove/usr/share/java/trove.jar" >> jcae.config -echo "libs.VTK.classpath=$rootDir/vtkBuild/lib/vtk-5.6/java/vtk.jar" >> jcae.config -echo "libs.vecmath.classpath=$rootDir/vecmath/usr/share/java/vecmath.jar" >> jcae.config +echo "arch.win32=true" >> jcae.config +echo "path.occ.win32=$mypwd/oceWinInstall/Win32/bin/" >> jcae.config +echo "path.jython.win32=$mypwd/jython/" >> jcae.config +echo "vtk.dir.win32=$mypwd/vtkWinInstall/bin/" >> jcae.config +echo "path.occjava.win32=$mypwd/occjavaBuild/OccJava.dll" >> jcae.config -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$rootDir/oceBuild/lib/ -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$rootDir/vtkBuild/lib/vtk-5.6/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/oceWinInstall/Win32/bin/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/vtkWinInstall/bin/ #------------------------------------------------- ## Build jCAE projects (vtk-util, occjava, etc) #------------------------------------------------- - ## build OccJava -cd $rootDir cd jCAE/occjava/ mkdir build cd build -cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. +cp ../../vtk-util/toolchain-i686-w64-mingw32.cmake . +#cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. +cmake -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include/ -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib -DJAVA_COMPILE:FILEPATH=/usr/bin/javac -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32 -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe -DOCE_DIR=$mypwd/oceWinInstall/cmake/ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake -DSWIG_DIR=/usr/bin/ -DSWIG_EXECUTABLE=/usr/bin/swig .. make mkdir ../../../occjavaBuild -cp *.so* ../../../occjavaBuild/ - +cp *.dll* ../../../occjavaBuild/ +cd ../../../ ## building vtk-util -cd $rootDir cd jCAE/vtk-util/ mkdir nbproject/private touch nbproject/private/private.properties cat ../../jcae.config >> nbproject/private/private.properties ant config ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" +cd ../.. ## building jcae/occjava -cd $rootDir cd jCAE/jcae/occjava mkdir nbproject/private touch nbproject/private/private.properties cat ../../../jcae.config >> nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../../.. ## building amibe -cd $rootDir cd jCAE/amibe mkdir nbproject/private touch nbproject/private/private.properties cat ../../jcae.config >> nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" -f nbbuild.xml jar - +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -f nbbuild.xml jar +cd ../.. ## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) -cd $rootDir cd jCAE/jcae/vtk-amibe mkdir nbproject/private touch nbproject/private/private.properties cat ../../../jcae.config >> nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../../.. ## building vtk-amibe-occ -cd $rootDir cd jCAE/vtk-amibe-occ mkdir nbproject/private touch nbproject/private/private.properties cat ../../jcae.config >> nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" jar - +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar +cd ../.. #------------------------------------------------- ## Build jCAE modules #------------------------------------------------- -cd $rootDir cd jCAE/jcae modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" @@ -457,22 +547,19 @@ do java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/module-build-impl.xsl -OUT ./nbproject/build-impl.xml cd .. done - +cd ../.. #------------------------------------------------- ## Generate platform.xml. #------------------------------------------------- # This is a now an automated step. -cd $rootDir cd jCAE/jcae java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/platform.xsl -OUT ./nbproject/platform.xml #------------------------------------------------- ## Build suite as Zip distribution #------------------------------------------------- -cd $rootDir -cd jCAE/jcae/ mkdir nbproject/private touch nbproject/private/private.properties cat ../../jcae.config > nbproject/private/private.properties @@ -486,11 +573,11 @@ cp nbproject/private/private.properties vecmath/nbproject/private/ mkdir trove/nbproject/private cp nbproject/private/private.properties trove/nbproject/private/ -echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties +echo "path.jre.win32=$HOME/.wine/drive_c/programs/Java/jre/" >> nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/suite-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$rootDir/nb/" -Dnbplatform.default.harness.dir="$rootDir/nb/harness/" build-zip -cd $rootDir +ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" build-zip +cd ../.. mv jCAE/jcae/dist jCAE-zipped From ff06aaee1779edb2d0bf8f803aeac2b2565abafa Mon Sep 17 00:00:00 2001 From: mohitgargk Date: Wed, 25 Apr 2012 21:15:49 +0530 Subject: [PATCH 07/49] Windows script renamed --- jCAE-auto-installer.sh => jCAE-auto-installer-windows.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jCAE-auto-installer.sh => jCAE-auto-installer-windows.sh (100%) diff --git a/jCAE-auto-installer.sh b/jCAE-auto-installer-windows.sh similarity index 100% rename from jCAE-auto-installer.sh rename to jCAE-auto-installer-windows.sh From 6bc85b22a9a1d74fdcdb505e1126e801f25ef110 Mon Sep 17 00:00:00 2001 From: mohit Date: Fri, 27 Apr 2012 11:20:05 +0530 Subject: [PATCH 08/49] Installer scripts moved to folder scripts --- .../jCAE-auto-installer-linux.sh | 0 .../jCAE-auto-installer-windows.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename jCAE-auto-installer-linux.sh => scripts/jCAE-auto-installer-linux.sh (100%) rename jCAE-auto-installer-windows.sh => scripts/jCAE-auto-installer-windows.sh (100%) diff --git a/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh similarity index 100% rename from jCAE-auto-installer-linux.sh rename to scripts/jCAE-auto-installer-linux.sh diff --git a/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh similarity index 100% rename from jCAE-auto-installer-windows.sh rename to scripts/jCAE-auto-installer-windows.sh From 74047331d072f1b60b6faba617c9d12780983c8c Mon Sep 17 00:00:00 2001 From: u Date: Mon, 30 Apr 2012 14:11:56 +0530 Subject: [PATCH 09/49] Unified installer added --- jCAE-auto-installer.sh | 92 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 jCAE-auto-installer.sh diff --git a/jCAE-auto-installer.sh b/jCAE-auto-installer.sh new file mode 100755 index 000000000..2605c9861 --- /dev/null +++ b/jCAE-auto-installer.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +################################################## +## Script Variables +################################################## + +# Oputput text formatting +bold=`tput bold` +normal=`tput sgr0` +green="\033[32m " +red="\033[31m " +black="\033[0m " + +# Installer command line arguments + +export targetOS; +export makeSpeed; + +if [ $1 -eq "linux" ] || [ $1 -eq "windows" ] +then + targetOS=$1 +else + echo "$red$bold\n Please specify the target OS (linux/windows) \n$normal $black" +fi + +if [ $2 -eq "" ] +then + makeSpeed="2" +else + makeSpeed=$2 +fi + +# Relative paths simplified + + + +################################################## +## Detect dependencies +################################################## + + +export package="" +export useDpkg=0 + +checkPackage() +{ + #echo "\n Looking for $package" + if [ $useDpkg -eq 1 ] + then + #echo "\n dpkg" + ret=$(dpkg -l | grep $package) + if [ $? -eq 1 ] + then + echo "$red$bold\n Not Found $package \n$normal $black" + exit 1 + else + echo "$green$bold\n Found $package \n$normal $ret $black" + fi + else + #echo "\n version" + ret=$($package --version ) + if [ $? -eq 1 ] + then + echo "--version failed" + ret2=$($package -version) + echo $ret2 + if [ $? -eq 1 ] + then + echo "$red $bold\n Not Found $package \n$normal $black" + exit 1 + else + echo "$green $bold\n Found $package \n$normal $ret2 $black" + fi + else + echo "$green $bold\n Found $package \n$normal $ret $black" + fi + fi +} + +package="gcc"; useDpkg=0; checkPackage +package="git" ; useDpkg=0; checkPackage +package="cmake"; useDpkg=0; checkPackage +package="swig"; useDpkg=0; checkPackage +package="mesa-common-dev"; useDpkg=1; checkPackage +package="libxt-dev"; useDpkg=1; checkPackage +package="freeglut3-dev"; useDpkg=1; checkPackage +package="openjdk-6-jdk"; useDpkg=1; checkPackage +package="quilt"; useDpkg=0; checkPackage +package="ant"; useDpkg=0; checkPackage + +package="gcc-mingw-w64-x86-64"; useDpkg=1; checkPackage +package="wine"; useDpkg=0; checkPackage From 5828ca6bf899933588eee3db89571ae3d9a0b294 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 14:42:32 +0530 Subject: [PATCH 10/49] Dependency Check for gcc, mesa-common-dev, libxt-dev, freeglut3-dev unnecessary --- scripts/jCAE-auto-installer-linux.sh | 72 +++++++++++++------------- scripts/jCAE-auto-installer-windows.sh | 72 +++++++++++++------------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index a60c1d95b..314e6ec10 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -6,15 +6,15 @@ # This does not take care of version numbers. # Step 1: Check for gcc -echo "Looking for GCC" -GCC_V=$(gcc --version | grep gcc) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "gcc Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $GCC_V "\033[0m" -fi +#echo "Looking for GCC" +#GCC_V=$(gcc --version | grep gcc) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "gcc Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $GCC_V "\033[0m" +#fi # Step 2: Check for git echo "Looking for GIT" @@ -50,37 +50,37 @@ else fi # Step 5: Check for mesa-common-dev -echo "Looking for mesa-common-dev" -MCD_V=$(dpkg -l | grep mesa-common-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $MCD_V "\033[0m" -fi +#echo "Looking for mesa-common-dev" +#MCD_V=$(dpkg -l | grep mesa-common-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $MCD_V "\033[0m" +#fi # Step 6: Check for libxt-dev -echo "Looking for libxt-dev" -LIBXT_V=$(dpkg -l | grep libxt-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "libxt-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBXT_V "\033[0m" -fi +#echo "Looking for libxt-dev" +#LIBXT_V=$(dpkg -l | grep libxt-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "libxt-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $LIBXT_V "\033[0m" +#fi # Step 7: Check for freeglut3-dev -echo "Looking for freeglut3-dev" -LIBFG3_V=$(dpkg -l | grep freeglut3-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBFG3_V "\033[0m" -fi +#echo "Looking for freeglut3-dev" +#LIBFG3_V=$(dpkg -l | grep freeglut3-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $LIBFG3_V "\033[0m" +#fi # Step 8: Check for openjdk-6-jdk echo "Looking for openjdk-6-jdk" diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index d8d5431c5..b7375e0ca 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -35,15 +35,15 @@ # This does not take care of version numbers. # Step 1: Check for gcc -echo "Looking for GCC" -GCC_V=$(gcc --version | grep gcc) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "gcc Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $GCC_V "\033[0m" -fi +#echo "Looking for GCC" +#GCC_V=$(gcc --version | grep gcc) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "gcc Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $GCC_V "\033[0m" +#fi # Step 2: Check for git echo "Looking for GIT" @@ -79,37 +79,37 @@ else fi # Step 5: Check for mesa-common-dev -echo "Looking for mesa-common-dev" -MCD_V=$(dpkg -l | grep mesa-common-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $MCD_V "\033[0m" -fi +#echo "Looking for mesa-common-dev" +#MCD_V=$(dpkg -l | grep mesa-common-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $MCD_V "\033[0m" +#fi # Step 6: Check for libxt-dev -echo "Looking for libxt-dev" -LIBXT_V=$(dpkg -l | grep libxt-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "libxt-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBXT_V "\033[0m" -fi +#echo "Looking for libxt-dev" +#LIBXT_V=$(dpkg -l | grep libxt-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "libxt-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $LIBXT_V "\033[0m" +#fi # Step 7: Check for freeglut3-dev -echo "Looking for freeglut3-dev" -LIBFG3_V=$(dpkg -l | grep freeglut3-dev) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBFG3_V "\033[0m" -fi +#echo "Looking for freeglut3-dev" +#LIBFG3_V=$(dpkg -l | grep freeglut3-dev) +#if [ $? -eq 1 ] +#then +# echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" +# exit 1 +#else +# echo -e "\033[32m" $LIBFG3_V "\033[0m" +#fi # Step 8: Check for openjdk-6-jdk echo "Looking for openjdk-6-jdk" From 4eb30afefcad440e6d59c62fec55d7aefa2393ab Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 14:53:27 +0530 Subject: [PATCH 11/49] Make's -J{processors} argument as commandline argument for script --- scripts/jCAE-auto-installer-linux.sh | 19 +++++++++++++++++-- scripts/jCAE-auto-installer-windows.sh | 19 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index 314e6ec10..a1449cf92 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -1,5 +1,20 @@ #!/bin/sh +################################################## +## Script Variables +################################################## + +# Installer command line arguments +export makeSpeed; + +# TODO: check for supplied args +if [ "$1" = "" ] +then + makeSpeed="2" +else + makeSpeed=$1 +fi + ################################################## ## Detect dependencies ################################################## @@ -143,7 +158,7 @@ fi if [ $? -eq 0 ] then echo -e "\033[32m oce cmake successful \033[0m" - make -j2 + make -j$makeSpeed else echo -e "\033[31m" "Unable to cmake oce" "\033[0m" exit 1 @@ -196,7 +211,7 @@ flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" cmake $flags .. -make -j2 +make -j$makeSpeed make install cd ../.. diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index b7375e0ca..79a306a5c 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -27,7 +27,20 @@ # - This step assumes http://download.oracle.com/otn-pub/java/jdk/6u31-b05/jdk-6u31-windows-i586.exe to be downlaoded in pwd # - wget is not possible for this link as licence agreement comes before download +################################################## +## Script Variables +################################################## + +# Installer command line arguments +export makeSpeed; +# TODO: check for supplied args +if [ "$1" = "" ] +then + makeSpeed="2" +else + makeSpeed=$1 +fi ################################################## ## Detect dependencies @@ -204,7 +217,7 @@ cd vtkBuild flags="-DBUILD_SHARED_LIBS:BOOL=ON" flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" cmake $flags ../VTK -make -j4 +make -j$makeSpeed cd .. # Cross build @@ -233,7 +246,7 @@ flags="$flags -DVTKCompileTools_DIR:FILEPATH=$mypwd/vtkBuild/" cmake $flags ../VTK cmake $flags ../VTK -make -j4 +make -j$makeSpeed make install cd .. @@ -275,7 +288,7 @@ fi if [ $? -eq 0 ] then echo -e "\033[32m oce cmake successful \033[0m" - make -j4 + make -j$makeSpeed else echo -e "\033[31m" "Unable to cmake oce" "\033[0m" exit 1 From 19016705b0e775d327e107482ccb3aca0308af72 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 14:58:49 +0530 Subject: [PATCH 12/49] WINEPREFIX for jdk 7 installer on wine --- scripts/jCAE-auto-installer-windows.sh | 29 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index 79a306a5c..2cc1abb45 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -180,16 +180,31 @@ else fi ################################################## -## Install JDK 1.6 u31 on wine +## Install JDK 1.7 on wine ################################################## -# -# This step assumes http://download.oracle.com/otn-pub/java/jdk/6u31-b05/jdk-6u31-windows-i586.exe to be downlaoded in pwd +wineDir=$PWD/.wine +wineJavaDir=$wineDir/drive_c/Java +wineJavaUrl="http://download.java.net/jdk7u6/archive/b07/binaries/jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" +wineJavaExec="jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" + +# check for $wineDir presence +ret=$(ls "$wineDir") +if [ $? -eq 1 ] +then + export WINEPREFIX=$wineDir + winecfg +fi -wine dummy # to initiate wine, to create ~/.wine folder -mkdir ~/.wine/drive_c/programs/ -mkdir ~/.wine/drive_c/programs/Java +# check for jdk installation +ret=$(find "$wineDir" -iname java.exe) +if [ "$ret" = "" ]; +then + # Install jdk + mkdir $wineJavaDir + wget $wineJavaUrl + wine $wineJavaExec /s /v"/qn INSTALLDIR=$wineJavaDir" +fi -wine jdk-6u31-windows-i586.exe /s /v"/qn INSTALLDIR=$HOME/.wine/drive_c/programs/Java/" ################################################## ## Get, Patch (from jCAE) and Install VTK From 9b0c4dcf8bdf48487e06f3b9ff1d337fdb33c737 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 15:10:33 +0530 Subject: [PATCH 13/49] Netbeans minimal version used --- scripts/jCAE-auto-installer-linux.sh | 6 +++--- scripts/jCAE-auto-installer-windows.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index a1449cf92..21e6197c8 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -292,16 +292,16 @@ fi ################################################## echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" -wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh +wget http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh if [ $? -eq 1 ] then echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" exit 1 else - chmod a+x netbeans-7.1-ml-linux.sh + chmod a+x netbeans-7.1.1-ml-javase-linux.sh mkdir nb - ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" + ./netbeans-7.1.1-ml-javase-linux.sh --silent "-J-Dnb-base.installation.location=nb/" fi if [ $? -eq 1 ] diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index 2cc1abb45..970f905df 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -352,16 +352,16 @@ cd ../../../ ################################################## echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" -wget http://download.netbeans.org/netbeans/7.1/final/bundles/netbeans-7.1-ml-linux.sh +wget http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh if [ $? -eq 1 ] then echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" exit 1 else - chmod a+x netbeans-7.1-ml-linux.sh + chmod a+x netbeans-7.1.1-ml-javase-linux.sh mkdir nb - ./netbeans-7.1-ml-linux.sh --silent "-J-Dnb-base.installation.location=nb/" + ./netbeans-7.1.1-ml-javase-linux.sh --silent "-J-Dnb-base.installation.location=nb/" fi if [ $? -eq 1 ] From 3d2b670901b2267db2cd7f6da465149925d0d4f5 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 15:13:11 +0530 Subject: [PATCH 14/49] oce checked out with stable version 0.9.1 --- scripts/jCAE-auto-installer-linux.sh | 4 ++-- scripts/jCAE-auto-installer-windows.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index 21e6197c8..76621ff5d 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -132,7 +132,7 @@ fi ################################################## -## Get and Install OCE 0.9.0 +## Get and Install OCE 0.9.1 ################################################## echo -e "\033[32m Fetching oce from Github \033[0m" @@ -142,7 +142,7 @@ if [ $? -eq 0 ] then mkdir oceBuild cd oce - git checkout OCE-0.9.0 + git checkout OCE-0.9.1 mkdir build cd build flags="-DOCE_INSTALL_PREFIX:PATH=../../oceBuild" diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index 970f905df..e9c8494f6 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -268,7 +268,7 @@ cd .. ################################################## -## Get and Install OCE 0.9.0 +## Get and Install OCE 0.9.1 ################################################## echo -e "\033[32m Fetching oce from Github \033[0m" @@ -278,7 +278,7 @@ if [ $? -eq 0 ] then mkdir oceBuild oceWinInstall cd oce - git checkout OCE-0.9.0 + git checkout OCE-0.9.1 cd ../oceBuild cp ../jCAE/vtk-util/toolchain-i686-w64-mingw32.cmake . flags="-DOCE_INSTALL_PREFIX:PATH=$mypwd/oceWinInstall" From 8e08185cdc0a3acabb4102ba3c52752eddc662ab Mon Sep 17 00:00:00 2001 From: u Date: Tue, 1 May 2012 21:48:32 +0530 Subject: [PATCH 15/49] Bug#216 Restructured script - Components are now reused if already downloaded or build, along with proper absolute paths rather than relative --- scripts/jCAE-auto-installer-linux.sh | 470 ++++++++++++++++----------- 1 file changed, 278 insertions(+), 192 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index 76621ff5d..559764ca7 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -15,6 +15,9 @@ else makeSpeed=$1 fi +# location variables +export mypwd=$PWD + ################################################## ## Detect dependencies ################################################## @@ -135,209 +138,285 @@ fi ## Get and Install OCE 0.9.1 ################################################## +oceURL=https://github.com/tpaviot/oce.git +oceDir=$mypwd/oce +oceLinBuildDir=$mypwd/oceLinBuild +oceLinInstallDir=$mypwd/oceLinInstall + +cd $mypwd echo -e "\033[32m Fetching oce from Github \033[0m" -git clone https://github.com/tpaviot/oce.git +ret=$(ls $oceDir) +if [ $? -ne 0 ] +then + git clone $oceURL $oceDir +fi + +cd $oceDir +git checkout OCE-0.9.1 +cd $mypwd -if [ $? -eq 0 ] +ret=$(ls $oceLinBuildDir) +if [ $? -ne 0 ] then - mkdir oceBuild - cd oce - git checkout OCE-0.9.1 - mkdir build - cd build - flags="-DOCE_INSTALL_PREFIX:PATH=../../oceBuild" - flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" - flags="$flags -DOCE_DISABLE_X11=ON" - cmake $flags .. -else - echo -e "\033[31m" "Unable to fetch oce" "\033[0m" - exit 1 + mkdir $oceLinBuildDir fi -if [ $? -eq 0 ] +ret=$(find $oceLinBuildDir -iname *Tk*.so*) +if [ "$ret" = "" ] then - echo -e "\033[32m oce cmake successful \033[0m" - make -j$makeSpeed -else - echo -e "\033[31m" "Unable to cmake oce" "\033[0m" - exit 1 + cd $oceLinBuildDir + flags="-DOCE_INSTALL_PREFIX:PATH=$oceLinInstallDir" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + cmake $flags $oceDir + cd $mypwd + make -j$makeSpeed fi -if [ $? -eq 0 ] +ret=$(ls $oceLinInstallDir) +if [ $? -ne 0 ] then - echo -e "\033[32m oce make successful \033[0m" - make install -else - echo -e "\033[31m" "Unable to make oce" "\033[0m" - exit 1 + mkdir $oceLinInstallDir fi -if [ $? -eq 0 ] +ret=$(find $oceLinInstallDir -iname *Tk*.so*) +if [ "$ret" = "" ] then - echo -e "\033[32m oce install successful \033[0m" + cd $oceLinBuildDir make install -else - echo -e "\033[31m" "Unable to install oce" "\033[0m" - exit 1 fi -cd ../.. - +cd $mypwd ################################################## ## Get, Patch (from jCAE) and Install VTK ## Get jCAE (installation later) ################################################## +# Define abs locations + +vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" +vtkTar="vtk-5.6.1.tar.gz" +vtkDir=$mypwd/VTK +vtkLinBuildDir=$mypwd/vtkLinBuild +vtkLinInstallDir=$mypwd/vtkLinInstall + +jcaeURL=https://github.com/jeromerobert/jCAE.git +jcaeDir=$mypwd/jCAE + # Get vtk-5.6.1, unzip -wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz -tar -xf vtk-5.6.1.tar.gz +ret=$(ls $vtkTar) +if [ $? -ne 0 ] +then + wget $vtkURL +fi + +ret=$(ls $vtkDir) +if [ $? -ne 0 ] +then + tar -xf $vtkTar +fi # Get jCAE source (so early to get vtk patch) -git clone -b refresh https://github.com/mohitgargk/jCAE.git +ret=$(ls $jcaeDir) +if [ $? -ne 0 ] +then + git clone $jcaeURL +fi # Apply patch -cd VTK -./../jCAE/vtk-util/patch/5.6/apply.sh -mkdir vtkBuild +cd $vtkDir +$jcaeDir/vtk-util/patch/5.6/apply.sh +cd $mypwd -# Build vtk -mkdir build -cd build +ret=$(ls $vtkLinBuildDir) +if [ $? -ne 0 ] +then + mkdir $vtkLinBuildDir +fi + +ret=$(find $vtkLinBuildDir -iname vtk.jar) +if [ "$ret" = "" ] +then + cd $vtkLinBuildDir + flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" + flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" + flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + cmake $flags $vtkDir + make -j$makeSpeed +fi +cd $mypwd -flags="-DCMAKE_INSTALL_PREFIX:PATH=../../vtkBuild" -flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" -flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" -cmake $flags .. +ret=$(ls $vtkLinInstallDir) +if [ $? -ne 0 ] +then + mkdir $vtkLinInstallDir +fi -make -j$makeSpeed -make install +ret=$(find $vtkLinInstallDir -iname vtk.jar) +if [ "$ret" = "" ] +then + cd $vtkLinBuildDir + make install +fi -cd ../.. +cd $mypwd ################################################## ## Get and Install JYTHON ################################################## -echo -e "\033[32m" "Fetching Jython" "\033[0m" -wget http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar +jythonURL=http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar +jythonJar=jython_installer-2.5.2.jar +jythonDir=$mypwd/jython -if [ $? -eq 1 ] +ret=$(ls $jythonJar) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Jython server Not found" "\033[0m" - exit 1 -else - java -jar jython_installer-2.5.2.jar -s -d jython + wget $jythonURL fi -if [ $? -eq 1 ] +ret=$(ls $jythonDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Jython could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Jython Installed successfully" "\033[0m" + java -jar $jythonJar -s -d $jythonDir fi + ################################################## ## Get and Install VECMATH ################################################## +vecmathURL=http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb +vecmathDebian=libvecmath-java_1.5.2-2_all.deb +vecmathDir=$mypwd/vecmath -echo -e "\033[32m" "Fetching vecmath" "\033[0m" -wget http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb - -if [ $? -eq 1 ] +ret=$(ls $vecmathDebian) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Vecmath server Not found" "\033[0m" - exit 1 -else - dpkg-deb -x libvecmath-java_1.5.2-2_all.deb vecmath + wget $vecmathURL fi -if [ $? -eq 1 ] +ret=$(ls $vecmathDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Vecmath could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Vecmath Installed successfully" "\033[0m" + dpkg-deb -x $vecmathDebian $vecmathDir fi ################################################## ## Get and Install TROVE ################################################## - -echo -e "\033[32m" "Fetching trove" "\033[0m" -wget http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb - -if [ $? -eq 1 ] +troveURL=http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb +troveDebian=libtrove-java_2.1.0-2_all.deb +troveDir=$mypwd/trove +ret=$(ls $troveDebian) +if [ $? -ne 0 ] then - echo -e "\033[31m" "trove server Not found" "\033[0m" - exit 1 -else - dpkg-deb -x libtrove-java_2.1.0-2_all.deb trove + wget $troveURL fi -if [ $? -eq 1 ] +ret=$(ls $troveDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "trove could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "trove Installed successfully" "\033[0m" + dpkg-deb -x $troveDebian $troveDir fi ################################################## ## Get and Install Netbeans 7.1 ################################################## +nbURL=http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh +nbEx=netbeans-7.1.1-ml-javase-linux.sh +nbDir=$mypwd/nb -echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" -wget http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh - -if [ $? -eq 1 ] +ret=$(ls $nbEx) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" - exit 1 -else - chmod a+x netbeans-7.1.1-ml-javase-linux.sh - mkdir nb - ./netbeans-7.1.1-ml-javase-linux.sh --silent "-J-Dnb-base.installation.location=nb/" + wget $nbURL + chmod a+x $nbEx fi -if [ $? -eq 1 ] +ret=$(ls $nbDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" + mkdir $nbDir + ./$nbEx --silent "-J-Dnb-base.installation.location=$nbDir" fi + ################################################## ## Get and Install XALAN ## Get XSLs for build-impl.xml creation ################################################## +xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz +xalanDir=$mypwd/xalan-j_2_7_1 + +ret=$(ls $xalanTar) +if [ $? -ne 0 ] +then + wget $xalanURL +fi -wget http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz -tar xvf xalan-j_2_7_1-bin-2jars.tar.gz -rm xalan-j_2_7_1-bin-2jars.tar.gz -cd xalan-j_2_7_1 -export CLASSPATH=$CLASSPATH:$PWD/xalan.jar -export CLASSPATH=$CLASSPATH:$PWD/serializer.jar -export CLASSPATH=$CLASSPATH:$PWD/xercesImpl.jar -export CLASSPATH=$CLASSPATH:$PWD/xml-apis.jar -export CLASSPATH=$CLASSPATH:$PWD/xsltc.jar -cd .. - -mkdir xsls -cd xsls -wget http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl -mv build-impl.xsl project-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl -mv build-impl.xsl suite-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl -mv build-impl.xsl module-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl -cd .. +ret=$(ls $xalanDir) +if [ $? -ne 0 ] +then + tar xf $xalanTar +fi + +export CLASSPATH=$CLASSPATH:$xalanDir/xalan.jar +export CLASSPATH=$CLASSPATH:$xalanDir/serializer.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xercesImpl.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xml-apis.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xsltc.jar + +################ +#XSLS +################ +xslDir=$mypwd/xsls +nbProjectXslURL=http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +nbSuiteXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl +nbModuleXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl +nbPlatformXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl + +ret=$(ls $xslDir) +if [ $? -ne 0 ] +then + mkdir $xslDir +fi + +ret=$(ls -1 $xslDir | wc -l) +if [ "$ret" != "4" ] +then + ret=$(ls $xslDir/project-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbProjectXslURL + mv build-impl.xsl $xslDir/project-build-impl.xsl + fi + + ret=$(ls $xslDir/suite-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbSuiteXslURL + mv build-impl.xsl $xslDir/suite-build-impl.xsl + fi + + ret=$(ls $xslDir/module-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbModuleXslURL + mv build-impl.xsl $xslDir/module-build-impl.xsl + fi + + ret=$(ls $xslDir/platform.xsl) + if [ $? -ne 0 ] + then + wget $nbPlatformXslURL + mv platform.xsl $xslDir/platform.xsl + fi +fi ################################################## @@ -347,103 +426,122 @@ cd .. #------------------------------------------------- ## Set envirmonment variables #------------------------------------------------- -export mypwd=$PWD -export jythonPath=$PWD/$(find jython/ -iname jython.jar) -export trovePath=$PWD/$(find trove/ -iname trove.jar) -export vecmathPath=$PWD/$(find vecmath/ -iname vecmath.jar) -export vtkPath=$PWD/$(find vtkBuild/ -iname vtk.jar) +export jythonPath=$(find $jythonDir -iname jython.jar) +export trovePath=$(find $troveDir -iname trove.jar) +export vecmathPath=$(find $vecmathDir -iname vecmath.jar) +export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) touch jcae.config +echo "" > jcae.config echo "libs.trove.classpath=$trovePath" >> jcae.config echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config echo "libs.VTK.classpath=$vtkPath" >> jcae.config echo "arch.linux=true" >> jcae.config -echo "path.occ.linux=$PWD/oceBuild/" >> jcae.config -echo "path.jython.linux=$PWD/jython/" >> jcae.config -echo "vtk.dir.linux=$PWD/vtkBuild/" >> jcae.config -echo "path.occjava.linux=$PWD/occjavaBuild/libOccJava.so" >> jcae.config -echo "libs.trove.classpath=$PWD/trove/usr/share/java/trove.jar" >> jcae.config -echo "libs.VTK.classpath=$PWD/vtkBuild/lib/vtk-5.6/java/vtk.jar" >> jcae.config -echo "libs.vecmath.classpath=$PWD/vecmath/usr/share/java/vecmath.jar" >> jcae.config +echo "path.occ.linux=$oceLinBuildDir" >> jcae.config +echo "path.jython.linux=$jythonDir" >> jcae.config +echo "vtk.dir.linux=$vtkLinBuildDir" >> jcae.config +echo "path.occjava.linux=$mypwd/occjavaInstall/libOccJava.so" >> jcae.config + +ret=$(find /usr/lib/ -iname libstdc++.so | head -1) +echo "path.libstdc++=$ret" >> jcae.config -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/oceBuild/lib/ -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/vtkBuild/lib/vtk-5.6/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceLinBuild/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkLinBuild/lib/vtk-5.6/ + +#------------------------------------------------- +## Clean jCAE and occjava +#------------------------------------------------- +# Cleaning jCAE from any previous wrong built requires +# an extraordinary amount of checking/editing in +# a lot of properties files. +# TODO: One idea would be to run - +# cd $mypwd; +# ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" clean +# Will try it in the unified script + +# For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans +rm -rf $jcaeDir +rm -rf $mypwd/occjavaInstall +git clone $jcaeURL #------------------------------------------------- ## Build jCAE projects (vtk-util, occjava, etc) #------------------------------------------------- ## build OccJava -cd jCAE/occjava/ -mkdir build -cd build -cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. +occjavaDir=$jcaeDir/occjava +occjavaBuildDir=$jcaeDir/occjava/build +occjavaInstallDir=$mypwd/occjavaInstall/ +cd $jcaeDir/occjava/ +mkdir $occjavaBuildDir +cd $occjavaBuildDir +cmake -DOCE_DIR=$oceLinInstallDir/lib/oce-0.9.1 $occjavaDir make -mkdir ../../../occjavaBuild -cp *.so* ../../../occjavaBuild/ -cd ../../../ +mkdir $occjavaInstallDir +cp *.so* $occjavaInstallDir +cd $mypwd ## building vtk-util -cd jCAE/vtk-util/ +cd $jcaeDir/vtk-util/ mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties ant config ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -cd ../.. +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" +cd $mypwd ## building jcae/occjava -cd jCAE/jcae/occjava +cd $jcaeDir/jcae/occjava mkdir nbproject/private touch nbproject/private/private.properties -cat ../../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd ## building amibe -cd jCAE/amibe +cd $jcaeDir/amibe mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -f nbbuild.xml jar -cd ../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar +cd $mypwd ## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) -cd jCAE/jcae/vtk-amibe +cd $jcaeDir/jcae/vtk-amibe mkdir nbproject/private touch nbproject/private/private.properties -cat ../../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd ## building vtk-amibe-occ -cd jCAE/vtk-amibe-occ +cd $jcaeDir/vtk-amibe-occ mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd #------------------------------------------------- ## Build jCAE modules #------------------------------------------------- -cd jCAE/jcae +cd $jcaeDir/jcae modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" for module in $modules do + cd $jcaeDir/jcae cd "$module" - java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/module-build-impl.xsl -OUT ./nbproject/build-impl.xml - cd .. + java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml done @@ -452,15 +550,15 @@ done #------------------------------------------------- # This is a now an automated step. -cd jCAE/jcae -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/platform.xsl -OUT ./nbproject/platform.xml +cd $jcaeDir/jcae +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml #------------------------------------------------- ## Build suite as Zip distribution #------------------------------------------------- mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config > nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties mkdir vtk/nbproject/private cp nbproject/private/private.properties vtk/nbproject/private/ @@ -473,21 +571,9 @@ cp nbproject/private/private.properties trove/nbproject/private/ echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/suite-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" build-zip -cd ../.. - -mv jCAE/jcae/dist jCAE-zipped - -#------------------------------------------------- -## Clean -#------------------------------------------------- +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip +cd $mypwd -rm jython*.jar -rm libtrove*.deb -rm libvecmath*.deb -rm vtk-5.6.1.tar.gz -rm -rf VTK -rm -rf oce -rm netbeans-7.1-ml-linux.sh +mv $jcaeDir/jcae/dist jCAE-zipped From 398996bb0819e3f6025f0de411fcd8d7e28a9ae7 Mon Sep 17 00:00:00 2001 From: u Date: Thu, 3 May 2012 16:02:55 +0530 Subject: [PATCH 16/49] Restructured script - Components are now reused if already downloaded or build, along with proper absolute paths rather than relative --- scripts/jCAE-auto-installer-linux.sh | 111 ++++++------ scripts/jCAE-auto-installer-windows.sh | 241 +++++++++++++++---------- 2 files changed, 204 insertions(+), 148 deletions(-) diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh index 559764ca7..f456ad208 100755 --- a/scripts/jCAE-auto-installer-linux.sh +++ b/scripts/jCAE-auto-installer-linux.sh @@ -134,61 +134,6 @@ else fi -################################################## -## Get and Install OCE 0.9.1 -################################################## - -oceURL=https://github.com/tpaviot/oce.git -oceDir=$mypwd/oce -oceLinBuildDir=$mypwd/oceLinBuild -oceLinInstallDir=$mypwd/oceLinInstall - -cd $mypwd -echo -e "\033[32m Fetching oce from Github \033[0m" -ret=$(ls $oceDir) -if [ $? -ne 0 ] -then - git clone $oceURL $oceDir -fi - -cd $oceDir -git checkout OCE-0.9.1 -cd $mypwd - -ret=$(ls $oceLinBuildDir) -if [ $? -ne 0 ] -then - mkdir $oceLinBuildDir -fi - -ret=$(find $oceLinBuildDir -iname *Tk*.so*) -if [ "$ret" = "" ] -then - cd $oceLinBuildDir - flags="-DOCE_INSTALL_PREFIX:PATH=$oceLinInstallDir" - flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" - flags="$flags -DOCE_DISABLE_X11=ON" - cmake $flags $oceDir - cd $mypwd - make -j$makeSpeed -fi - -ret=$(ls $oceLinInstallDir) -if [ $? -ne 0 ] -then - mkdir $oceLinInstallDir -fi - -ret=$(find $oceLinInstallDir -iname *Tk*.so*) -if [ "$ret" = "" ] -then - cd $oceLinBuildDir - make install -fi - -cd $mypwd - ################################################## ## Get, Patch (from jCAE) and Install VTK ## Get jCAE (installation later) @@ -263,6 +208,62 @@ fi cd $mypwd +################################################## +## Get and Install OCE 0.9.1 +################################################## + +oceURL=https://github.com/tpaviot/oce.git +oceDir=$mypwd/oce +oceLinBuildDir=$mypwd/oceLinBuild +oceLinInstallDir=$mypwd/oceLinInstall + +cd $mypwd +echo -e "\033[32m Fetching oce from Github \033[0m" +ret=$(ls $oceDir) +if [ $? -ne 0 ] +then + git clone $oceURL $oceDir +fi + +cd $oceDir +git checkout OCE-0.9.1 +cd $mypwd + +ret=$(ls $oceLinBuildDir) +if [ $? -ne 0 ] +then + mkdir $oceLinBuildDir +fi + +ret=$(find $oceLinBuildDir -iname *Tk*.so*) +if [ "$ret" = "" ] +then + cd $oceLinBuildDir + flags="-DOCE_INSTALL_PREFIX:PATH=$oceLinInstallDir" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + cmake $flags $oceDir + cd $mypwd + make -j$makeSpeed +fi + +ret=$(ls $oceLinInstallDir) +if [ $? -ne 0 ] +then + mkdir $oceLinInstallDir +fi + +ret=$(find $oceLinInstallDir -iname *Tk*.so*) +if [ "$ret" = "" ] +then + cd $oceLinBuildDir + make install +fi + +cd $mypwd + + ################################################## ## Get and Install JYTHON ################################################## diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index e9c8494f6..23ffaf1ff 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -22,11 +22,6 @@ #1. sudo gedit /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake # - This requires to be automated -# -#2. JDK -# - This step assumes http://download.oracle.com/otn-pub/java/jdk/6u31-b05/jdk-6u31-windows-i586.exe to be downlaoded in pwd -# - wget is not possible for this link as licence agreement comes before download - ################################################## ## Script Variables ################################################## @@ -42,6 +37,9 @@ else makeSpeed=$1 fi +# location variables +export mypwd=$PWD + ################################################## ## Detect dependencies ################################################## @@ -182,22 +180,24 @@ fi ################################################## ## Install JDK 1.7 on wine ################################################## -wineDir=$PWD/.wine +wineDir=$mypwd/.wine wineJavaDir=$wineDir/drive_c/Java wineJavaUrl="http://download.java.net/jdk7u6/archive/b07/binaries/jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" wineJavaExec="jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" # check for $wineDir presence ret=$(ls "$wineDir") -if [ $? -eq 1 ] +if [ $? -ne 0 ] then - export WINEPREFIX=$wineDir + mkdir $wineDir winecfg fi +export WINEPREFIX=$wineDir + # check for jdk installation ret=$(find "$wineDir" -iname java.exe) -if [ "$ret" = "" ]; +if [ "$ret" = "" ] then # Install jdk mkdir $wineJavaDir @@ -205,128 +205,183 @@ then wine $wineJavaExec /s /v"/qn INSTALLDIR=$wineJavaDir" fi - ################################################## ## Get, Patch (from jCAE) and Install VTK ## Get jCAE (installation later) ################################################## -export mypwd=$PWD +# Define abs locations +vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" +vtkTar="vtk-5.6.1.tar.gz" +vtkDir=$mypwd/VTK +vtkLinBuildDir=$mypwd/vtkLinBuild +vtkLinInstallDir=$mypwd/vtkLinInstall +vtkWinBuildDir=$mypwd/vtkWinBuild +vtkWinInstallDir=$mypwd/vtkWinInstall + +jcaeURL=https://github.com/jeromerobert/jCAE.git +jcaeDir=$mypwd/jCAE # Get vtk-5.6.1, unzip -wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz -tar -xf vtk-5.6.1.tar.gz +ret=$(ls $vtkTar) +if [ $? -ne 0 ] +then + wget $vtkURL +fi + +ret=$(ls $vtkDir) +if [ $? -ne 0 ] +then + tar -xf $vtkTar +fi # Get jCAE source (so early to get vtk patch) -git clone https://github.com/mohitgargk/jCAE.git +ret=$(ls $jcaeDir) +if [ $? -ne 0 ] +then + git clone $jcaeURL +fi # Apply patch -cd VTK -./../jCAE/vtk-util/patch/5.6/apply.sh -cd .. +cd $vtkDir +$jcaeDir/vtk-util/patch/5.6/apply.sh +cd $mypwd -# Native Build -mkdir vtkBuild -cd vtkBuild +ret=$(ls $vtkLinBuildDir) +if [ $? -ne 0 ] +then + mkdir $vtkLinBuildDir +fi -flags="-DBUILD_SHARED_LIBS:BOOL=ON" -flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" -cmake $flags ../VTK -make -j$makeSpeed -cd .. +ret=$(find $vtkLinBuildDir -iname vtk.jar) +if [ "$ret" = "" ] +then + cd $vtkLinBuildDir + flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" + flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" + flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + cmake $flags $vtkDir + make -j$makeSpeed +fi +cd $mypwd # Cross build -mkdir vtkWinBuild -mkdir vtkWinInstall - -cd vtkWinBuild -cp ../jCAE/vtk-util/toolchain-i686-w64-mingw32.cmake . -flags=" -DBUILD_SHARED_LIBS:BOOL=ON" -flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" -flags="$flags -DBUILD_TESTING:BOOL=OFF" -flags="$flags -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--kill-at" -flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" - -flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" -flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib" -flags="$flags -DJAVA_COMPILE:FILEPATH=/usr/bin/javac" -flags="$flags -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" -flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32" -flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib" -flags="$flags -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe" -flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$mypwd/vtkWinInstall/" -flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake" -flags="$flags -DVTKCompileTools_DIR:FILEPATH=$mypwd/vtkBuild/" - -cmake $flags ../VTK -cmake $flags ../VTK - -make -j$makeSpeed -make install +ret=$(ls $vtkWinBuildDir) +if [ $? -ne 0 ] +then + mkdir $vtkWinBuildDir +fi -cd .. +ret=$(find $vtkWinBuildDir -iname vtk.jar) +if [ "$ret" = "" ] +then + cd $vtkWinBuildDir + flags=" -DBUILD_SHARED_LIBS:BOOL=ON" + flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + flags="$flags -DBUILD_TESTING:BOOL=OFF" + flags="$flags -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--kill-at" + flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/bin/javac.exe" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/bin/java.exe" + + flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$vtkWinInstallDir/" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-x86_64-w64-mingw32.cmake" + flags="$flags -DVTKCompileTools_DIR:FILEPATH=$vtkLinBuildDir" + + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + + cmake $flags $vtkDir + cmake $flags $vtkDir + make -j$makeSpeed +fi + +ret=$(ls $vtkWinInstallDir) +if [ $? -ne 0 ] +then + cd $mypwd + mkdir $vtkWinInstallDir +fi + +ret=$(find $vtkWinInstallDir -iname vtk.jar) +if [ "$ret" = "" ] +then + cd $vtkWinBuildDir + make install +fi + +cd $mypwd ################################################## ## Get and Install OCE 0.9.1 ################################################## +oceURL=https://github.com/tpaviot/oce.git +oceDir=$mypwd/oce +oceWinBuildDir=$mypwd/oceWinBuild +oceWinInstallDir=$mypwd/oceWinInstall + +cd $mypwd echo -e "\033[32m Fetching oce from Github \033[0m" -git clone https://github.com/tpaviot/oce.git +ret=$(ls $oceDir) +if [ $? -ne 0 ] +then + git clone $oceURL $oceDir +fi + +cd $oceDir +git checkout OCE-0.9.1 +cd $mypwd -if [ $? -eq 0 ] +ret=$(ls $oceWinBuildDir) +if [ $? -ne 0 ] then - mkdir oceBuild oceWinInstall - cd oce - git checkout OCE-0.9.1 - cd ../oceBuild - cp ../jCAE/vtk-util/toolchain-i686-w64-mingw32.cmake . - flags="-DOCE_INSTALL_PREFIX:PATH=$mypwd/oceWinInstall" + mkdir $oceWinBuildDir +fi + +ret=$(find $oceWinBuildDir -iname *Tk*.dll) +if [ "$ret" = "" ] +then + cd $oceWinBuildDir + flags="-DOCE_INSTALL_PREFIX:PATH=$oceWinInstallDir" flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" flags="$flags -DOCE_DISABLE_X11=ON" flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" - flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" - flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib" - flags="$flags -DJAVA_COMPILE:FILEPATH=/usr/bin/javac" - flags="$flags -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include" - flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32" - flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib" - flags="$flags -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe" - flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake" - cmake $flags ../oce -else - echo -e "\033[31m" "Unable to fetch oce" "\033[0m" - exit 1 -fi - -if [ $? -eq 0 ] -then - echo -e "\033[32m oce cmake successful \033[0m" + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-x86_64-w64-mingw32.cmake" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + cmake $flags $oceDir make -j$makeSpeed -else - echo -e "\033[31m" "Unable to cmake oce" "\033[0m" - exit 1 fi -if [ $? -eq 0 ] +ret=$(ls $oceWinInstallDir) +if [ $? -ne 0 ] then - echo -e "\033[32m oce make successful \033[0m" - make install -else - echo -e "\033[31m" "Unable to make oce" "\033[0m" - exit 1 + mkdir $oceWinInstallDir fi -if [ $? -eq 0 ] +ret=$(find $oceWinInstallDir -iname *Tk*.dll) +if [ "$ret" = "" ] then - echo -e "\033[32m oce install successful \033[0m" -else - echo -e "\033[31m" "Unable to install oce" "\033[0m" - exit 1 + cd $oceWinBuildDir + make install fi -cd .. +cd $mypwd ################################################## ## PATCH # Copy libgcc_s_sjlj-1.dll libstdc++-6.dll From 75a8d20192881e363bf458ed19b6f02d1529e929 Mon Sep 17 00:00:00 2001 From: u Date: Sat, 5 May 2012 18:04:53 +0530 Subject: [PATCH 17/49] Windows installer commits issue#216 --- scripts/jCAE-auto-installer-windows.sh | 362 ++++++++++++++----------- 1 file changed, 209 insertions(+), 153 deletions(-) diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh index 23ffaf1ff..27bd950c4 100755 --- a/scripts/jCAE-auto-installer-windows.sh +++ b/scripts/jCAE-auto-installer-windows.sh @@ -182,10 +182,12 @@ fi ################################################## wineDir=$mypwd/.wine wineJavaDir=$wineDir/drive_c/Java -wineJavaUrl="http://download.java.net/jdk7u6/archive/b07/binaries/jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" -wineJavaExec="jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" +wineJavaUrl="http://www.java.net/download/jdk6/6u32/promoted/b02/binaries/jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" +wineJavaExec="jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" # check for $wineDir presence + +export WINEPREFIX=$wineDir ret=$(ls "$wineDir") if [ $? -ne 0 ] then @@ -193,8 +195,6 @@ then winecfg fi -export WINEPREFIX=$wineDir - # check for jdk installation ret=$(find "$wineDir" -iname java.exe) if [ "$ret" = "" ] @@ -292,7 +292,7 @@ then flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/bin/java.exe" flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$vtkWinInstallDir/" - flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-x86_64-w64-mingw32.cmake" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" flags="$flags -DVTKCompileTools_DIR:FILEPATH=$vtkLinBuildDir" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" @@ -362,7 +362,7 @@ then flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" - flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-x86_64-w64-mingw32.cmake" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" cmake $flags $oceDir make -j$makeSpeed @@ -387,7 +387,7 @@ cd $mypwd ## PATCH # Copy libgcc_s_sjlj-1.dll libstdc++-6.dll ################################################## -cd oceWinInstall/Win32/bin/ +cd $oceWinInstallDir/Win32/bin/ Is64=$(objdump -f TKBO.dll | grep 64) @@ -402,250 +402,319 @@ fi cd ../../../ + ################################################## -## Get and Install Netbeans 7.1 +## Get and Install JYTHON ################################################## -echo -e "\033[32m" "Fetching Netbeans 7.1" "\033[0m" -wget http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh +jythonURL=http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar +jythonJar=jython_installer-2.5.2.jar +jythonDir=$mypwd/jython -if [ $? -eq 1 ] +ret=$(ls $jythonJar) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Netbeans setup Not found" "\033[0m" - exit 1 -else - chmod a+x netbeans-7.1.1-ml-javase-linux.sh - mkdir nb - ./netbeans-7.1.1-ml-javase-linux.sh --silent "-J-Dnb-base.installation.location=nb/" + wget $jythonURL fi -if [ $? -eq 1 ] +ret=$(ls $jythonDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Netbeans could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Netbeans Installed successfully" "\033[0m" + java -jar $jythonJar -s -d $jythonDir fi + ################################################## -## Get and Install JYTHON +## Get and Install VECMATH ################################################## +vecmathURL=http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb +vecmathDebian=libvecmath-java_1.5.2-2_all.deb +vecmathDir=$mypwd/vecmath -echo -e "\033[32m" "Fetching Jython" "\033[0m" -wget http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar - -if [ $? -eq 1 ] +ret=$(ls $vecmathDebian) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Jython server Not found" "\033[0m" - exit 1 -else - java -jar jython_installer-2.5.2.jar -s -d jython + wget $vecmathURL fi -if [ $? -eq 1 ] +ret=$(ls $vecmathDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Jython could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Jython Installed successfully" "\033[0m" + dpkg-deb -x $vecmathDebian $vecmathDir fi + ################################################## -## Get and Install VECMATH +## Get and Install TROVE ################################################## - -echo -e "\033[32m" "Fetching vecmath" "\033[0m" -wget http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb - -if [ $? -eq 1 ] +troveURL=http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb +troveDebian=libtrove-java_2.1.0-2_all.deb +troveDir=$mypwd/trove +ret=$(ls $troveDebian) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Vecmath server Not found" "\033[0m" - exit 1 -else - dpkg-deb -x libvecmath-java_1.5.2-2_all.deb vecmath + wget $troveURL fi -if [ $? -eq 1 ] +ret=$(ls $troveDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "Vecmath could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "Vecmath Installed successfully" "\033[0m" + dpkg-deb -x $troveDebian $troveDir fi ################################################## -## Get and Install TROVE +## Get and Install Netbeans 7.1 ################################################## +nbURL=http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh +nbEx=netbeans-7.1.1-ml-javase-linux.sh +nbDir=$mypwd/nb -echo -e "\033[32m" "Fetching trove" "\033[0m" -wget http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb - -if [ $? -eq 1 ] +ret=$(ls $nbEx) +if [ $? -ne 0 ] then - echo -e "\033[31m" "trove server Not found" "\033[0m" - exit 1 -else - dpkg-deb -x libtrove-java_2.1.0-2_all.deb trove + wget $nbURL + chmod a+x $nbEx fi -if [ $? -eq 1 ] +ret=$(ls $nbDir) +if [ $? -ne 0 ] then - echo -e "\033[31m" "trove could not be installed" "\033[0m" - exit 1 -else - echo -e "\033[32m" "trove Installed successfully" "\033[0m" + mkdir $nbDir + ./$nbEx --silent "-J-Dnb-base.installation.location=$nbDir" fi + ################################################## ## Get and Install XALAN ## Get XSLs for build-impl.xml creation ################################################## +xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz +xalanDir=$mypwd/xalan-j_2_7_1 -wget http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz -tar xf xalan-j_2_7_1-bin-2jars.tar.gz -rm xalan-j_2_7_1-bin-2jars.tar.gz -cd xalan-j_2_7_1 -export CLASSPATH=$CLASSPATH:$PWD/xalan.jar -export CLASSPATH=$CLASSPATH:$PWD/serializer.jar -export CLASSPATH=$CLASSPATH:$PWD/xercesImpl.jar -export CLASSPATH=$CLASSPATH:$PWD/xml-apis.jar -export CLASSPATH=$CLASSPATH:$PWD/xsltc.jar -cd .. - -mkdir xsls -cd xsls -wget http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl -mv build-impl.xsl project-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl -mv build-impl.xsl suite-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl -mv build-impl.xsl module-build-impl.xsl -wget http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl -cd .. +ret=$(ls $xalanTar) +if [ $? -ne 0 ] +then + wget $xalanURL +fi + +ret=$(ls $xalanDir) +if [ $? -ne 0 ] +then + tar xf $xalanTar +fi + +export CLASSPATH=$CLASSPATH:$xalanDir/xalan.jar +export CLASSPATH=$CLASSPATH:$xalanDir/serializer.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xercesImpl.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xml-apis.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xsltc.jar + +################ +#XSLS +################ +xslDir=$mypwd/xsls +nbProjectXslURL=http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +nbSuiteXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl +nbModuleXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl +nbPlatformXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl + +ret=$(ls $xslDir) +if [ $? -ne 0 ] +then + mkdir $xslDir +fi + +ret=$(ls -1 $xslDir | wc -l) +if [ "$ret" != "4" ] +then + ret=$(ls $xslDir/project-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbProjectXslURL + mv build-impl.xsl $xslDir/project-build-impl.xsl + fi + + ret=$(ls $xslDir/suite-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbSuiteXslURL + mv build-impl.xsl $xslDir/suite-build-impl.xsl + fi + + ret=$(ls $xslDir/module-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbModuleXslURL + mv build-impl.xsl $xslDir/module-build-impl.xsl + fi + + ret=$(ls $xslDir/platform.xsl) + if [ $? -ne 0 ] + then + wget $nbPlatformXslURL + mv platform.xsl $xslDir/platform.xsl + fi +fi ################################################## ## jCAE INSTALLATION ################################################## - #------------------------------------------------- ## Set envirmonment variables #------------------------------------------------- -export mypwd=$PWD -export jythonPath=$mypwd/$(find jython/ -iname jython.jar) -export trovePath=$mypwd/$(find trove/ -iname trove.jar) -export vecmathPath=$mypwd/$(find vecmath/ -iname vecmath.jar) -export vtkPath=$mypwd/$(find vtkWinInstall/ -iname vtk.jar) +export jythonPath=$(find $jythonDir -iname jython.jar) +export trovePath=$(find $troveDir -iname trove.jar) +export vecmathPath=$(find $vecmathDir -iname vecmath.jar) +export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) touch jcae.config +echo "" > jcae.config echo "libs.trove.classpath=$trovePath" >> jcae.config echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config echo "libs.VTK.classpath=$vtkPath" >> jcae.config echo "arch.win32=true" >> jcae.config -echo "path.occ.win32=$mypwd/oceWinInstall/Win32/bin/" >> jcae.config -echo "path.jython.win32=$mypwd/jython/" >> jcae.config -echo "vtk.dir.win32=$mypwd/vtkWinInstall/bin/" >> jcae.config +echo "path.occ.win32=$oceWinInstallDir/Win32/bin/" >> jcae.config +echo "path.jython.win32=$jythonDir" >> jcae.config +echo "vtk.dir.win32=$vtkWinInstallDir/bin/" >> jcae.config echo "path.occjava.win32=$mypwd/occjavaBuild/OccJava.dll" >> jcae.config export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/oceWinInstall/Win32/bin/ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/vtkWinInstall/bin/ +#------------------------------------------------- +## Clean jCAE and occjava +#------------------------------------------------- +# Cleaning jCAE from any previous wrong built requires +# an extraordinary amount of checking/editing in +# a lot of properties files. +# TODO: One idea would be to run - +# cd $mypwd; +# ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" clean +# Will try it in the unified script + +# For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans +rm -rf $jcaeDir +rm -rf $mypwd/occjavaInstall +git clone $jcaeURL + + #------------------------------------------------- ## Build jCAE projects (vtk-util, occjava, etc) #------------------------------------------------- ## build OccJava -cd jCAE/occjava/ -mkdir build -cd build -cp ../../vtk-util/toolchain-i686-w64-mingw32.cmake . -#cmake -DOCE_DIR=../../oceBuild/lib/oce-0.9.0 .. -cmake -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar -DJAVA_AWT_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include/ -DJAVA_AWT_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jawt.lib -DJAVA_COMPILE:FILEPATH=/usr/bin/javac -DJAVA_INCLUDE_PATH:PATH=$HOME/.wine/drive_c/programs/Java/include -DJAVA_INCLUDE_PATH2:PATH=$HOME/.wine/drive_c/programs/Java/include/win32 -DJAVA_JVM_LIBRARY:FILEPATH=$HOME/.wine/drive_c/programs/Java/lib/jvm.lib -DJAVA_RUNTIME:FILEPATH=$HOME/.wine/drive_c/programs/Java/jre/bin/java.exe -DOCE_DIR=$mypwd/oceWinInstall/cmake/ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-i686-w64-mingw32.cmake -DSWIG_DIR=/usr/bin/ -DSWIG_EXECUTABLE=/usr/bin/swig .. +occjavaDir=$jcaeDir/occjava +occjavaBuildDir=$mypwd/occjavaBuild +occjavaInstallDir=$mypwd/occjavaInstall/ + +mkdir $occjavaBuildDir +cd $occjavaBuildDir + +flags="" +flags="$flags -DSWIG_DIR=/usr/bin/" +flags="$flags -DSWIG_EXECUTABLE=/usr/bin/swig" +flags="$flags -DOCE_DIR=$oceWinInstallDir/cmake/" + +flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" +flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" +flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" +flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" +flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" +flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" +flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" +flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" +flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" +flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + +cmake $flags $occjavaDir make -mkdir ../../../occjavaBuild -cp *.dll* ../../../occjavaBuild/ -cd ../../../ + +mkdir $occjavaInstallDir +cp *.dll* $occjavaInstallDir +cd $mypwd ## building vtk-util -cd jCAE/vtk-util/ +cd $jcaeDir/vtk-util/ mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties ant config ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -cd ../.. +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" +cd $mypwd ## building jcae/occjava -cd jCAE/jcae/occjava +cd $jcaeDir/jcae/occjava mkdir nbproject/private touch nbproject/private/private.properties -cat ../../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd ## building amibe -cd jCAE/amibe +cd $jcaeDir/amibe mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" -f nbbuild.xml jar -cd ../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar +cd $mypwd ## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) -cd jCAE/jcae/vtk-amibe +cd $jcaeDir/jcae/vtk-amibe mkdir nbproject/private touch nbproject/private/private.properties -cat ../../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd ## building vtk-amibe-occ -cd jCAE/vtk-amibe-occ +cd $jcaeDir/vtk-amibe-occ mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/project-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" jar -cd ../.. +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd #------------------------------------------------- ## Build jCAE modules #------------------------------------------------- -cd jCAE/jcae +cd $jcaeDir/jcae modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" for module in $modules do + cd $jcaeDir/jcae cd "$module" - java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../../xsls/module-build-impl.xsl -OUT ./nbproject/build-impl.xml - cd .. + java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml done -cd ../.. + #------------------------------------------------- ## Generate platform.xml. #------------------------------------------------- # This is a now an automated step. -cd jCAE/jcae -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/platform.xsl -OUT ./nbproject/platform.xml +cd $jcaeDir/jcae +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml #------------------------------------------------- ## Build suite as Zip distribution #------------------------------------------------- mkdir nbproject/private touch nbproject/private/private.properties -cat ../../jcae.config > nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties mkdir vtk/nbproject/private cp nbproject/private/private.properties vtk/nbproject/private/ @@ -656,23 +725,10 @@ cp nbproject/private/private.properties vecmath/nbproject/private/ mkdir trove/nbproject/private cp nbproject/private/private.properties trove/nbproject/private/ -echo "path.jre.win32=$HOME/.wine/drive_c/programs/Java/jre/" >> nbproject/private/private.properties - -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL ../../xsls/suite-build-impl.xsl -OUT ./nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$mypwd/nb/" -Dnbplatform.default.harness.dir="$mypwd/nb/harness/" build-zip -cd ../.. +echo "path.jre.win32=$wineJavaDir/jre" >> nbproject/private/private.properties -mv jCAE/jcae/dist jCAE-zipped - -#------------------------------------------------- -## Clean -#------------------------------------------------- - -rm jython*.jar -rm libtrove*.deb -rm libvecmath*.deb -rm vtk-5.6.1.tar.gz -rm -rf VTK -rm -rf oce -rm netbeans-7.1-ml-linux.sh +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip +cd $mypwd +mv $jcaeDir/jcae/dist jCAE-zipped From 6dfdff82fbe8e4470c2e9a0c802243f07962ca24 Mon Sep 17 00:00:00 2001 From: u Date: Sat, 5 May 2012 18:07:28 +0530 Subject: [PATCH 18/49] Single installer script moved to jCAE/scripts --- jCAE-auto-installer.sh => scripts/jCAE-auto-installer.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jCAE-auto-installer.sh => scripts/jCAE-auto-installer.sh (100%) diff --git a/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh similarity index 100% rename from jCAE-auto-installer.sh rename to scripts/jCAE-auto-installer.sh From dd7716680130c62c19cc7ff513ea79fbc5a51645 Mon Sep 17 00:00:00 2001 From: u Date: Sat, 5 May 2012 20:53:45 +0530 Subject: [PATCH 19/49] script/jCAE-auto-installer.sh functional --- scripts/jCAE-auto-installer.sh | 800 ++++++++++++++++++++++++++++++++- 1 file changed, 786 insertions(+), 14 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 2605c9861..1b8981a9b 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -1,5 +1,28 @@ #!/bin/sh +################################################## +## Preliminaries for win32 installation +################################################## + +#In addition to dependencies mentioned in the linux installer, the required packages are: + + +#1. mingw-w64 debian package (http://packages.debian.org/sid/mingw-w64) +# - This will require editing /etc/apt/sources.list +# Steps +# $ sudo echo 'deb http://ftp.de.debian.org/debian sid main' >> /etc/apt/sources.list +# $ sudo apt-get install mingw-w64 +# + +#2. wine 1.2 +# $ sudo apt-get install wine1.2 + +#Some other steps need to be performed before moving ahead +# +#1. sudo gedit /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake +# - This requires to be automated + + ################################################## ## Script Variables ################################################## @@ -16,11 +39,13 @@ black="\033[0m " export targetOS; export makeSpeed; -if [ $1 -eq "linux" ] || [ $1 -eq "windows" ] +echo "$1" +if [ "$1" = "linux" ] || [ "$1" = "windows" ] then targetOS=$1 else - echo "$red$bold\n Please specify the target OS (linux/windows) \n$normal $black" + echo "$red$bold\nPlease specify the target OS (linux/windows) \n$normal $black" + exit 1 fi if [ $2 -eq "" ] @@ -30,14 +55,23 @@ else makeSpeed=$2 fi -# Relative paths simplified +if [ "$1" = "linux" ] && [ "$JAVA_HOME" = "" ] +then + echo "$red$bold\nPlease specify \$JAVA_HOME environment variable \n$normal $black" + exit 1 +fi +startTime=$(date +%s) + +# Relative paths simplified +export mypwd=$PWD ################################################## ## Detect dependencies ################################################## +echo "$green $bold\n Checking for dependencies [ $(date +%s) ]... \n$normal $black" " Time="$(date +%s) export package="" export useDpkg=0 @@ -51,10 +85,10 @@ checkPackage() ret=$(dpkg -l | grep $package) if [ $? -eq 1 ] then - echo "$red$bold\n Not Found $package \n$normal $black" + echo "$red$bold\nNot Found $package \n$normal $black" exit 1 else - echo "$green$bold\n Found $package \n$normal $ret $black" + echo "$green$bold\nFound $package \n$normal $ret $black" fi else #echo "\n version" @@ -66,27 +100,765 @@ checkPackage() echo $ret2 if [ $? -eq 1 ] then - echo "$red $bold\n Not Found $package \n$normal $black" + echo "$red $bold\nNot Found $package \n$normal $black" exit 1 else - echo "$green $bold\n Found $package \n$normal $ret2 $black" + echo "$green $bold\nFound $package \n$normal $ret2 $black" fi else - echo "$green $bold\n Found $package \n$normal $ret $black" + echo "$green $bold\nFound $package \n$normal $ret $black" fi fi } -package="gcc"; useDpkg=0; checkPackage +#package="gcc"; useDpkg=0; checkPackage package="git" ; useDpkg=0; checkPackage package="cmake"; useDpkg=0; checkPackage package="swig"; useDpkg=0; checkPackage -package="mesa-common-dev"; useDpkg=1; checkPackage -package="libxt-dev"; useDpkg=1; checkPackage -package="freeglut3-dev"; useDpkg=1; checkPackage +#package="mesa-common-dev"; useDpkg=1; checkPackage +#package="libxt-dev"; useDpkg=1; checkPackage +#package="freeglut3-dev"; useDpkg=1; checkPackage package="openjdk-6-jdk"; useDpkg=1; checkPackage package="quilt"; useDpkg=0; checkPackage package="ant"; useDpkg=0; checkPackage -package="gcc-mingw-w64-x86-64"; useDpkg=1; checkPackage -package="wine"; useDpkg=0; checkPackage +if [ "$targetOS" = "windows" ] +then + package="gcc-mingw-w64-x86-64"; useDpkg=1; checkPackage + package="wine"; useDpkg=0; checkPackage +fi + +################################################## +## Install JDK 1.7 on wine +################################################## + + +if [ "$targetOS" = "windows" ] +then + wineDir=$mypwd/.wine + wineJavaDir=$wineDir/drive_c/Java + wineJavaUrl="http://www.java.net/download/jdk6/6u32/promoted/b02/binaries/jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" + wineJavaExec="jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" + export WINEPREFIX=$wineDir + + echo "$green $bold\n Wine configuration and JDK installing ... \n$normal $black"" Time="$(date +%s) + # check for $wineDir presence + ret=$(ls "$wineDir") + if [ $? -ne 0 ] + then + mkdir $wineDir + winecfg + fi + + # check for jdk installation + ret=$(find "$wineDir" -iname java.exe) + if [ "$ret" = "" ] + then + # Install jdk + mkdir $wineJavaDir + wget $wineJavaUrl + wine $wineJavaExec /s /v"/qn INSTALLDIR=$wineJavaDir" + echo "$green $bold\nJDK-6 on wine Installed \n$normal $black" " Time="$(date +%s) + else + echo "$green $bold\nJDK-6 on wine already Installed \n$normal $black" + fi +fi + +################################################## +## Get, Patch (from jCAE) and Install VTK +## Get jCAE (installation later) +################################################## + +# Define abs locations + +vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" +vtkTar="vtk-5.6.1.tar.gz" +vtkDir=$mypwd/VTK +vtkLinBuildDir=$mypwd/vtkLinBuild +vtkLinInstallDir=$mypwd/vtkLinInstall + +jcaeURL=https://github.com/jeromerobert/jCAE.git +jcaeDir=$mypwd/jCAE + +# Get vtk-5.6.1, unzip +ret=$(ls $vtkTar) +if [ $? -ne 0 ] +then + wget $vtkURL +fi + +ret=$(ls $vtkDir) +if [ $? -ne 0 ] +then + tar -xf $vtkTar +fi + +# Get jCAE source (so early to get vtk patch) +ret=$(ls $jcaeDir) +if [ $? -ne 0 ] +then + git clone $jcaeURL +fi + +# Apply patch +# TODO: Forcibly applying patches without checking. No damage can +# happen but it would be good to have a way to check to avoid repatching +cd $vtkDir +$jcaeDir/vtk-util/patch/5.6/apply.sh +cd $mypwd + +ret=$(ls $vtkLinBuildDir) +if [ $? -ne 0 ] +then + mkdir $vtkLinBuildDir +fi + +ret=$(find $vtkLinBuildDir -iname vtk.jar) +if [ "$ret" = "" ] +then + echo "$green $bold\n Vtk native building... \n$normal $black"" Time="$(date +%s) + cd $vtkLinBuildDir + flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" + flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" + flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + cmake $flags $vtkDir + make -j$makeSpeed + echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) +else + echo "$green $bold\nVtk already built \n$normal $black" +fi + +cd $mypwd + +if [ "$targetOS" = "linux" ] +then + ret=$(ls $vtkLinInstallDir) + if [ $? -ne 0 ] + then + mkdir $vtkLinInstallDir + fi + + ret=$(find $vtkLinInstallDir -iname vtk.jar) + if [ "$ret" = "" ] + then + echo "$green $bold\nVtk installing... \n$normal $black"" Time="$(date +%s) + cd $vtkLinBuildDir + make install + echo "$green $bold\nVtk Installed successfully\n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nVtk already Installed \n$normal $black" + fi + +fi + +if [ "$targetOS" = "windows" ] +then + vtkWinBuildDir=$mypwd/vtkWinBuild + vtkWinInstallDir=$mypwd/vtkWinInstall + + # Cross build + ret=$(ls $vtkWinBuildDir) + if [ $? -ne 0 ] + then + mkdir $vtkWinBuildDir + fi + + ret=$(find $vtkWinBuildDir -iname vtk.jar) + if [ "$ret" = "" ] + then + echo "$green $bold\nVtk ($targetOS) building... \n$normal $black"" Time="$(date +%s) + cd $vtkWinBuildDir + flags=" -DBUILD_SHARED_LIBS:BOOL=ON" + flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + flags="$flags -DBUILD_TESTING:BOOL=OFF" + flags="$flags -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--kill-at" + flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/bin/javac.exe" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/bin/java.exe" + + flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$vtkWinInstallDir/" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" + flags="$flags -DVTKCompileTools_DIR:FILEPATH=$vtkLinBuildDir" + + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + + cmake $flags $vtkDir + cmake $flags $vtkDir + + make -j$makeSpeed + echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nVtk already built \n$normal $black" + fi + + ret=$(ls $vtkWinInstallDir) + if [ $? -ne 0 ] + then + cd $mypwd + mkdir $vtkWinInstallDir + fi + + ret=$(find $vtkWinInstallDir -iname vtk.jar) + if [ "$ret" = "" ] + then + echo "$green $bold\nVtk installing... \n$normal $black"" Time="$(date +%s) + cd $vtkWinBuildDir + make install + echo "$green $bold\nVtk installed successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nVtk already installed \n$normal $black" + fi +fi + +cd $mypwd + + +################################################## +## Get and Install OCE 0.9.1 +################################################## + +oceURL=https://github.com/tpaviot/oce.git +oceDir=$mypwd/oce + +ret=$(ls $oceDir) +if [ $? -ne 0 ] +then + git clone $oceURL $oceDir +fi + +ret=$(git describe | grep OCE-0.9.1) +if [ $? -ne 0 ] +then + cd $oceDir + git checkout OCE-0.9.1 + cd $mypwd +fi + +if [ "$targetOS" = "linux" ] +then + oceLinBuildDir=$mypwd/oceLinBuild + oceLinInstallDir=$mypwd/oceLinInstall + ret=$(ls $oceLinBuildDir) + if [ $? -ne 0 ] + then + mkdir $oceLinBuildDir + fi + + ret=$(find $oceLinBuildDir -iname *Tk*.so*) + if [ "$ret" = "" ] + then + echo "$green $bold\nOce building... \n$normal $black"" Time="$(date +%s) + cd $oceLinBuildDir + flags="-DOCE_INSTALL_PREFIX:PATH=$oceLinInstallDir" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + cmake $flags $oceDir + cd $mypwd + make -j$makeSpeed + echo "$green $bold\nOce built successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nOce already built \n$normal $black" + fi + + ret=$(ls $oceLinInstallDir) + if [ $? -ne 0 ] + then + mkdir $oceLinInstallDir + fi + + ret=$(find $oceLinInstallDir -iname *Tk*.so*) + if [ "$ret" = "" ] + then + echo "$green $bold\nOce installing... \n$normal $black"" Time="$(date +%s) + cd $oceLinBuildDir + make install + echo "$green $bold\nOce installed successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nOce already installed \n$normal $black" + fi +fi + +if [ "$targetOS" = "windows" ] +then + oceWinBuildDir=$mypwd/oceWinBuild + oceWinInstallDir=$mypwd/oceWinInstall + + ret=$(ls $oceWinBuildDir) + if [ $? -ne 0 ] + then + mkdir $oceWinBuildDir + fi + + ret=$(find $oceWinBuildDir -iname *Tk*.dll) + if [ "$ret" = "" ] + then + echo "$green $bold\nOce building... \n$normal $black"" Time="$(date +%s) + cd $oceWinBuildDir + flags="-DOCE_INSTALL_PREFIX:PATH=$oceWinInstallDir" + flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" + flags="$flags -DOCE_DISABLE_X11=ON" + flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + cmake $flags $oceDir + make -j$makeSpeed + echo "$green $bold\nOce built successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nOce already built \n$normal $black" + fi + + ret=$(ls $oceWinInstallDir) + if [ $? -ne 0 ] + then + mkdir $oceWinInstallDir + fi + + ret=$(find $oceWinInstallDir -iname *Tk*.dll) + if [ "$ret" = "" ] + then + echo "$green $bold\nOce installing... \n$normal $black"" Time="$(date +%s) + cd $oceWinBuildDir + make install + echo "$green $bold\nOce installed successfully \n$normal $black"" Time="$(date +%s) + else + echo "$green $bold\nOce already installed \n$normal $black" + fi +fi + +cd $mypwd + + +################################################## +## PATCH # Copy libgcc_s_sjlj-1.dll libstdc++-6.dll +################################################## + +if [ "$targetOS" = "windows" ] +then + cp $(find /usr/lib/ -path *i686* -iname libstdc++-6.dll -or -iname libgcc_s_sjlj-1.dll ) $oceWinInstallDir/Win32/bin/ +fi + +################################################## +## Get and Install JYTHON +################################################## + +jythonURL=http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar +jythonJar=jython_installer-2.5.2.jar +jythonDir=$mypwd/jython + +echo "$green $bold\nJython installing... \n$normal $black"" Time="$(date +%s) + +ret=$(ls $jythonJar) +if [ $? -ne 0 ] +then + wget $jythonURL +fi + +ret=$(ls $jythonDir) +if [ $? -ne 0 ] +then + java -jar $jythonJar -s -d $jythonDir + echo "$green $bold\nJython installed successfully \n$normal $black"" Time="$(date +%s) +else + echo "$green $bold\nJython already installed \n$normal $black" +fi + + + +################################################## +## Get and Install VECMATH +################################################## +vecmathURL=http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb +vecmathDebian=libvecmath-java_1.5.2-2_all.deb +vecmathDir=$mypwd/vecmath + +echo "$green $bold\nVecmath installing... \n$normal $black"" Time="$(date +%s) + +ret=$(ls $vecmathDebian) +if [ $? -ne 0 ] +then + wget $vecmathURL +fi + +ret=$(ls $vecmathDir) +if [ $? -ne 0 ] +then + dpkg-deb -x $vecmathDebian $vecmathDir + echo "$green $bold\nVecmath installed successfully \n$normal $black"" Time="$(date +%s) +else + echo "$green $bold\nVecmath already installed \n$normal $black" + +fi + + +################################################## +## Get and Install TROVE +################################################## +troveURL=http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb +troveDebian=libtrove-java_2.1.0-2_all.deb +troveDir=$mypwd/trove + +echo "$green $bold\nTrove installing... \n$normal $black"" Time="$(date +%s) + +ret=$(ls $troveDebian) +if [ $? -ne 0 ] +then + wget $troveURL +fi + +ret=$(ls $troveDir) +if [ $? -ne 0 ] +then + dpkg-deb -x $troveDebian $troveDir + echo "$green $bold\nTrove installed successfully \n$normal $black"" Time="$(date +%s) +else + echo "$green $bold\nTrove already installed \n$normal $black" +fi + + +################################################## +## Get and Install Netbeans 7.1 +################################################## +nbURL=http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh +nbEx=netbeans-7.1.1-ml-javase-linux.sh +nbDir=$mypwd/nb + +echo "$green $bold\nNetbeans installing... \n$normal $black"" Time="$(date +%s) + +ret=$(ls $nbEx) +if [ $? -ne 0 ] +then + wget $nbURL + chmod a+x $nbEx +fi + +ret=$(ls $nbDir) +if [ $? -ne 0 ] +then + mkdir $nbDir + ./$nbEx --silent "-J-Dnb-base.installation.location=$nbDir" + echo "$green $bold\nNetbeans installed successfully \n$normal $black"" Time="$(date +%s) +else + echo "$green $bold\nNetbeans already installed \n$normal $black" +fi + + +################################################## +## Get and Install XALAN +## Get XSLs for build-impl.xml creation +################################################## +xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz +xalanDir=$mypwd/xalan-j_2_7_1 + +echo "$green $bold\nXalan installing... \n$normal $black"" Time="$(date +%s) + +ret=$(ls $xalanTar) +if [ $? -ne 0 ] +then + wget $xalanURL +fi + +ret=$(ls $xalanDir) +if [ $? -ne 0 ] +then + tar xf $xalanTar +fi + +export CLASSPATH=$CLASSPATH:$xalanDir/xalan.jar +export CLASSPATH=$CLASSPATH:$xalanDir/serializer.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xercesImpl.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xml-apis.jar +export CLASSPATH=$CLASSPATH:$xalanDir/xsltc.jar + +################ +#XSLS +################ + +echo "$green $bold\nXLS fetching... \n$normal $black"" Time="$(date +%s) + +xslDir=$mypwd/xsls +nbProjectXslURL=http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +nbSuiteXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl +nbModuleXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl +nbPlatformXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl + +ret=$(ls $xslDir) +if [ $? -ne 0 ] +then + mkdir $xslDir +fi + +ret=$(ls -1 $xslDir | wc -l) +if [ "$ret" != "4" ] +then + ret=$(ls $xslDir/project-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbProjectXslURL + mv build-impl.xsl $xslDir/project-build-impl.xsl + fi + + ret=$(ls $xslDir/suite-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbSuiteXslURL + mv build-impl.xsl $xslDir/suite-build-impl.xsl + fi + + ret=$(ls $xslDir/module-build-impl.xsl) + if [ $? -ne 0 ] + then + wget $nbModuleXslURL + mv build-impl.xsl $xslDir/module-build-impl.xsl + fi + + ret=$(ls $xslDir/platform.xsl) + if [ $? -ne 0 ] + then + wget $nbPlatformXslURL + mv platform.xsl $xslDir/platform.xsl + fi +fi + +################################################## +## jCAE INSTALLATION +################################################## + +#------------------------------------------------- +## Set envirmonment variables +#------------------------------------------------- +echo "$green $bold\njCAE build starts... \n$normal $black"" Time="$(date +%s) + +export jythonPath=$(find $jythonDir -iname jython.jar) +export trovePath=$(find $troveDir -iname trove.jar) +export vecmathPath=$(find $vecmathDir -iname vecmath.jar) +export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) + +touch jcae.config +echo "" > jcae.config + +echo "libs.trove.classpath=$trovePath" >> jcae.config +echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config +echo "libs.VTK.classpath=$vtkPath" >> jcae.config + +if [ "$targetOS" = "linux" ] +then + echo "arch.linux=true" >> jcae.config + echo "path.occ.linux=$oceLinInstallDir/lib/" >> jcae.config # TODO: Check here why TK*.so not copied to cluster + echo "path.jython.linux=$jythonDir" >> jcae.config + echo "vtk.dir.linux=$vtkLinInstallDir/lib/vtk-5.6/" >> jcae.config + echo "path.occjava.linux=$mypwd/occjavaInstall/libOccJava.so" >> jcae.config + + ret=$(find /usr/lib/ -iname libstdc++.so | head -1) + echo "path.libstdc++=$ret" >> jcae.config + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceLinInstallDir/lib/ + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkLinInstallDir/lib/vtk-5.6/ +fi + +if [ "$targetOS" = "windows" ] +then + echo "arch.win32=true" >> jcae.config + echo "path.occ.win32=$oceWinInstallDir/Win32/bin/" >> jcae.config + echo "path.jython.win32=$jythonDir" >> jcae.config + echo "vtk.dir.win32=$vtkWinInstallDir/bin/" >> jcae.config + echo "path.occjava.win32=$mypwd/occjavaBuild/OccJava.dll" >> jcae.config + + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceWinInstallDir/Win32/bin/ + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkWinInstallDir/bin/ +fi + + +#------------------------------------------------- +## Clean jCAE and occjava +#------------------------------------------------- +# Cleaning jCAE from any previous wrong built requires +# an extraordinary amount of checking/editing in +# a lot of properties files. +# TODO: One idea would be to run - +# cd $mypwd; +# ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" clean +# Will try it in the unified script + +# For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans +echo "$green $bold\nCleaning previous jCAE(if any)... \n$normal $black"" Time="$(date +%s) +rm -rf $jcaeDir +rm -rf $mypwd/occjavaInstall +git clone $jcaeURL + + +#------------------------------------------------- +## Build jCAE projects (vtk-util, occjava, etc) +#------------------------------------------------- + +echo "$green $bold\nBuilding OccJava... \n$normal $black"" Time="$(date +%s) + +## build OccJava +occjavaDir=$jcaeDir/occjava +occjavaBuildDir=$mypwd/occjavaBuild +occjavaInstallDir=$mypwd/occjavaInstall/ + +mkdir $occjavaBuildDir +rm -rf $occjavaBuildDir/* + +mkdir $occjavaInstallDir +cd $occjavaBuildDir + +if [ "$targetOS" = "linux" ] +then + flags="" + flags="$flags -DSWIG_DIR=/usr/bin/" + flags="$flags -DSWIG_EXECUTABLE=/usr/bin/swig" + flags="$flags -DOCE_DIR=$oceLinInstallDir/lib/oce-0.9.1" + + cmake $flags $occjavaDir + make + cp *.so* $occjavaInstallDir +fi + +if [ "$targetOS" = "windows" ] +then + flags="" + flags="$flags -DSWIG_DIR=/usr/bin/" + flags="$flags -DSWIG_EXECUTABLE=/usr/bin/swig" + flags="$flags -DOCE_DIR=$oceWinInstallDir/cmake/" + + flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" + flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" + flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" + flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" + flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" + flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" + flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" + flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" + flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" + + cmake $flags $occjavaDir + make + cp *.dll* $occjavaInstallDir +fi + +## building vtk-util +echo "$green $bold\nBuilding vtk-util... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/vtk-util/ +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties +ant config +ant clean +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" +cd $mypwd + +## building jcae/occjava +echo "$green $bold\nBuilding jcae/occjava... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/jcae/occjava +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd + +## building amibe +echo "$green $bold\nBuilding amibe... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar +cd $mypwd + +## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) +echo "$green $bold\nBuilding vtk-amibe... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/jcae/vtk-amibe +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd + +## building vtk-amibe-occ +echo "$green $bold\nBuilding vtk-amibe-occ... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/vtk-amibe-occ +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config >> nbproject/private/private.properties +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +cd $mypwd + +#------------------------------------------------- +## Build jCAE modules +#------------------------------------------------- + +echo "$green $bold\nGenerating buildfiles for jCAE modules... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/jcae + +modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" +for module in $modules +do + cd $jcaeDir/jcae/"$module" + java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml +done + + +#------------------------------------------------- +## Generate platform.xml. +#------------------------------------------------- + +# This is a now an automated step. +echo "$green $bold\nGenerating platform.xml for jCAE... \n$normal $black"" Time="$(date +%s) +cd $jcaeDir/jcae +java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml + +#------------------------------------------------- +## Build suite as Zip distribution +#------------------------------------------------- +echo "$green $bold\nBuilding jCAE suite... \n$normal $black"" Time="$(date +%s) +mkdir nbproject/private +touch nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties + +mkdir vtk/nbproject/private +cp nbproject/private/private.properties vtk/nbproject/private/ + +mkdir vecmath/nbproject/private +cp nbproject/private/private.properties vecmath/nbproject/private/ + +mkdir trove/nbproject/private +cp nbproject/private/private.properties trove/nbproject/private/ + +if [ "$targetOS" = "linux" ] +then + echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties +elif [ "$targetOS" = "windows" ] +then + echo "path.jre.win32=$wineJavaDir/jre" >> nbproject/private/private.properties +fi + +java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml +ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip +echo "$green $bold\njCAE built successfully \n$normal $black"" Time="$(date +%s) +cd $mypwd + +rm jCAE-zipped/* +mv $jcaeDir/jcae/dist/* jCAE-zipped/ +echo "$green $bold\njCAE Zipped successfully in $mypwd/jCAE-zipped \n$normal $black"" Time="$(date +%s) From 5e42e15167210a5cf092cd57de06b3f582f247f9 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 12:33:33 +0530 Subject: [PATCH 20/49] openjdk-7 supported. Issue #217 --- scripts/jCAE-auto-installer.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 1b8981a9b..98684dd04 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -83,7 +83,7 @@ checkPackage() then #echo "\n dpkg" ret=$(dpkg -l | grep $package) - if [ $? -eq 1 ] + if [ $? -ne 0 ] then echo "$red$bold\nNot Found $package \n$normal $black" exit 1 @@ -93,12 +93,12 @@ checkPackage() else #echo "\n version" ret=$($package --version ) - if [ $? -eq 1 ] + if [ $? -ne 0 ] then echo "--version failed" ret2=$($package -version) echo $ret2 - if [ $? -eq 1 ] + if [ $? -ne 0 ] then echo "$red $bold\nNot Found $package \n$normal $black" exit 1 @@ -118,7 +118,7 @@ package="swig"; useDpkg=0; checkPackage #package="mesa-common-dev"; useDpkg=1; checkPackage #package="libxt-dev"; useDpkg=1; checkPackage #package="freeglut3-dev"; useDpkg=1; checkPackage -package="openjdk-6-jdk"; useDpkg=1; checkPackage +package="openjdk-7-jdk"; useDpkg=1; checkPackage package="quilt"; useDpkg=0; checkPackage package="ant"; useDpkg=0; checkPackage @@ -222,7 +222,7 @@ then flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" cmake $flags $vtkDir - make -j$makeSpeed + VERBOSE=1 make -j$makeSpeed echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) else echo "$green $bold\nVtk already built \n$normal $black" @@ -291,7 +291,7 @@ then cmake $flags $vtkDir cmake $flags $vtkDir - make -j$makeSpeed + VERBOSE=1 make -j$makeSpeed echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) else echo "$green $bold\nVtk already built \n$normal $black" From 2d40ce0ccb9bcc01ec805077b4ef4e419b1fb41e Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 12:37:15 +0530 Subject: [PATCH 21/49] Patched for 64-bit host and 32 bit cross compiler - g**-mingw-w64-1686. Issue #217 --- scripts/jCAE-auto-installer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 98684dd04..9f5443fb2 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -124,7 +124,8 @@ package="ant"; useDpkg=0; checkPackage if [ "$targetOS" = "windows" ] then - package="gcc-mingw-w64-x86-64"; useDpkg=1; checkPackage + package="gcc-mingw-w64-i686"; useDpkg=1; checkPackage + package="g++-mingw-w64-i686"; useDpkg=1; checkPackage package="wine"; useDpkg=0; checkPackage fi From 8e70e90c10b269de3740fbaded18f19bc1c9f85a Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 15:03:39 +0530 Subject: [PATCH 22/49] Updated prelims notes for dependent packages - g**-mingw-w64-1686. Issue #216/217 --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 9f5443fb2..e1ae4ffed 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -11,7 +11,7 @@ # - This will require editing /etc/apt/sources.list # Steps # $ sudo echo 'deb http://ftp.de.debian.org/debian sid main' >> /etc/apt/sources.list -# $ sudo apt-get install mingw-w64 +# $ sudo apt-get install mingw-w64 gcc-mingw-w64-i686 g++-mingw-w64-i686 # #2. wine 1.2 From 9e3e1887fc776172155de95e79bd029b4278ce74 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 19:34:45 +0530 Subject: [PATCH 23/49] Issue#218 - Compatibility with VTK 5.10 Fixed --- scripts/jCAE-auto-installer.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index e1ae4ffed..48313d222 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -172,16 +172,16 @@ fi # Define abs locations -vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" -vtkTar="vtk-5.6.1.tar.gz" -vtkDir=$mypwd/VTK +vtkURL="http://www.vtk.org/files/release/5.10/vtk-5.10.0-rc3.tar.gz" +vtkTar="vtk-5.10.0-rc3.tar.gz" +vtkDir=$mypwd/VTK5.10.0.RC3 vtkLinBuildDir=$mypwd/vtkLinBuild vtkLinInstallDir=$mypwd/vtkLinInstall jcaeURL=https://github.com/jeromerobert/jCAE.git jcaeDir=$mypwd/jCAE -# Get vtk-5.6.1, unzip +# Get vtk-5.10.0, unzip ret=$(ls $vtkTar) if [ $? -ne 0 ] then @@ -195,17 +195,17 @@ then fi # Get jCAE source (so early to get vtk patch) -ret=$(ls $jcaeDir) -if [ $? -ne 0 ] -then - git clone $jcaeURL -fi +#ret=$(ls $jcaeDir) +#if [ $? -ne 0 ] +#then +# git clone $jcaeURL +#fi # Apply patch # TODO: Forcibly applying patches without checking. No damage can # happen but it would be good to have a way to check to avoid repatching -cd $vtkDir -$jcaeDir/vtk-util/patch/5.6/apply.sh +#cd $vtkDir +#$jcaeDir/vtk-util/patch/5.6/apply.sh cd $mypwd ret=$(ls $vtkLinBuildDir) @@ -286,12 +286,13 @@ then flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$vtkWinInstallDir/" flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" flags="$flags -DVTKCompileTools_DIR:FILEPATH=$vtkLinBuildDir" + flags="$flags -DVTK_USE_64BIT_IDS:BOOL=ON" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" cmake $flags $vtkDir cmake $flags $vtkDir - + set -e VERBOSE=1 make -j$makeSpeed echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) else @@ -662,14 +663,14 @@ then echo "arch.linux=true" >> jcae.config echo "path.occ.linux=$oceLinInstallDir/lib/" >> jcae.config # TODO: Check here why TK*.so not copied to cluster echo "path.jython.linux=$jythonDir" >> jcae.config - echo "vtk.dir.linux=$vtkLinInstallDir/lib/vtk-5.6/" >> jcae.config + echo "vtk.dir.linux=$vtkLinInstallDir/lib/vtk-5.10/" >> jcae.config echo "path.occjava.linux=$mypwd/occjavaInstall/libOccJava.so" >> jcae.config ret=$(find /usr/lib/ -iname libstdc++.so | head -1) echo "path.libstdc++=$ret" >> jcae.config export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceLinInstallDir/lib/ - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkLinInstallDir/lib/vtk-5.6/ + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkLinInstallDir/lib/vtk-5.10/ fi if [ "$targetOS" = "windows" ] From 8e6dad72bc163dfa5a69edd1f653451119942bd0 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 19:54:29 +0530 Subject: [PATCH 24/49] Small fix to prevent cloning jCAE again #Issue216 --- scripts/jCAE-auto-installer.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 48313d222..fb655bc1b 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -698,10 +698,10 @@ fi # Will try it in the unified script # For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans -echo "$green $bold\nCleaning previous jCAE(if any)... \n$normal $black"" Time="$(date +%s) -rm -rf $jcaeDir +#echo "$green $bold\nCleaning previous jCAE(if any)... \n$normal $black"" Time="$(date +%s) +#rm -rf $jcaeDir rm -rf $mypwd/occjavaInstall -git clone $jcaeURL +#git clone $jcaeURL #------------------------------------------------- @@ -761,7 +761,7 @@ echo "$green $bold\nBuilding vtk-util... \n$normal $black"" Time="$(date +%s) cd $jcaeDir/vtk-util/ mkdir nbproject/private touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties ant config ant clean ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" @@ -772,7 +772,7 @@ echo "$green $bold\nBuilding jcae/occjava... \n$normal $black"" Time="$(date +%s cd $jcaeDir/jcae/occjava mkdir nbproject/private touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd @@ -782,7 +782,7 @@ echo "$green $bold\nBuilding amibe... \n$normal $black"" Time="$(date +%s) cd $jcaeDir/amibe mkdir nbproject/private touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar cd $mypwd @@ -792,7 +792,7 @@ echo "$green $bold\nBuilding vtk-amibe... \n$normal $black"" Time="$(date +%s) cd $jcaeDir/jcae/vtk-amibe mkdir nbproject/private touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd @@ -802,7 +802,7 @@ echo "$green $bold\nBuilding vtk-amibe-occ... \n$normal $black"" Time="$(date +% cd $jcaeDir/vtk-amibe-occ mkdir nbproject/private touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties +cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd From 090781f73f1a90cdbeedc4bc431521334b42153d Mon Sep 17 00:00:00 2001 From: u Date: Mon, 7 May 2012 19:58:52 +0530 Subject: [PATCH 25/49] Small fix - Section where zip-distro is copied to ~/jCAE-zipped #Issue216 --- scripts/jCAE-auto-installer.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index fb655bc1b..9b3a6a67c 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -861,6 +861,14 @@ ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness echo "$green $bold\njCAE built successfully \n$normal $black"" Time="$(date +%s) cd $mypwd +#------------------------------------------------- +## Copy Zip distro to jCAE-zipped +#------------------------------------------------- +ret=$(ls jCAE-zipped) +if [ $? -ne 0 ] +then + mkdir jCAE-zipped +fi rm jCAE-zipped/* mv $jcaeDir/jcae/dist/* jCAE-zipped/ echo "$green $bold\njCAE Zipped successfully in $mypwd/jCAE-zipped \n$normal $black"" Time="$(date +%s) From 6bacf3d798803170aaebc3211df14a8823885ac9 Mon Sep 17 00:00:00 2001 From: u Date: Thu, 24 May 2012 11:26:02 +0530 Subject: [PATCH 26/49] Xalan link replace, old one is dead now --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 9b3a6a67c..4a0a1d098 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -563,7 +563,7 @@ fi ## Get and Install XALAN ## Get XSLs for build-impl.xml creation ################################################## -xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz +xalanURL=http://apache.multidist.com/xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz xalanDir=$mypwd/xalan-j_2_7_1 From 1667af8b399fb15040f8ce5e1ebff92d456a2f65 Mon Sep 17 00:00:00 2001 From: u Date: Thu, 24 May 2012 11:28:45 +0530 Subject: [PATCH 27/49] vtk and oce build with versionless libraries --- scripts/jCAE-auto-installer.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 4a0a1d098..a2a940d55 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -222,6 +222,8 @@ then flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" + flags="$flags -DVTK_NO_LIBRARY_VERSION:BOOL=ON" + flags="$flags -DCMAKE_SKIP_RPATH:BOOL=YES" cmake $flags $vtkDir VERBOSE=1 make -j$makeSpeed echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) @@ -361,6 +363,7 @@ then flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" flags="$flags -DOCE_DISABLE_X11=ON" + flags="$flags -DOCE_NO_LIBRARY_VERSION:BOOL=ON" cmake $flags $oceDir cd $mypwd make -j$makeSpeed From 3cbb3a40b89eaa1af57bd9d832773d6e150c259f Mon Sep 17 00:00:00 2001 From: u Date: Thu, 24 May 2012 11:32:31 +0530 Subject: [PATCH 28/49] copying libstdc++.so.6 instead of libstdc++.so --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index a2a940d55..c126090ac 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -669,7 +669,7 @@ then echo "vtk.dir.linux=$vtkLinInstallDir/lib/vtk-5.10/" >> jcae.config echo "path.occjava.linux=$mypwd/occjavaInstall/libOccJava.so" >> jcae.config - ret=$(find /usr/lib/ -iname libstdc++.so | head -1) + ret=$(find /usr/lib/ -iname libstdc++.so.6 | head -1) echo "path.libstdc++=$ret" >> jcae.config export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceLinInstallDir/lib/ From db6b5db0af2a2d2d930a8453c9df45c407e31ad4 Mon Sep 17 00:00:00 2001 From: u Date: Thu, 24 May 2012 12:04:16 +0530 Subject: [PATCH 29/49] Version number appended in Zip name --- scripts/jCAE-auto-installer.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index c126090ac..fed383487 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -195,11 +195,15 @@ then fi # Get jCAE source (so early to get vtk patch) -#ret=$(ls $jcaeDir) -#if [ $? -ne 0 ] -#then -# git clone $jcaeURL -#fi +ret=$(ls $jcaeDir) +if [ $? -ne 0 ] +then + git clone $jcaeURL +fi + +cd $jcaeDir +export jcaeTagName=$(git describe --tags) + # Apply patch # TODO: Forcibly applying patches without checking. No damage can @@ -657,6 +661,7 @@ export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) touch jcae.config echo "" > jcae.config +echo "app.version=$jcaeTagName" >> jcae.config echo "libs.trove.classpath=$trovePath" >> jcae.config echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config echo "libs.VTK.classpath=$vtkPath" >> jcae.config From a400dd270701764509da19dca32b770d9872922f Mon Sep 17 00:00:00 2001 From: u Date: Tue, 29 May 2012 10:58:34 +0530 Subject: [PATCH 30/49] Issue #233 - Including LSDyna.dll --- jcae/vtk/build.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/jcae/vtk/build.xml b/jcae/vtk/build.xml index 0c3a18c15..f92e94a0c 100644 --- a/jcae/vtk/build.xml +++ b/jcae/vtk/build.xml @@ -15,6 +15,7 @@ + From e856eae87c3653151664eb007e0cda2719906c34 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 29 May 2012 14:10:30 +0530 Subject: [PATCH 31/49] Issue#219 - OracleJDK-7 support tested. --- scripts/jCAE-auto-installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index fed383487..ec877b703 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -138,8 +138,8 @@ if [ "$targetOS" = "windows" ] then wineDir=$mypwd/.wine wineJavaDir=$wineDir/drive_c/Java - wineJavaUrl="http://www.java.net/download/jdk6/6u32/promoted/b02/binaries/jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" - wineJavaExec="jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" + wineJavaUrl="http://download.java.net/jdk7u6/archive/b07/binaries/jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" + wineJavaExec="jdk-7u6-ea-bin-b07-windows-i586-23_apr_2012.exe" export WINEPREFIX=$wineDir echo "$green $bold\n Wine configuration and JDK installing ... \n$normal $black"" Time="$(date +%s) From 58a2f6e00a9a0569d9238639aae75226033bd563 Mon Sep 17 00:00:00 2001 From: u Date: Sat, 2 Jun 2012 15:09:57 +0530 Subject: [PATCH 32/49] Bug #236 fixed --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index ec877b703..2c836ca4a 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -298,7 +298,7 @@ then cmake $flags $vtkDir cmake $flags $vtkDir - set -e + VERBOSE=1 make -j$makeSpeed echo "$green $bold\nVtk built successfully \n$normal $black"" Time="$(date +%s) else From 768514c241a502753fb929165bf2848b155b82a4 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 14:14:16 +0530 Subject: [PATCH 33/49] If condition corrected --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 2c836ca4a..cd0da1ec4 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -48,7 +48,7 @@ else exit 1 fi -if [ $2 -eq "" ] +if [ "$2" -eq "" ] then makeSpeed="2" else From 2011d2d7b87d87a10a2ffef285f7c16af6c30d2d Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 14:32:49 +0530 Subject: [PATCH 34/49] wine popup avoided --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index cd0da1ec4..d6aa684a9 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -148,7 +148,7 @@ then if [ $? -ne 0 ] then mkdir $wineDir - winecfg + wine cmd /C rem fi # check for jdk installation From 882f69e8a9fbb6a9fe5c2e0d977febb90c8472c2 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 15:11:51 +0530 Subject: [PATCH 35/49] String matching in if conditions fixed --- scripts/jCAE-auto-installer.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index d6aa684a9..821798d7f 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -48,14 +48,14 @@ else exit 1 fi -if [ "$2" -eq "" ] +if [ x$2 = x ] then makeSpeed="2" else makeSpeed=$2 fi -if [ "$1" = "linux" ] && [ "$JAVA_HOME" = "" ] +if [ "$1" = "linux" ] && [ x$JAVA_HOME = x ] then echo "$red$bold\nPlease specify \$JAVA_HOME environment variable \n$normal $black" exit 1 @@ -153,7 +153,7 @@ then # check for jdk installation ret=$(find "$wineDir" -iname java.exe) - if [ "$ret" = "" ] + if [ x$ret = x ] then # Install jdk mkdir $wineJavaDir @@ -219,7 +219,7 @@ then fi ret=$(find $vtkLinBuildDir -iname vtk.jar) -if [ "$ret" = "" ] +if [ x$ret = x ] then echo "$green $bold\n Vtk native building... \n$normal $black"" Time="$(date +%s) cd $vtkLinBuildDir @@ -246,7 +246,7 @@ then fi ret=$(find $vtkLinInstallDir -iname vtk.jar) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nVtk installing... \n$normal $black"" Time="$(date +%s) cd $vtkLinBuildDir @@ -271,7 +271,7 @@ then fi ret=$(find $vtkWinBuildDir -iname vtk.jar) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nVtk ($targetOS) building... \n$normal $black"" Time="$(date +%s) cd $vtkWinBuildDir @@ -313,7 +313,7 @@ then fi ret=$(find $vtkWinInstallDir -iname vtk.jar) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nVtk installing... \n$normal $black"" Time="$(date +%s) cd $vtkWinBuildDir @@ -359,7 +359,7 @@ then fi ret=$(find $oceLinBuildDir -iname *Tk*.so*) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nOce building... \n$normal $black"" Time="$(date +%s) cd $oceLinBuildDir @@ -383,7 +383,7 @@ then fi ret=$(find $oceLinInstallDir -iname *Tk*.so*) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nOce installing... \n$normal $black"" Time="$(date +%s) cd $oceLinBuildDir @@ -406,7 +406,7 @@ then fi ret=$(find $oceWinBuildDir -iname *Tk*.dll) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nOce building... \n$normal $black"" Time="$(date +%s) cd $oceWinBuildDir @@ -438,7 +438,7 @@ then fi ret=$(find $oceWinInstallDir -iname *Tk*.dll) - if [ "$ret" = "" ] + if [ x$ret = x ] then echo "$green $bold\nOce installing... \n$normal $black"" Time="$(date +%s) cd $oceWinBuildDir From 281529428e475eb33b37dde11d59098aeb1d0484 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 15:36:47 +0530 Subject: [PATCH 36/49] checkPackage method fixed --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 821798d7f..8d83e6b5c 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -97,7 +97,7 @@ checkPackage() then echo "--version failed" ret2=$($package -version) - echo $ret2 + #echo $ret2 if [ $? -ne 0 ] then echo "$red $bold\nNot Found $package \n$normal $black" From b3dbfa02d7aef34deb1649d8bd71cffe8d690209 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 15:37:41 +0530 Subject: [PATCH 37/49] Quilt not required anymore --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 8d83e6b5c..8c09a3c01 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -119,7 +119,7 @@ package="swig"; useDpkg=0; checkPackage #package="libxt-dev"; useDpkg=1; checkPackage #package="freeglut3-dev"; useDpkg=1; checkPackage package="openjdk-7-jdk"; useDpkg=1; checkPackage -package="quilt"; useDpkg=0; checkPackage +#package="quilt"; useDpkg=0; checkPackage package="ant"; useDpkg=0; checkPackage if [ "$targetOS" = "windows" ] From 9c50dd92a9142714a1e5d235c77160fdc5705eff Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 15:41:04 +0530 Subject: [PATCH 38/49] check for gcc prerequisite added --- scripts/jCAE-auto-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 8c09a3c01..e1017d6c0 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -111,7 +111,7 @@ checkPackage() fi } -#package="gcc"; useDpkg=0; checkPackage +package="gcc"; useDpkg=0; checkPackage package="git" ; useDpkg=0; checkPackage package="cmake"; useDpkg=0; checkPackage package="swig"; useDpkg=0; checkPackage From e8cf9c690335600cea31b66778ea367c21e7f171 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 16:00:50 +0530 Subject: [PATCH 39/49] Removed obsolete installer scripts --- scripts/jCAE-auto-installer-linux.sh | 580 ------------------- scripts/jCAE-auto-installer-windows.sh | 734 ------------------------- 2 files changed, 1314 deletions(-) delete mode 100755 scripts/jCAE-auto-installer-linux.sh delete mode 100755 scripts/jCAE-auto-installer-windows.sh diff --git a/scripts/jCAE-auto-installer-linux.sh b/scripts/jCAE-auto-installer-linux.sh deleted file mode 100755 index f456ad208..000000000 --- a/scripts/jCAE-auto-installer-linux.sh +++ /dev/null @@ -1,580 +0,0 @@ -#!/bin/sh - -################################################## -## Script Variables -################################################## - -# Installer command line arguments -export makeSpeed; - -# TODO: check for supplied args -if [ "$1" = "" ] -then - makeSpeed="2" -else - makeSpeed=$1 -fi - -# location variables -export mypwd=$PWD - -################################################## -## Detect dependencies -################################################## -# This does not take care of version numbers. - -# Step 1: Check for gcc -#echo "Looking for GCC" -#GCC_V=$(gcc --version | grep gcc) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "gcc Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $GCC_V "\033[0m" -#fi - -# Step 2: Check for git -echo "Looking for GIT" -GIT_V=$(git --version | grep git) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "git Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $GIT_V "\033[0m" -fi - -# Step 3: Check for cmake -echo "Looking for CMAKE" -CMAKE_V=$(cmake --version | grep cmake) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "cmake Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $CMAKE_V "\033[0m" -fi - -# Step 4: Check for swig -echo "Looking for SWIG" -SWIG_V=$(swig -version | grep SWIG) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "swig Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $SWIG_V "\033[0m" -fi - -# Step 5: Check for mesa-common-dev -#echo "Looking for mesa-common-dev" -#MCD_V=$(dpkg -l | grep mesa-common-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $MCD_V "\033[0m" -#fi - -# Step 6: Check for libxt-dev -#echo "Looking for libxt-dev" -#LIBXT_V=$(dpkg -l | grep libxt-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "libxt-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $LIBXT_V "\033[0m" -#fi - -# Step 7: Check for freeglut3-dev -#echo "Looking for freeglut3-dev" -#LIBFG3_V=$(dpkg -l | grep freeglut3-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $LIBFG3_V "\033[0m" -#fi - -# Step 8: Check for openjdk-6-jdk -echo "Looking for openjdk-6-jdk" -LIBJDK_V=$(dpkg -l | grep openjdk-6-jdk) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "openjdk-6-jdk Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBJDK_V "\033[0m" -fi - -# Step 9: Check for quilt -echo "Looking for quilt" -LIBQLT_V=$(quilt --version) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "quilt Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBQLT_V "\033[0m" -fi - -# Step 10: Check for ant -echo "Looking for ant" -LIBANT_V=$(ant -version) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "ant Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBANT_V "\033[0m" -fi - - -################################################## -## Get, Patch (from jCAE) and Install VTK -## Get jCAE (installation later) -################################################## - -# Define abs locations - -vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" -vtkTar="vtk-5.6.1.tar.gz" -vtkDir=$mypwd/VTK -vtkLinBuildDir=$mypwd/vtkLinBuild -vtkLinInstallDir=$mypwd/vtkLinInstall - -jcaeURL=https://github.com/jeromerobert/jCAE.git -jcaeDir=$mypwd/jCAE - -# Get vtk-5.6.1, unzip -ret=$(ls $vtkTar) -if [ $? -ne 0 ] -then - wget $vtkURL -fi - -ret=$(ls $vtkDir) -if [ $? -ne 0 ] -then - tar -xf $vtkTar -fi - -# Get jCAE source (so early to get vtk patch) -ret=$(ls $jcaeDir) -if [ $? -ne 0 ] -then - git clone $jcaeURL -fi - -# Apply patch -cd $vtkDir -$jcaeDir/vtk-util/patch/5.6/apply.sh -cd $mypwd - -ret=$(ls $vtkLinBuildDir) -if [ $? -ne 0 ] -then - mkdir $vtkLinBuildDir -fi - -ret=$(find $vtkLinBuildDir -iname vtk.jar) -if [ "$ret" = "" ] -then - cd $vtkLinBuildDir - flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" - flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" - flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" - cmake $flags $vtkDir - make -j$makeSpeed -fi -cd $mypwd - -ret=$(ls $vtkLinInstallDir) -if [ $? -ne 0 ] -then - mkdir $vtkLinInstallDir -fi - -ret=$(find $vtkLinInstallDir -iname vtk.jar) -if [ "$ret" = "" ] -then - cd $vtkLinBuildDir - make install -fi - -cd $mypwd - -################################################## -## Get and Install OCE 0.9.1 -################################################## - -oceURL=https://github.com/tpaviot/oce.git -oceDir=$mypwd/oce -oceLinBuildDir=$mypwd/oceLinBuild -oceLinInstallDir=$mypwd/oceLinInstall - -cd $mypwd -echo -e "\033[32m Fetching oce from Github \033[0m" -ret=$(ls $oceDir) -if [ $? -ne 0 ] -then - git clone $oceURL $oceDir -fi - -cd $oceDir -git checkout OCE-0.9.1 -cd $mypwd - -ret=$(ls $oceLinBuildDir) -if [ $? -ne 0 ] -then - mkdir $oceLinBuildDir -fi - -ret=$(find $oceLinBuildDir -iname *Tk*.so*) -if [ "$ret" = "" ] -then - cd $oceLinBuildDir - flags="-DOCE_INSTALL_PREFIX:PATH=$oceLinInstallDir" - flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" - flags="$flags -DOCE_DISABLE_X11=ON" - cmake $flags $oceDir - cd $mypwd - make -j$makeSpeed -fi - -ret=$(ls $oceLinInstallDir) -if [ $? -ne 0 ] -then - mkdir $oceLinInstallDir -fi - -ret=$(find $oceLinInstallDir -iname *Tk*.so*) -if [ "$ret" = "" ] -then - cd $oceLinBuildDir - make install -fi - -cd $mypwd - - -################################################## -## Get and Install JYTHON -################################################## - -jythonURL=http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar -jythonJar=jython_installer-2.5.2.jar -jythonDir=$mypwd/jython - -ret=$(ls $jythonJar) -if [ $? -ne 0 ] -then - wget $jythonURL -fi - -ret=$(ls $jythonDir) -if [ $? -ne 0 ] -then - java -jar $jythonJar -s -d $jythonDir -fi - - -################################################## -## Get and Install VECMATH -################################################## -vecmathURL=http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb -vecmathDebian=libvecmath-java_1.5.2-2_all.deb -vecmathDir=$mypwd/vecmath - -ret=$(ls $vecmathDebian) -if [ $? -ne 0 ] -then - wget $vecmathURL -fi - -ret=$(ls $vecmathDir) -if [ $? -ne 0 ] -then - dpkg-deb -x $vecmathDebian $vecmathDir -fi - - -################################################## -## Get and Install TROVE -################################################## -troveURL=http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb -troveDebian=libtrove-java_2.1.0-2_all.deb -troveDir=$mypwd/trove -ret=$(ls $troveDebian) -if [ $? -ne 0 ] -then - wget $troveURL -fi - -ret=$(ls $troveDir) -if [ $? -ne 0 ] -then - dpkg-deb -x $troveDebian $troveDir -fi - - -################################################## -## Get and Install Netbeans 7.1 -################################################## -nbURL=http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh -nbEx=netbeans-7.1.1-ml-javase-linux.sh -nbDir=$mypwd/nb - -ret=$(ls $nbEx) -if [ $? -ne 0 ] -then - wget $nbURL - chmod a+x $nbEx -fi - -ret=$(ls $nbDir) -if [ $? -ne 0 ] -then - mkdir $nbDir - ./$nbEx --silent "-J-Dnb-base.installation.location=$nbDir" -fi - - -################################################## -## Get and Install XALAN -## Get XSLs for build-impl.xml creation -################################################## -xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz -xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz -xalanDir=$mypwd/xalan-j_2_7_1 - -ret=$(ls $xalanTar) -if [ $? -ne 0 ] -then - wget $xalanURL -fi - -ret=$(ls $xalanDir) -if [ $? -ne 0 ] -then - tar xf $xalanTar -fi - -export CLASSPATH=$CLASSPATH:$xalanDir/xalan.jar -export CLASSPATH=$CLASSPATH:$xalanDir/serializer.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xercesImpl.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xml-apis.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xsltc.jar - -################ -#XSLS -################ -xslDir=$mypwd/xsls -nbProjectXslURL=http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl -nbSuiteXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl -nbModuleXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl -nbPlatformXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl - -ret=$(ls $xslDir) -if [ $? -ne 0 ] -then - mkdir $xslDir -fi - -ret=$(ls -1 $xslDir | wc -l) -if [ "$ret" != "4" ] -then - ret=$(ls $xslDir/project-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbProjectXslURL - mv build-impl.xsl $xslDir/project-build-impl.xsl - fi - - ret=$(ls $xslDir/suite-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbSuiteXslURL - mv build-impl.xsl $xslDir/suite-build-impl.xsl - fi - - ret=$(ls $xslDir/module-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbModuleXslURL - mv build-impl.xsl $xslDir/module-build-impl.xsl - fi - - ret=$(ls $xslDir/platform.xsl) - if [ $? -ne 0 ] - then - wget $nbPlatformXslURL - mv platform.xsl $xslDir/platform.xsl - fi -fi - - -################################################## -## jCAE INSTALLATION -################################################## - -#------------------------------------------------- -## Set envirmonment variables -#------------------------------------------------- - -export jythonPath=$(find $jythonDir -iname jython.jar) -export trovePath=$(find $troveDir -iname trove.jar) -export vecmathPath=$(find $vecmathDir -iname vecmath.jar) -export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) - -touch jcae.config -echo "" > jcae.config - -echo "libs.trove.classpath=$trovePath" >> jcae.config -echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config -echo "libs.VTK.classpath=$vtkPath" >> jcae.config - -echo "arch.linux=true" >> jcae.config -echo "path.occ.linux=$oceLinBuildDir" >> jcae.config -echo "path.jython.linux=$jythonDir" >> jcae.config -echo "vtk.dir.linux=$vtkLinBuildDir" >> jcae.config -echo "path.occjava.linux=$mypwd/occjavaInstall/libOccJava.so" >> jcae.config - -ret=$(find /usr/lib/ -iname libstdc++.so | head -1) -echo "path.libstdc++=$ret" >> jcae.config - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$oceLinBuild/lib/ -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$vtkLinBuild/lib/vtk-5.6/ - -#------------------------------------------------- -## Clean jCAE and occjava -#------------------------------------------------- -# Cleaning jCAE from any previous wrong built requires -# an extraordinary amount of checking/editing in -# a lot of properties files. -# TODO: One idea would be to run - -# cd $mypwd; -# ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" clean -# Will try it in the unified script - -# For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans -rm -rf $jcaeDir -rm -rf $mypwd/occjavaInstall -git clone $jcaeURL - -#------------------------------------------------- -## Build jCAE projects (vtk-util, occjava, etc) -#------------------------------------------------- - -## build OccJava -occjavaDir=$jcaeDir/occjava -occjavaBuildDir=$jcaeDir/occjava/build -occjavaInstallDir=$mypwd/occjavaInstall/ -cd $jcaeDir/occjava/ -mkdir $occjavaBuildDir -cd $occjavaBuildDir -cmake -DOCE_DIR=$oceLinInstallDir/lib/oce-0.9.1 $occjavaDir -make -mkdir $occjavaInstallDir -cp *.so* $occjavaInstallDir -cd $mypwd - -## building vtk-util -cd $jcaeDir/vtk-util/ -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -ant config -ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -cd $mypwd - -## building jcae/occjava -cd $jcaeDir/jcae/occjava -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -## building amibe -cd $jcaeDir/amibe -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar -cd $mypwd - -## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) -cd $jcaeDir/jcae/vtk-amibe -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -## building vtk-amibe-occ -cd $jcaeDir/vtk-amibe-occ -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -#------------------------------------------------- -## Build jCAE modules -#------------------------------------------------- - -cd $jcaeDir/jcae - -modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" -for module in $modules -do - cd $jcaeDir/jcae - cd "$module" - java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml -done - - -#------------------------------------------------- -## Generate platform.xml. -#------------------------------------------------- - -# This is a now an automated step. -cd $jcaeDir/jcae -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml - -#------------------------------------------------- -## Build suite as Zip distribution -#------------------------------------------------- -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config > nbproject/private/private.properties - -mkdir vtk/nbproject/private -cp nbproject/private/private.properties vtk/nbproject/private/ - -mkdir vecmath/nbproject/private -cp nbproject/private/private.properties vecmath/nbproject/private/ - -mkdir trove/nbproject/private -cp nbproject/private/private.properties trove/nbproject/private/ - -echo "path.jre.linux=$JAVA_HOME/jre" >> nbproject/private/private.properties - -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip -cd $mypwd - -mv $jcaeDir/jcae/dist jCAE-zipped - diff --git a/scripts/jCAE-auto-installer-windows.sh b/scripts/jCAE-auto-installer-windows.sh deleted file mode 100755 index 27bd950c4..000000000 --- a/scripts/jCAE-auto-installer-windows.sh +++ /dev/null @@ -1,734 +0,0 @@ -#!/bin/sh - -################################################## -## Preliminaries -################################################## - -#In addition to dependencies mentioned in the linux installer, the required packages are: - - -#1. mingw-w64 debian package (http://packages.debian.org/sid/mingw-w64) -# - This will require editing /etc/apt/sources.list -# Steps -# $ sudo echo 'deb http://ftp.de.debian.org/debian sid main' >> /etc/apt/sources.list -# $ sudo apt-get install mingw-w64 -# - -#2. wine 1.2 -# $ sudo apt-get install wine1.2 - -#Some other steps need to be performed before moving ahead -# -#1. sudo gedit /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake -# - This requires to be automated - -################################################## -## Script Variables -################################################## - -# Installer command line arguments -export makeSpeed; - -# TODO: check for supplied args -if [ "$1" = "" ] -then - makeSpeed="2" -else - makeSpeed=$1 -fi - -# location variables -export mypwd=$PWD - -################################################## -## Detect dependencies -################################################## -# This does not take care of version numbers. - -# Step 1: Check for gcc -#echo "Looking for GCC" -#GCC_V=$(gcc --version | grep gcc) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "gcc Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $GCC_V "\033[0m" -#fi - -# Step 2: Check for git -echo "Looking for GIT" -GIT_V=$(git --version | grep git) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "git Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $GIT_V "\033[0m" -fi - -# Step 3: Check for cmake -echo "Looking for CMAKE" -CMAKE_V=$(cmake --version | grep cmake) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "cmake Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $CMAKE_V "\033[0m" -fi - -# Step 4: Check for swig -echo "Looking for SWIG" -SWIG_V=$(swig -version | grep SWIG) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "swig Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $SWIG_V "\033[0m" -fi - -# Step 5: Check for mesa-common-dev -#echo "Looking for mesa-common-dev" -#MCD_V=$(dpkg -l | grep mesa-common-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "mesa-common-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $MCD_V "\033[0m" -#fi - -# Step 6: Check for libxt-dev -#echo "Looking for libxt-dev" -#LIBXT_V=$(dpkg -l | grep libxt-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "libxt-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $LIBXT_V "\033[0m" -#fi - -# Step 7: Check for freeglut3-dev -#echo "Looking for freeglut3-dev" -#LIBFG3_V=$(dpkg -l | grep freeglut3-dev) -#if [ $? -eq 1 ] -#then -# echo -e "\033[31m" "freeglut3-dev Not found" "\033[0m" -# exit 1 -#else -# echo -e "\033[32m" $LIBFG3_V "\033[0m" -#fi - -# Step 8: Check for openjdk-6-jdk -echo "Looking for openjdk-6-jdk" -LIBJDK_V=$(dpkg -l | grep openjdk-6-jdk) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "openjdk-6-jdk Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBJDK_V "\033[0m" -fi - -# Step 9: Check for quilt -echo "Looking for quilt" -LIBQLT_V=$(quilt --version) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "quilt Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBQLT_V "\033[0m" -fi - -# Step 10: Check for ant -echo "Looking for ant" -LIBANT_V=$(ant -version) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "ant Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBANT_V "\033[0m" -fi - -# Step 11: Check for gcc-mingw-w64 -echo "Looking for gcc-mingw-w64" -LIBMINGW_V=$(dpkg -l | grep gcc-mingw-w64) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "gcc-mingw-w64 Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBMINGW_V "\033[0m" -fi - -# Step 12: Check for wine -echo "Looking for wine" -LIBWINE_V=$(wine --version) -if [ $? -eq 1 ] -then - echo -e "\033[31m" "wine Not found" "\033[0m" - exit 1 -else - echo -e "\033[32m" $LIBWINE_V "\033[0m" -fi - -################################################## -## Install JDK 1.7 on wine -################################################## -wineDir=$mypwd/.wine -wineJavaDir=$wineDir/drive_c/Java -wineJavaUrl="http://www.java.net/download/jdk6/6u32/promoted/b02/binaries/jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" -wineJavaExec="jdk-6u32-ea-bin-b02-windows-i586-30_jan_2012.exe" - -# check for $wineDir presence - -export WINEPREFIX=$wineDir -ret=$(ls "$wineDir") -if [ $? -ne 0 ] -then - mkdir $wineDir - winecfg -fi - -# check for jdk installation -ret=$(find "$wineDir" -iname java.exe) -if [ "$ret" = "" ] -then - # Install jdk - mkdir $wineJavaDir - wget $wineJavaUrl - wine $wineJavaExec /s /v"/qn INSTALLDIR=$wineJavaDir" -fi - -################################################## -## Get, Patch (from jCAE) and Install VTK -## Get jCAE (installation later) -################################################## - -# Define abs locations -vtkURL="http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz" -vtkTar="vtk-5.6.1.tar.gz" -vtkDir=$mypwd/VTK -vtkLinBuildDir=$mypwd/vtkLinBuild -vtkLinInstallDir=$mypwd/vtkLinInstall -vtkWinBuildDir=$mypwd/vtkWinBuild -vtkWinInstallDir=$mypwd/vtkWinInstall - -jcaeURL=https://github.com/jeromerobert/jCAE.git -jcaeDir=$mypwd/jCAE - -# Get vtk-5.6.1, unzip -ret=$(ls $vtkTar) -if [ $? -ne 0 ] -then - wget $vtkURL -fi - -ret=$(ls $vtkDir) -if [ $? -ne 0 ] -then - tar -xf $vtkTar -fi - -# Get jCAE source (so early to get vtk patch) -ret=$(ls $jcaeDir) -if [ $? -ne 0 ] -then - git clone $jcaeURL -fi - -# Apply patch -cd $vtkDir -$jcaeDir/vtk-util/patch/5.6/apply.sh -cd $mypwd - -ret=$(ls $vtkLinBuildDir) -if [ $? -ne 0 ] -then - mkdir $vtkLinBuildDir -fi - -ret=$(find $vtkLinBuildDir -iname vtk.jar) -if [ "$ret" = "" ] -then - cd $vtkLinBuildDir - flags="-DCMAKE_INSTALL_PREFIX:PATH=$vtkLinInstallDir" - flags="$flags -DBUILD_SHARED_LIBS:BOOL=ON" - flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" - cmake $flags $vtkDir - make -j$makeSpeed -fi -cd $mypwd - -# Cross build -ret=$(ls $vtkWinBuildDir) -if [ $? -ne 0 ] -then - mkdir $vtkWinBuildDir -fi - -ret=$(find $vtkWinBuildDir -iname vtk.jar) -if [ "$ret" = "" ] -then - cd $vtkWinBuildDir - flags=" -DBUILD_SHARED_LIBS:BOOL=ON" - flags="$flags -DVTK_WRAP_JAVA:BOOL=ON" - flags="$flags -DBUILD_TESTING:BOOL=OFF" - flags="$flags -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--kill-at" - flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" - - flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" - flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" - flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/bin/javac.exe" - flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" - flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" - flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" - flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/bin/java.exe" - - flags="$flags -DCMAKE_INSTALL_PREFIX:FILEPATH=$vtkWinInstallDir/" - flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" - flags="$flags -DVTKCompileTools_DIR:FILEPATH=$vtkLinBuildDir" - - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" - - cmake $flags $vtkDir - cmake $flags $vtkDir - - make -j$makeSpeed -fi - -ret=$(ls $vtkWinInstallDir) -if [ $? -ne 0 ] -then - cd $mypwd - mkdir $vtkWinInstallDir -fi - -ret=$(find $vtkWinInstallDir -iname vtk.jar) -if [ "$ret" = "" ] -then - cd $vtkWinBuildDir - make install -fi - -cd $mypwd - -################################################## -## Get and Install OCE 0.9.1 -################################################## - -oceURL=https://github.com/tpaviot/oce.git -oceDir=$mypwd/oce -oceWinBuildDir=$mypwd/oceWinBuild -oceWinInstallDir=$mypwd/oceWinInstall - -cd $mypwd -echo -e "\033[32m Fetching oce from Github \033[0m" -ret=$(ls $oceDir) -if [ $? -ne 0 ] -then - git clone $oceURL $oceDir -fi - -cd $oceDir -git checkout OCE-0.9.1 -cd $mypwd - -ret=$(ls $oceWinBuildDir) -if [ $? -ne 0 ] -then - mkdir $oceWinBuildDir -fi - -ret=$(find $oceWinBuildDir -iname *Tk*.dll) -if [ "$ret" = "" ] -then - cd $oceWinBuildDir - flags="-DOCE_INSTALL_PREFIX:PATH=$oceWinInstallDir" - flags="$flags -DOCE_DISABLE_BSPLINE_MESHER:BOOL=ON" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-DMMGT_OPT_DEFAULT=0" - flags="$flags -DOCE_DISABLE_X11=ON" - flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" - flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" - flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" - flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" - flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" - flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" - flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" - flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" - flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" - flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" - cmake $flags $oceDir - make -j$makeSpeed -fi - -ret=$(ls $oceWinInstallDir) -if [ $? -ne 0 ] -then - mkdir $oceWinInstallDir -fi - -ret=$(find $oceWinInstallDir -iname *Tk*.dll) -if [ "$ret" = "" ] -then - cd $oceWinBuildDir - make install -fi - -cd $mypwd - -################################################## -## PATCH # Copy libgcc_s_sjlj-1.dll libstdc++-6.dll -################################################## - -cd $oceWinInstallDir/Win32/bin/ - -Is64=$(objdump -f TKBO.dll | grep 64) - -if [$Is64 -eq ""] -then - cp $(find /usr/lib/ -path *i686* -iname libstdc++-6.dll) . - cp $(find /usr/lib/ -path *i686* -iname libgcc_s_sjlj-1.dll) . -else - cp $(find /usr/lib/ -path *x86_64* -iname libstdc++-6.dll) . - cp $(find /usr/lib/ -path *x86_64* -iname libgcc_s_sjlj-1.dll) . -fi - -cd ../../../ - - -################################################## -## Get and Install JYTHON -################################################## - -jythonURL=http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar -jythonJar=jython_installer-2.5.2.jar -jythonDir=$mypwd/jython - -ret=$(ls $jythonJar) -if [ $? -ne 0 ] -then - wget $jythonURL -fi - -ret=$(ls $jythonDir) -if [ $? -ne 0 ] -then - java -jar $jythonJar -s -d $jythonDir -fi - - -################################################## -## Get and Install VECMATH -################################################## -vecmathURL=http://ftp.fr.debian.org/debian/pool/main/v/vecmath/libvecmath-java_1.5.2-2_all.deb -vecmathDebian=libvecmath-java_1.5.2-2_all.deb -vecmathDir=$mypwd/vecmath - -ret=$(ls $vecmathDebian) -if [ $? -ne 0 ] -then - wget $vecmathURL -fi - -ret=$(ls $vecmathDir) -if [ $? -ne 0 ] -then - dpkg-deb -x $vecmathDebian $vecmathDir -fi - - -################################################## -## Get and Install TROVE -################################################## -troveURL=http://ftp.fr.debian.org/debian/pool/main/t/trove/libtrove-java_2.1.0-2_all.deb -troveDebian=libtrove-java_2.1.0-2_all.deb -troveDir=$mypwd/trove -ret=$(ls $troveDebian) -if [ $? -ne 0 ] -then - wget $troveURL -fi - -ret=$(ls $troveDir) -if [ $? -ne 0 ] -then - dpkg-deb -x $troveDebian $troveDir -fi - - -################################################## -## Get and Install Netbeans 7.1 -################################################## -nbURL=http://dlc.sun.com.edgesuite.net/netbeans/7.1.1/final/bundles/netbeans-7.1.1-ml-javase-linux.sh -nbEx=netbeans-7.1.1-ml-javase-linux.sh -nbDir=$mypwd/nb - -ret=$(ls $nbEx) -if [ $? -ne 0 ] -then - wget $nbURL - chmod a+x $nbEx -fi - -ret=$(ls $nbDir) -if [ $? -ne 0 ] -then - mkdir $nbDir - ./$nbEx --silent "-J-Dnb-base.installation.location=$nbDir" -fi - - -################################################## -## Get and Install XALAN -## Get XSLs for build-impl.xml creation -################################################## -xalanURL=http://mirror.mkhelif.fr/apache//xml/xalan-j/xalan-j_2_7_1-bin-2jars.tar.gz -xalanTar=xalan-j_2_7_1-bin-2jars.tar.gz -xalanDir=$mypwd/xalan-j_2_7_1 - -ret=$(ls $xalanTar) -if [ $? -ne 0 ] -then - wget $xalanURL -fi - -ret=$(ls $xalanDir) -if [ $? -ne 0 ] -then - tar xf $xalanTar -fi - -export CLASSPATH=$CLASSPATH:$xalanDir/xalan.jar -export CLASSPATH=$CLASSPATH:$xalanDir/serializer.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xercesImpl.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xml-apis.jar -export CLASSPATH=$CLASSPATH:$xalanDir/xsltc.jar - -################ -#XSLS -################ -xslDir=$mypwd/xsls -nbProjectXslURL=http://hg.netbeans.org/releases/raw-file/5dfb0137e99e/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl -nbSuiteXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/build-impl.xsl -nbModuleXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/build-impl.xsl -nbPlatformXslURL=http://hg.netbeans.org/main/raw-file/c2719a24ed74/apisupport.ant/src/org/netbeans/modules/apisupport/project/suite/resources/platform.xsl - -ret=$(ls $xslDir) -if [ $? -ne 0 ] -then - mkdir $xslDir -fi - -ret=$(ls -1 $xslDir | wc -l) -if [ "$ret" != "4" ] -then - ret=$(ls $xslDir/project-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbProjectXslURL - mv build-impl.xsl $xslDir/project-build-impl.xsl - fi - - ret=$(ls $xslDir/suite-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbSuiteXslURL - mv build-impl.xsl $xslDir/suite-build-impl.xsl - fi - - ret=$(ls $xslDir/module-build-impl.xsl) - if [ $? -ne 0 ] - then - wget $nbModuleXslURL - mv build-impl.xsl $xslDir/module-build-impl.xsl - fi - - ret=$(ls $xslDir/platform.xsl) - if [ $? -ne 0 ] - then - wget $nbPlatformXslURL - mv platform.xsl $xslDir/platform.xsl - fi -fi - - -################################################## -## jCAE INSTALLATION -################################################## - -#------------------------------------------------- -## Set envirmonment variables -#------------------------------------------------- - -export jythonPath=$(find $jythonDir -iname jython.jar) -export trovePath=$(find $troveDir -iname trove.jar) -export vecmathPath=$(find $vecmathDir -iname vecmath.jar) -export vtkPath=$(find $vtkLinBuildDir -iname vtk.jar) - -touch jcae.config -echo "" > jcae.config - -echo "libs.trove.classpath=$trovePath" >> jcae.config -echo "libs.vecmath.classpath=$vecmathPath" >> jcae.config -echo "libs.VTK.classpath=$vtkPath" >> jcae.config - -echo "arch.win32=true" >> jcae.config -echo "path.occ.win32=$oceWinInstallDir/Win32/bin/" >> jcae.config -echo "path.jython.win32=$jythonDir" >> jcae.config -echo "vtk.dir.win32=$vtkWinInstallDir/bin/" >> jcae.config -echo "path.occjava.win32=$mypwd/occjavaBuild/OccJava.dll" >> jcae.config - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/oceWinInstall/Win32/bin/ -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mypwd/vtkWinInstall/bin/ - -#------------------------------------------------- -## Clean jCAE and occjava -#------------------------------------------------- -# Cleaning jCAE from any previous wrong built requires -# an extraordinary amount of checking/editing in -# a lot of properties files. -# TODO: One idea would be to run - -# cd $mypwd; -# ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" clean -# Will try it in the unified script - -# For the time being, cleaning is done like this, as it is not as time oriented task as vtk/oce/xalan/netbeans -rm -rf $jcaeDir -rm -rf $mypwd/occjavaInstall -git clone $jcaeURL - - -#------------------------------------------------- -## Build jCAE projects (vtk-util, occjava, etc) -#------------------------------------------------- - -## build OccJava -occjavaDir=$jcaeDir/occjava -occjavaBuildDir=$mypwd/occjavaBuild -occjavaInstallDir=$mypwd/occjavaInstall/ - -mkdir $occjavaBuildDir -cd $occjavaBuildDir - -flags="" -flags="$flags -DSWIG_DIR=/usr/bin/" -flags="$flags -DSWIG_EXECUTABLE=/usr/bin/swig" -flags="$flags -DOCE_DIR=$oceWinInstallDir/cmake/" - -flags="$flags -DJAVA_ARCHIVE:FILEPATH=/usr/bin/jar" -flags="$flags -DJAVA_AWT_INCLUDE_PATH:PATH=$wineJavaDir/include" -flags="$flags -DJAVA_AWT_LIBRARY:FILEPATH=$wineJavaDir/lib/jawt.lib" -flags="$flags -DJAVA_COMPILE:FILEPATH=$wineJavaDir/jre/bin/javacpl.exe" -flags="$flags -DJAVA_INCLUDE_PATH:PATH=$wineJavaDir/include" -flags="$flags -DJAVA_INCLUDE_PATH2:PATH=$wineJavaDir/include/win32" -flags="$flags -DJAVA_JVM_LIBRARY:FILEPATH=$wineJavaDir/lib/jvm.lib" -flags="$flags -DJAVA_RUNTIME:FILEPATH=$wineJavaDir/jre/bin/java.exe" -flags="$flags -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$jcaeDir/vtk-util/toolchain-i686-w64-mingw32.cmake" -flags="$flags -DCMAKE_CXX_FLAGS:STRING=-fpermissive" - -cmake $flags $occjavaDir -make - -mkdir $occjavaInstallDir -cp *.dll* $occjavaInstallDir -cd $mypwd - -## building vtk-util -cd $jcaeDir/vtk-util/ -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -ant config -ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -cd $mypwd - -## building jcae/occjava -cd $jcaeDir/jcae/occjava -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -## building amibe -cd $jcaeDir/amibe -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar -cd $mypwd - -## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) -cd $jcaeDir/jcae/vtk-amibe -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -## building vtk-amibe-occ -cd $jcaeDir/vtk-amibe-occ -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config >> nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar -cd $mypwd - -#------------------------------------------------- -## Build jCAE modules -#------------------------------------------------- - -cd $jcaeDir/jcae - -modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath vtk vtk-util" -for module in $modules -do - cd $jcaeDir/jcae - cd "$module" - java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml -done - - -#------------------------------------------------- -## Generate platform.xml. -#------------------------------------------------- - -# This is a now an automated step. -cd $jcaeDir/jcae -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml - -#------------------------------------------------- -## Build suite as Zip distribution -#------------------------------------------------- -mkdir nbproject/private -touch nbproject/private/private.properties -cat $mypwd/jcae.config > nbproject/private/private.properties - -mkdir vtk/nbproject/private -cp nbproject/private/private.properties vtk/nbproject/private/ - -mkdir vecmath/nbproject/private -cp nbproject/private/private.properties vecmath/nbproject/private/ - -mkdir trove/nbproject/private -cp nbproject/private/private.properties trove/nbproject/private/ - -echo "path.jre.win32=$wineJavaDir/jre" >> nbproject/private/private.properties - -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip -cd $mypwd - -mv $jcaeDir/jcae/dist jCAE-zipped From 330ed77bb47a21822ea944bc07b89b87f919d29e Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 16:06:29 +0530 Subject: [PATCH 40/49] Check for make as prerequisite --- scripts/jCAE-auto-installer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index e1017d6c0..113cd2f2d 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -113,6 +113,7 @@ checkPackage() package="gcc"; useDpkg=0; checkPackage package="git" ; useDpkg=0; checkPackage +package="make"; useDpkg=0; checkPackage package="cmake"; useDpkg=0; checkPackage package="swig"; useDpkg=0; checkPackage #package="mesa-common-dev"; useDpkg=1; checkPackage From 770138527d7cfaa58d52a0e6ae55dbe2e045740e Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 17:39:38 +0530 Subject: [PATCH 41/49] VTK-5.10 support --- scripts/jCAE-auto-installer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 113cd2f2d..d653984e7 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -173,9 +173,9 @@ fi # Define abs locations -vtkURL="http://www.vtk.org/files/release/5.10/vtk-5.10.0-rc3.tar.gz" -vtkTar="vtk-5.10.0-rc3.tar.gz" -vtkDir=$mypwd/VTK5.10.0.RC3 +vtkURL="http://www.vtk.org/files/release/5.10/vtk-5.10.0.tar.gz" +vtkTar="vtk-5.10.0.tar.gz" +vtkDir=$mypwd/VTK vtkLinBuildDir=$mypwd/vtkLinBuild vtkLinInstallDir=$mypwd/vtkLinInstall From 8a23bb11ab0c13d1908be93d190fbe7f8925d960 Mon Sep 17 00:00:00 2001 From: u Date: Mon, 4 Jun 2012 17:45:53 +0530 Subject: [PATCH 42/49] Removed unnecessary classes.jsa from JDK --- scripts/jCAE-auto-installer.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index d653984e7..35fb09579 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -164,6 +164,10 @@ then else echo "$green $bold\nJDK-6 on wine already Installed \n$normal $black" fi + + # Patch to remove unnecessary classes.jsa from jdk + ret=$(find "$wineJavaDir" -iname classes.jsa -exec rm -f {} \;) + fi ################################################## From 6417fcaba5579d44a1a849d674661b0e003519f8 Mon Sep 17 00:00:00 2001 From: u Date: Fri, 8 Jun 2012 09:24:35 +0530 Subject: [PATCH 43/49] Using ant from netbeans --- scripts/jCAE-auto-installer.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 35fb09579..4b65754fc 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -116,12 +116,12 @@ package="git" ; useDpkg=0; checkPackage package="make"; useDpkg=0; checkPackage package="cmake"; useDpkg=0; checkPackage package="swig"; useDpkg=0; checkPackage -#package="mesa-common-dev"; useDpkg=1; checkPackage -#package="libxt-dev"; useDpkg=1; checkPackage -#package="freeglut3-dev"; useDpkg=1; checkPackage +package="mesa-common-dev"; useDpkg=1; checkPackage +package="libxt-dev"; useDpkg=1; checkPackage +package="freeglut3-dev"; useDpkg=1; checkPackage package="openjdk-7-jdk"; useDpkg=1; checkPackage #package="quilt"; useDpkg=0; checkPackage -package="ant"; useDpkg=0; checkPackage +#package="ant"; useDpkg=0; checkPackage if [ "$targetOS" = "windows" ] then @@ -570,6 +570,11 @@ else echo "$green $bold\nNetbeans already installed \n$normal $black" fi +################################################## +## Define ant +################################################## +myant=$nbDir/java/ant/bin/ant + ################################################## ## Get and Install XALAN @@ -775,9 +780,9 @@ cd $jcaeDir/vtk-util/ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties -ant config -ant clean -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" +$myant config +$myant clean +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" cd $mypwd ## building jcae/occjava @@ -787,7 +792,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd ## building amibe @@ -797,7 +802,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar cd $mypwd ## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) @@ -807,7 +812,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd ## building vtk-amibe-occ @@ -817,7 +822,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd #------------------------------------------------- @@ -870,7 +875,7 @@ then fi java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml -ant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip +$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip echo "$green $bold\njCAE built successfully \n$normal $black"" Time="$(date +%s) cd $mypwd From 5bc58205f12e6b1ed9afe7e505dbdde851d646f9 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 12 Jun 2012 15:57:58 +0530 Subject: [PATCH 44/49] [auto-installer] Skipping cloning of jCAE anymore --- scripts/jCAE-auto-installer.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 4b65754fc..5d2c12fa2 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -183,8 +183,8 @@ vtkDir=$mypwd/VTK vtkLinBuildDir=$mypwd/vtkLinBuild vtkLinInstallDir=$mypwd/vtkLinInstall -jcaeURL=https://github.com/jeromerobert/jCAE.git -jcaeDir=$mypwd/jCAE +#jcaeURL=https://github.com/jeromerobert/jCAE.git +jcaeDir=$mypwd/../ # Get vtk-5.10.0, unzip ret=$(ls $vtkTar) @@ -200,11 +200,11 @@ then fi # Get jCAE source (so early to get vtk patch) -ret=$(ls $jcaeDir) -if [ $? -ne 0 ] -then - git clone $jcaeURL -fi +#ret=$(ls $jcaeDir) +#if [ $? -ne 0 ] +#then +# git clone $jcaeURL +#fi cd $jcaeDir export jcaeTagName=$(git describe --tags) From a66322b6c7db1f3334501ee1f9aa820c9348aea0 Mon Sep 17 00:00:00 2001 From: u Date: Tue, 12 Jun 2012 17:16:56 +0530 Subject: [PATCH 45/49] [auto-installer] JAVA_HOME issue fixed --- scripts/jCAE-auto-installer.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 5d2c12fa2..d91208c2a 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -38,6 +38,7 @@ black="\033[0m " export targetOS; export makeSpeed; +export myjava; echo "$1" if [ "$1" = "linux" ] || [ "$1" = "windows" ] @@ -61,6 +62,13 @@ then exit 1 fi +if [ "$1" = "linux" ] +then + myjava=$JAVA_HOME/bin/java +else + myjava=java +fi + startTime=$(date +%s) # Relative paths simplified @@ -485,7 +493,7 @@ fi ret=$(ls $jythonDir) if [ $? -ne 0 ] then - java -jar $jythonJar -s -d $jythonDir + $myjava -jar $jythonJar -s -d $jythonDir echo "$green $bold\nJython installed successfully \n$normal $black"" Time="$(date +%s) else echo "$green $bold\nJython already installed \n$normal $black" @@ -791,7 +799,7 @@ cd $jcaeDir/jcae/occjava mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +$myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml $myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd @@ -801,7 +809,7 @@ cd $jcaeDir/amibe mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +$myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml $myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar cd $mypwd @@ -811,7 +819,7 @@ cd $jcaeDir/jcae/vtk-amibe mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +$myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml $myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd @@ -821,7 +829,7 @@ cd $jcaeDir/vtk-amibe-occ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml +$myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml $myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd @@ -836,7 +844,7 @@ modules="amibe amibe-occ core jython mesh-algos occjava-nb trove tweakui vecmath for module in $modules do cd $jcaeDir/jcae/"$module" - java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml + $myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/module-build-impl.xsl -OUT nbproject/build-impl.xml done @@ -847,7 +855,7 @@ done # This is a now an automated step. echo "$green $bold\nGenerating platform.xml for jCAE... \n$normal $black"" Time="$(date +%s) cd $jcaeDir/jcae -java org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml +$myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/platform.xsl -OUT nbproject/platform.xml #------------------------------------------------- ## Build suite as Zip distribution @@ -874,7 +882,7 @@ then echo "path.jre.win32=$wineJavaDir/jre" >> nbproject/private/private.properties fi -java org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml +$myjava org.apache.xalan.xslt.Process -IN ./nbproject/project.xml -XSL $xslDir/suite-build-impl.xsl -OUT nbproject/build-impl.xml $myant -Dnbplatform.default.netbeans.dest.dir="$nbDir" -Dnbplatform.default.harness.dir="$nbDir/harness/" build-zip echo "$green $bold\njCAE built successfully \n$normal $black"" Time="$(date +%s) cd $mypwd From 57db3a02e2fb9add8b6ef4527e5f6c6e934b2e71 Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Fri, 15 Jun 2012 12:40:55 +0530 Subject: [PATCH 46/49] [auto-installer] Commented out Java projects(amibe,occjava,vtk-util etc) build --- scripts/jCAE-auto-installer.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index d91208c2a..6a29dbeea 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -790,7 +790,7 @@ touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties $myant config $myant clean -$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" +#$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" cd $mypwd ## building jcae/occjava @@ -800,7 +800,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties $myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +#$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd ## building amibe @@ -810,7 +810,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties $myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar +#$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" -f nbbuild.xml jar cd $mypwd ## building vtk-amibe (src location at jCAE/vtk-amibe/, DONT know why?) @@ -820,7 +820,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties $myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +#$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd ## building vtk-amibe-occ @@ -830,7 +830,7 @@ mkdir nbproject/private touch nbproject/private/private.properties cat $mypwd/jcae.config > nbproject/private/private.properties $myjava org.apache.xalan.xslt.Process -IN nbproject/project.xml -XSL $xslDir/project-build-impl.xsl -OUT nbproject/build-impl.xml -$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar +#$myant -Dnbplatform.default.netbeans.dest.dir="$nbDir/" -Dnbplatform.default.harness.dir="$nbDir/harness/" jar cd $mypwd #------------------------------------------------- From 1e55c7bcdbf695fab0c07e553dce6e786b3bb6c0 Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Fri, 15 Jun 2012 14:20:42 +0530 Subject: [PATCH 47/49] [auto-installer] Jython doc and demo removed --- scripts/jCAE-auto-installer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 6a29dbeea..044594a22 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -499,7 +499,8 @@ else echo "$green $bold\nJython already installed \n$normal $black" fi - +#Removing doc , demos +rm -rf $jythonDir/Demo $jythonDir/Doc ################################################## ## Get and Install VECMATH From 9c101e195997cb308f850aa6f712d70ca1dc7f66 Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Mon, 18 Jun 2012 16:17:11 +0530 Subject: [PATCH 48/49] [auto-installer] Getting jython.bat --- scripts/jCAE-auto-installer.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/jCAE-auto-installer.sh b/scripts/jCAE-auto-installer.sh index 044594a22..3ac136a78 100755 --- a/scripts/jCAE-auto-installer.sh +++ b/scripts/jCAE-auto-installer.sh @@ -502,6 +502,14 @@ fi #Removing doc , demos rm -rf $jythonDir/Demo $jythonDir/Doc +#Fetching jython.bat +if [ "$targetOS" = "windows" ] +then + cd $jythonDir/bin + wget -nc http://jython.svn.sourceforge.net/viewvc/jython/tags/Release_2_5_2/jython/src/shell/jython.bat + cd $mypwd +fi + ################################################## ## Get and Install VECMATH ################################################## From 2066552610fd6e09bba1101a08b38a92d3f49fbf Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Tue, 24 Jul 2012 17:54:58 +0530 Subject: [PATCH 49/49] [options API] Issue# 235 - Obsolete Options API removed --- jcae/core/nbproject/project.xml | 8 - jcae/core/src/org/jcae/netbeans/Settings.java | 73 ------- .../src/org/jcae/netbeans/Settings.settings | 9 - jcae/core/src/org/jcae/netbeans/layer.xml | 10 - .../jcae/netbeans/mesh/BuidOEMMAction.java | 5 +- jcae/mesh-algos/nbproject/project.xml | 9 +- .../org/jcae/netbeans/mesh/AlgoAction.java | 13 +- .../src/org/jcae/netbeans/mesh/Settings.java | 126 ----------- .../org/jcae/netbeans/mesh/Settings.settings | 9 - .../src/org/jcae/netbeans/mesh/layer.xml | 11 - .../options/JCAEOptionsPanelController.java | 75 +++++++ .../org/jcae/netbeans/options/JCAEPanel.java | 205 ++++++++++++++++++ .../jcae/netbeans/options/PrefProperty.java | 68 ++++++ .../src/org/jcae/netbeans/options/amibe.png | Bin 0 -> 807 bytes .../org/jcae/netbeans/viewer3d/Settings.java | 70 ------ .../jcae/netbeans/viewer3d/Settings.settings | 9 - 16 files changed, 357 insertions(+), 343 deletions(-) delete mode 100644 jcae/core/src/org/jcae/netbeans/Settings.java delete mode 100644 jcae/core/src/org/jcae/netbeans/Settings.settings delete mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.java delete mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.settings create mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEOptionsPanelController.java create mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEPanel.java create mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/options/PrefProperty.java create mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/options/amibe.png delete mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.java delete mode 100644 jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.settings diff --git a/jcae/core/nbproject/project.xml b/jcae/core/nbproject/project.xml index e9bd159c3..d1afcdb2b 100644 --- a/jcae/core/nbproject/project.xml +++ b/jcae/core/nbproject/project.xml @@ -143,14 +143,6 @@ 7.12.1.1 - - org.openide.options - - - - 6.13.1 - - org.openide.text diff --git a/jcae/core/src/org/jcae/netbeans/Settings.java b/jcae/core/src/org/jcae/netbeans/Settings.java deleted file mode 100644 index a4d1be522..000000000 --- a/jcae/core/src/org/jcae/netbeans/Settings.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Project Info: http://jcae.sourceforge.net - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * (C) Copyright 2004, by EADS CRC - */ - -package org.jcae.netbeans; - -import java.io.Externalizable; -import org.openide.options.SystemOption; - -/** - * @author Jerome Robert - * - */ -public class Settings extends SystemOption -{ - private static final String ZFACTORABS = "javax.media.j3d.zFactorAbs"; - private static final String ZFACTORREL = "javax.media.j3d.zFactorRel"; - - /** - * @return Returns the polygonOffset. - */ - public float getPolygonOffset() - { - String s=System.getProperty(ZFACTORABS, "20.0f"); - return Float.parseFloat(s); - } - /** - * @param polygonOffset The polygonOffset to set. - */ - public void setPolygonOffset(float polygonOffset) - { - System.out.println("setPolygonOffset"); - System.setProperty(ZFACTORABS, ""+polygonOffset); - } - /** - * @return Returns the polygonOffsetFactor. - */ - public float getPolygonOffsetFactor() - { - String s=System.getProperty(ZFACTORREL, "2.0f"); - return Float.parseFloat(s); - } - /** - * @param polygonOffsetFactor The polygonOffsetFactor to set. - */ - public void setPolygonOffsetFactor(float polygonOffsetFactor) - { - System.setProperty(ZFACTORREL, ""+polygonOffsetFactor); - } - /* (non-Javadoc) - * @see org.openide.options.SystemOption#displayName() - */ - public String displayName() - { - return "viewer 3d settings"; - } -} diff --git a/jcae/core/src/org/jcae/netbeans/Settings.settings b/jcae/core/src/org/jcae/netbeans/Settings.settings deleted file mode 100644 index f34d8613f..000000000 --- a/jcae/core/src/org/jcae/netbeans/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/jcae/core/src/org/jcae/netbeans/layer.xml b/jcae/core/src/org/jcae/netbeans/layer.xml index 68772c143..ac735fbef 100644 --- a/jcae/core/src/org/jcae/netbeans/layer.xml +++ b/jcae/core/src/org/jcae/netbeans/layer.xml @@ -447,16 +447,6 @@ - - - - - - - - - - diff --git a/jcae/core/src/org/jcae/netbeans/mesh/BuidOEMMAction.java b/jcae/core/src/org/jcae/netbeans/mesh/BuidOEMMAction.java index 70cceb6c4..0baa29a2f 100644 --- a/jcae/core/src/org/jcae/netbeans/mesh/BuidOEMMAction.java +++ b/jcae/core/src/org/jcae/netbeans/mesh/BuidOEMMAction.java @@ -20,14 +20,15 @@ package org.jcae.netbeans.mesh; -import java.beans.*; import org.jcae.netbeans.ProcessExecutor; import org.jcae.netbeans.Utilities; +import org.jcae.netbeans.options.JCAEPanel; import org.openide.filesystems.FileUtil; import org.openide.modules.InstalledFileLocator; import org.openide.nodes.Node; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; +import org.openide.util.NbPreferences; import org.openide.util.actions.CookieAction; public final class BuidOEMMAction extends CookieAction @@ -50,7 +51,7 @@ protected void performAction(Node[] activatedNodes) getAbsolutePath(); String className="org.jcae.mesh.MeshOEMMIndex"; - String[] cmdLinePre=Settings.getDefault().getCommandLineAlgo(); + String[] cmdLinePre=NbPreferences.forModule(JCAEPanel.class).get("commandLineAlgo", "").split(" "); String[] cmdLine=new String[cmdLinePre.length+7]; System.arraycopy(cmdLinePre, 0, cmdLine, 0, cmdLinePre.length); diff --git a/jcae/mesh-algos/nbproject/project.xml b/jcae/mesh-algos/nbproject/project.xml index 5da402e37..e2e9d0695 100644 --- a/jcae/mesh-algos/nbproject/project.xml +++ b/jcae/mesh-algos/nbproject/project.xml @@ -128,14 +128,6 @@ 7.12.1.1 - - org.openide.options - - - - 6.13.1 - - org.openide.text @@ -180,6 +172,7 @@ org.jcae.netbeans org.jcae.netbeans.mesh + org.jcae.netbeans.options org.jcae.netbeans.viewer3d org.jcae.netbeans.viewer3d.actions diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AlgoAction.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AlgoAction.java index c9baaef05..932ac254c 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AlgoAction.java +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/AlgoAction.java @@ -25,7 +25,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; -import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.TreeSet; @@ -36,16 +35,13 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import org.jcae.mesh.JCAEFormatter; -import org.jcae.mesh.xmldata.Group; +import org.jcae.netbeans.options.JCAEPanel; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; import org.openide.filesystems.FileUtil; import org.openide.modules.InstalledFileLocator; import org.openide.nodes.Node; -import org.openide.util.Cancellable; -import org.openide.util.Exceptions; -import org.openide.util.HelpCtx; -import org.openide.util.Utilities; +import org.openide.util.*; import org.openide.util.actions.CookieAction; import org.openide.windows.IOProvider; import org.openide.windows.InputOutput; @@ -210,7 +206,7 @@ protected void performAction(Node[] activatedNodes) { "amibe-python/" + command + ".py", "org.jcae.netbeans", false); InputOutput io = IOProvider.getDefault().getIO(getName(), true); - if (Settings.getDefault().isRunInSameJVM()) + if (NbPreferences.forModule(JCAEPanel.class).getBoolean("runInSameJVM", true)) runInSameVM(args, pyFile, io); else runInOtherVM(activatedNodes[0], args, pyFile, io); @@ -277,7 +273,8 @@ private void runInOtherVM(Node node, List args, File pyFile, InputOutput File f = InstalledFileLocator.getDefault().locate( "modules/jython/bin/jython" + ext, "org.jcae.netbeans.mesh", false); pb.command().add(f.getPath()); - for (String s : Settings.getDefault().parameters()) { + JCAEPanel j = new JCAEPanel(null); + for (String s : j.parameters()) { if (s.startsWith("-") && !s.startsWith("-D")) { s = "-J" + s; } diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.java b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.java deleted file mode 100644 index 9024363d9..000000000 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Project Info: http://jcae.sourceforge.net - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * (C) Copyright 2008, by EADS France - */ - -package org.jcae.netbeans.mesh; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openide.modules.InstalledFileLocator; -import org.openide.options.SystemOption; -import org.openide.util.Lookup; - -/** - * @author Jerome Robert - * - */ -public class Settings extends SystemOption -{ - static final long serialVersionUID = 2437343054662293472L; - static public Settings getDefault() - { - return Lookup.getDefault().lookup(Settings.class); - } - - private String maximumMemory="1000m"; - private String[] customJVMParameters=new String[0]; - private String[] customMesherParameters=new String[0]; - private boolean runInSameJVM=Boolean.getBoolean("jcae.netbeans.mesh.samejvm"); - - - /* (non-Javadoc) - * @see org.openide.options.SystemOption#displayName() - */ - public String displayName() - { - return "Mesher settings"; - } - - /** - * Return a command line to execute other algo in the jcae.jar archive - */ - public String[] getCommandLineAlgo() - { - String javaExe=new File(new File(System.getProperty("java.home"), "bin"), "java").getPath(); - List toReturn=parameters(); - toReturn.add(0, javaExe); - return toReturn.toArray(new String[toReturn.size()]); - } - - public List parameters() - { - ArrayList toReturn=new ArrayList(); - toReturn.add("-Xmx"+maximumMemory); - String logPath = InstalledFileLocator.getDefault(). - locate("etc/logging.properties", "org.jcae.netbeans.mesh", false). - getAbsolutePath(); - toReturn.add("-Djava.util.logging.config.file="+logPath); - toReturn.addAll(Arrays.asList(getCustomJVMParameters())); - return toReturn; - } - - public String getMaximumMemory() - { - return maximumMemory; - } - - public void setMaximumMemory(String maximumMemory) - { - this.maximumMemory = maximumMemory; - } - - public boolean isRunInSameJVM() - { - return runInSameJVM; - } - public void setRunInSameJVM(boolean runInSameJVM) - { - this.runInSameJVM = runInSameJVM; - } - /** - * @return Returns the customJVMParameters. - */ - public String[] getCustomJVMParameters() - { - return customJVMParameters; - } - /** - * @param customJVMParameters The customJVMParameters to set. - */ - public void setCustomJVMParameters(String[] customJVMParameters) - { - this.customJVMParameters = customJVMParameters; - } - /** - * @return Returns the customMesherParameters. - */ - public String[] getCustomMesherParameters() - { - return customMesherParameters; - } - /** - * @param customMesherParameters The customMesherParameters to set. - */ - public void setCustomMesherParameters(String[] customMesherParameters) - { - this.customMesherParameters = customMesherParameters; - } -} diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.settings b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.settings deleted file mode 100644 index 488f6d76d..000000000 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/layer.xml b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/layer.xml index 9203dd5cb..efc89b6fe 100644 --- a/jcae/mesh-algos/src/org/jcae/netbeans/mesh/layer.xml +++ b/jcae/mesh-algos/src/org/jcae/netbeans/mesh/layer.xml @@ -162,17 +162,6 @@ - - - - - - - - - - - diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEOptionsPanelController.java b/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEOptionsPanelController.java new file mode 100644 index 000000000..d2abdbbf6 --- /dev/null +++ b/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEOptionsPanelController.java @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.jcae.netbeans.options; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import javax.swing.JComponent; +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; + +@OptionsPanelController.TopLevelRegistration(categoryName = "#OptionsCategory_Name_jCAE", +iconBase = "org/jcae/netbeans/options/amibe.png", +keywords = "#OptionsCategory_Keywords_jCAE", +keywordsCategory = "jCAE") +@org.openide.util.NbBundle.Messages({"OptionsCategory_Name_jCAE=jCAE", "OptionsCategory_Keywords_jCAE=jcae"}) +public final class JCAEOptionsPanelController extends OptionsPanelController { + + private JCAEPanel panel; + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + private boolean changed; + + public void update() { + changed = false; + } + + public void applyChanges() { + changed = false; + } + + public void cancel() { + // need not do anything special, if no changes have been persisted yet + } + + public boolean isValid() { + return true; + } + + public boolean isChanged() { + return changed; + } + + public HelpCtx getHelpCtx() { + return null; // new HelpCtx("...ID") if you have a help set + } + + public JComponent getComponent(Lookup masterLookup) { + return getPanel(); + } + + public void addPropertyChangeListener(PropertyChangeListener l) { + pcs.addPropertyChangeListener(l); + } + + public void removePropertyChangeListener(PropertyChangeListener l) { + pcs.removePropertyChangeListener(l); + } + + private JCAEPanel getPanel() { + if (panel == null) { + panel = new JCAEPanel(this); + } + return panel; + } + + void changed() { + if (!changed) { + changed = true; + pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); + } + pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); + } +} diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEPanel.java b/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEPanel.java new file mode 100644 index 000000000..918847bf2 --- /dev/null +++ b/jcae/mesh-algos/src/org/jcae/netbeans/options/JCAEPanel.java @@ -0,0 +1,205 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.jcae.netbeans.options; + +import java.awt.Dimension; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import org.openide.explorer.propertysheet.PropertySheet; +import org.openide.modules.InstalledFileLocator; +import org.openide.nodes.*; +import org.openide.util.Exceptions; + +public final class JCAEPanel extends PropertySheet { + + private final JCAEOptionsPanelController controller; + + public JCAEPanel(JCAEOptionsPanelController controller) { + this.controller = controller; + //initComponents(); + // TODO listen to changes in form fields and call controller.changed() + AbstractNode node = new AbstractNode(Children.LEAF) + { + @Override + public PropertySet[] getPropertySets() { + return createPropertySet(); + } + }; + setNodes(new Node[]{node}); + setDescriptionAreaVisible(true); + setPreferredSize(new Dimension(0, 250)); + } + + private String maximumMemory="1000m"; + private String customJVMParameters=new String(); + private String customMesherParameters=new String(); + private boolean runInSameJVM=Boolean.getBoolean("jcae.netbeans.mesh.samejvm"); + + private String polygonOffset = "20.0f"; + private String polygonOffsetFactor = "2.0f"; + + /** + * @return the polygonOffset + */ + public String getPolygonOffset() { + return polygonOffset; + } + + /** + * @param polygonOffset the polygonOffset to set + */ + public void setPolygonOffset(String polygonOffset) { + this.polygonOffset = polygonOffset; + } + + /** + * @return the polygonOffsetFactor + */ + public String getPolygonOffsetFactor() { + return polygonOffsetFactor; + } + + /** + * @param polygonOffsetFactor the polygonOffsetFactor to set + */ + public void setPolygonOffsetFactor(String polygonOffsetFactor) { + this.polygonOffsetFactor = polygonOffsetFactor; + } + + + private class MyProperty extends PropertySupport.Reflection + { + public MyProperty(Class type, String property, String name) + throws NoSuchMethodException + { + this(type, property, name, name); + } + public MyProperty(Class type, String property, String name, String description) + throws NoSuchMethodException + { + super(JCAEPanel.this, type, property); + setName(name); + setShortDescription(description); + } + } + + private Sheet.Set[] createPropertySet() + { + Sheet.Set[] r = new Sheet.Set[2]; + r[0] = new Sheet.Set(); + r[0].setName("Mesher Settings"); + try { + PrefProperty p1 = new PrefProperty("jcae.MaximumMemory", "maximumMemory", maximumMemory, JCAEPanel.class); + r[0].put(p1); + + PrefProperty p2 = new PrefProperty("jcae.CustomJVMParameters", "customJVMParameters", customJVMParameters, JCAEPanel.class); + r[0].put(p2); + + PrefProperty p3 = new PrefProperty("jcae.CustomMesherParameters", "customMesherParameters", customMesherParameters, JCAEPanel.class); + r[0].put(p3); + + PrefProperty p4 = new PrefProperty("jcae.RunInSameJVM", "runInSameJVM", runInSameJVM, JCAEPanel.class); + r[0].put(p4); + + String[] cmd = getCommandLineAlgo(); + for(int i=0; i toReturn=parameters(); + toReturn.add(0, javaExe); + return toReturn.toArray(new String[toReturn.size()]); + + } + + public List parameters() + { + ArrayList toReturn=new ArrayList(); + toReturn.add("-Xmx"+maximumMemory); + String logPath = InstalledFileLocator.getDefault(). + locate("etc/logging.properties", "org.jcae.netbeans.mesh", false). + getAbsolutePath(); + toReturn.add("-Djava.util.logging.config.file="+logPath); + toReturn.addAll(Arrays.asList(getCustomJVMParameters())); + return toReturn; + } + + public String getMaximumMemory() + { + return maximumMemory; + } + + public void setMaximumMemory(String maximumMemory) + { + this.maximumMemory = maximumMemory; + } + + public boolean isRunInSameJVM() + { + return runInSameJVM; + } + public void setRunInSameJVM(boolean runInSameJVM) + { + this.runInSameJVM = runInSameJVM; + } + /** + * @return Returns the customJVMParameters. + */ + public String getCustomJVMParameters() + { + return customJVMParameters; + } + /** + * @param customJVMParameters The customJVMParameters to set. + */ + public void setCustomJVMParameters(String customJVMParameters) + { + this.customJVMParameters = customJVMParameters; + } + /** + * @return Returns the customMesherParameters. + */ + public String getCustomMesherParameters() + { + return customMesherParameters; + } + /** + * @param customMesherParameters The customMesherParameters to set. + */ + public void setCustomMesherParameters(String customMesherParameters) + { + this.customMesherParameters = customMesherParameters; + } + +} diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/options/PrefProperty.java b/jcae/mesh-algos/src/org/jcae/netbeans/options/PrefProperty.java new file mode 100644 index 000000000..f24463280 --- /dev/null +++ b/jcae/mesh-algos/src/org/jcae/netbeans/options/PrefProperty.java @@ -0,0 +1,68 @@ +package org.jcae.netbeans.options; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.util.prefs.Preferences; +import org.openide.nodes.Node.Property; +import org.openide.util.NbPreferences; + +/** + * + * @author u + */ +public class PrefProperty extends Property { + private final String prefName; + private final Object defValue; + private final Preferences preferences; + + public PrefProperty(String prefName, String name, Object defValue, String description, Class moduleClass) + { + super(defValue.getClass()); + setName(name); + this.prefName = prefName; + this.defValue = defValue; + this.setShortDescription(description); + preferences = NbPreferences.forModule(moduleClass); + } + + public PrefProperty(String prefName, String name, Object defValue, Class moduleClass) + { + this(prefName, name, defValue, null, moduleClass); + } + + @Override + public boolean canRead() { + return true; + } + + @Override + public boolean canWrite() { + return true; + } + + @Override + public Object getValue() throws IllegalAccessException, + InvocationTargetException { + if(Double.class.isAssignableFrom(getValueType())) + return (Double) preferences.getDouble(prefName, (Double)defValue); + else if(Boolean.class.isAssignableFrom(getValueType())) + return (Boolean) preferences.getBoolean(prefName, (Boolean)defValue); + else if(Integer.class.isAssignableFrom(getValueType())) + return (Integer) preferences.getInt(prefName, (Integer)defValue); + else if(File.class.isAssignableFrom(getValueType())) + return new File(preferences.get(prefName, defValue.toString())); + else + return preferences.get(prefName, (String)defValue); + } + + @Override + public void setValue(Object val) throws IllegalAccessException, + IllegalArgumentException, InvocationTargetException { + preferences.put(prefName, val.toString()); + } +} \ No newline at end of file diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/options/amibe.png b/jcae/mesh-algos/src/org/jcae/netbeans/options/amibe.png new file mode 100644 index 0000000000000000000000000000000000000000..ae51b5e49c85b87d29ce874ea2bd10b3f4139ec7 GIT binary patch literal 807 zcmV+?1K9kDP)Px%;Ymb6R5;6}lTU~nbri=x^UKU6n@KXsCX;No-M{Vbx=UqS>taEqR+Q~US`m+; zc#u+h61|Cf5K*i*DcGALC?cX1L=h=k1&h!^sr|S1Pj;70GTCG@voqQJn;8#F1NGW> zdGL6A-h1E27alSsfVW>goCEA2#1|6655n}8*CCaNA*7wgAl%7YUME;HZR`8ruZIBg znKz$Lo;-bS6X4qqUy;Hv+~;}T<%ZK@cVQS2kq6WKevis#(~~1&9#{hqCr_W-`s15V z1i;k(BO`i#?09@A#;$yZRBn{%1JAJc;IkC>EFwt~Q#kYnjN3ijY-mYd4AOInpDOhh4J=(R2ensXh7P(+diKIP=}bcFSqx%zIbAP-Ah7 z@p(iB2Z>>DoXvMUGHj zy^T>E!?h~7Rt12F5{(Y;obj~`uv%?OndA`la_NB|*KH3W1WIk=f%UDe^uh#3UVcZ?GKD_}A_6p=)^A?3`dYKPiZL-y zrZ|P)?~%ylaT_}uMP!AeuYV-n`uk^fc4@f_AnpT9%e_!3-P%@TaR4fJu25UOj*wMc z*TrpAIR3_G()lmne|&anx%=zq?;RMJ31In&y~^TD@g*azCI0WYTGJz&8bS!cTc7@P l7U1JkM^mkKSAAGF^B;2tC^q`m&piMD002ovPDHLkV1n%=eA)m2 literal 0 HcmV?d00001 diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.java b/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.java deleted file mode 100644 index f1ef1cab0..000000000 --- a/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Project Info: http://jcae.sourceforge.net - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * (C) Copyright 2004, by EADS CRC - */ - -package org.jcae.netbeans.viewer3d; - -import org.openide.options.SystemOption; - -/** - * @author Jerome Robert - * - */ -public class Settings extends SystemOption -{ - private static final String ZFACTORABS = "javax.media.j3d.zFactorAbs"; - private static final String ZFACTORREL = "javax.media.j3d.zFactorRel"; - /** - * @return Returns the polygonOffset. - */ - public float getPolygonOffset() - { - String s=System.getProperty(ZFACTORABS, "20.0f"); - return Float.parseFloat(s); - } - /** - * @param polygonOffset The polygonOffset to set. - */ - public void setPolygonOffset(float polygonOffset) - { - System.setProperty(ZFACTORABS, ""+polygonOffset); - } - /** - * @return Returns the polygonOffsetFactor. - */ - public float getPolygonOffsetFactor() - { - String s=System.getProperty(ZFACTORREL, "2.0f"); - return Float.parseFloat(s); - } - /** - * @param polygonOffsetFactor The polygonOffsetFactor to set. - */ - public void setPolygonOffsetFactor(float polygonOffsetFactor) - { - System.setProperty(ZFACTORREL, ""+polygonOffsetFactor); - } - /* (non-Javadoc) - * @see org.openide.options.SystemOption#displayName() - */ - public String displayName() - { - return "viewer 3d settings"; - } -} diff --git a/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.settings b/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.settings deleted file mode 100644 index f34d8613f..000000000 --- a/jcae/mesh-algos/src/org/jcae/netbeans/viewer3d/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - -