Monday, August 3, 2009

Installing AdventureFEA on Ubuntu (Intrepid) 9.04 32bit

After more than 2 years I am attempting to install on an Intel QuadCore Ubuntu 9.04 32bit running in a VirtualBox, since I do not want to mess up my existing OS (Ubuntu 8.04 64bit).

Thanks to Alex (See: http://caejournal.com/adventure-fea-system-in-debian-lenny-t-156.html) and notes by Prof. Ogino (See: http://cm.mech.kyushu-u.ac.jp/~ogino/adv_on_suse11.html) I have compiled all but one of the 20 modules successfully except:

AdvVisual

1. If anybody has clues or patches to compile AdvVisual using a newer compiler (higher than gcc-2.95 and preferably gcc-4.0+) please speak up or post your notes in this blog or email me at the email shown on the left panel. I have made some modifications for the migration from gcc-2.95 to gcc-4.3 but still have some compile errors. At least I have managed to reduce the number which might be progress! When I have succeeded (at least with AdvVisual) I will post detailed instructions like the ones I have posted for the Ubuntu 7.04 installation.

-JMB

Tuesday, June 12, 2007

Installing Adventure_on_Windows Ubuntu running VMWare

ADVENTURE_on_Windows (0.2b 01/Mar/2007) has been successfully install via VMWare on an Ubuntu (Feisty Fawn 7.04) Linux PC. If anybody is interested on how this was done, feel free to contact me for details.

-JMB

Installing Adventure on Ubuntu (Feisty Fawn 7.04)

#!/bin/bash

mkdir ~/Adventure
cd ~/Adventure

# ********************************
# Download all the user manuals...
# ********************************
# from http://adventure.q.t.u-tokyo.ac.jp
# ********************************
# Download all the modules to /home/LinuxDownLoads/FEA/Adventure
# ********************************

# ********************************
# Download all the sample data
# ********************************

# IMPORTANT ***********************************************
# Install Adventure as some "user" NOT as "root" ***********
# *********************************************************
# In the Makefile's if you change some portions, install ADVENTURE using priviledge of
# root is OK. In some modules you can designate install directory as an option of ./configure.
# For example
# Not at ~/ADVENTURE/
# but at /usr/local/ADVENTURE/

sudo aptitude install \
g++-4.1 libc6-dev libstdc++6-4.1-dev linux-libc-dev \
gcc-2.95 gcc-2.95-doc \
cpp-2.95 g++-2.95 gcc-2.95 gcc-2.95-doc libstdc++2.10-dev libstdc++2.10-glibc2.2

sudo aptitude install \
libx11-dev libxau-dev libxdmcp-dev libxp-dev x11proto-core-dev \
x11proto-input-dev x11proto-kb-dev x11proto-print-dev xtrans-dev

sudo aptitude install \
libmotif-dev libmotif3

sudo aptitude install \
compiz compiz-core compiz-dev \
libgl1-mesa-dev libice-dev libpng12-dev libsm-dev libstartup-notification0-dev libxcomposite-dev libxcursor-dev \
libxdamage-dev libxext-dev libxfixes-dev libxinerama-dev libxrandr-dev libxrender-dev mesa-common-dev x11proto-composite-dev \
x11proto-damage-dev x11proto-fixes-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev zlib1g-dev

sudo aptitude install \
compiz-gnome compiz-gtk compiz-kde compiz-plugins

compiz-kde kdelibs-data kdelibs4c2a kwin libakode2 libarts1-akode libarts1c2a libartsc0 libavahi-qt3-1 libdbus-qt-1-1c2 liblua50
liblualib50 liboggflac3 libopenexr2c2a libpcre3 libqt3-mt libsamplerate0 perl-suid

sudo aptitude install \
cfortran gfortran gfortran-4.1 gfortran-4.1-doc gfortran-doc \
lib64gfortran1 libgfortran1 libgfortran1-dev \
libplplot-fortran9

sudo aptitude install \
freeglut3-dbg freeglut3-dev glut-doc glutg3 glutg3-dev libglut3-dev \
xserver-xorg-dev libxxf86dga1-dev

sudo aptitude install \
mpich-bin libmpich-mpd1.0-dev libmpich-mpd1.0c2 libmpich-shmem1.0-dev \
libmpich-shmem1.0c2 libmpich1.0-dev libmpich1.0c2 \
libhdf5-mpich-1.6.5-0 libhdf5-mpich-dev
sudo ldconfig
sudo updatedb
export JMB_TMP_INSTALL_DIR=~/Adventure

mkdir $JMB_TMP_INSTALL_DIR
cd $JMB_TMP_INSTALL_DIR

# IMPORTANT ***********************************************
# Install Adventure as some "user" NOT as "root" ***********
# *********************************************************
# In the Makefile's if you change some portions, install ADVENTURE using priviledge of
# root is OK. In some modules you can designate install directory as an option of ./configure.
# For example
# Not at ~/ADVENTURE/
# but at /usr/local/ADVENTURE/

# 1. install gcc 2.95
sudo aptitude install gcc-2.95 gcc-2.95-doc g++-2.95 g++-2.95-doc libstdc++2.10-dev libstdc++2.10-glibc2.2
# 2. install X Windows development packages.
# 3. install libxp-dev packages.
sudo aptitude install libxp-dev
# 4. Compiling Lesstif
cd /home/LinuxDownLoads
wget -nd http://downloads.sourceforge.net/lesstif/lesstif-0.95.0.tar.gz
gunzip -cd /home/LinuxDownLoads/lesstif-0.95.0.tar.gz | tar -xvf -
cd lesstif-0.95.0
./configure --prefix=/usr/local
make
sudo make install
cd ..

# 5. Compiling Mesa
cd /home/LinuxDownLoads
wget -nd http://downloads.sourceforge.net/mesa3d/MesaLib-7.0.1.tar.gz
wget -nd http://downloads.sourceforge.net/mesa3d/MesaLib-6.5.3.tar.gz
gunzip -cd /home/LinuxDownLoads/MesaLib-6.5.3.tar.gz | tar -xvf -
cd Mesa-6.5.3
gedit src/glw/Makefile & # <------ (*1)
# Change src/glw/Makefile as follows.
# ----- BEGIN OF FILE -----------
# .....................
# .....................
INCDIRS = -I$(TOP)/include -I/usr/local/include $(X11_INCLUDES)
# .....................
# .....................
# ----- END OF FILE -----------

make linux-x86
sudo make install
sudo ldconfig /usr/local/lib/
cd ..

# **************************
# Unpack modules in: AdvBase
# **************************
# Contains the basic modules: ADVENTURE_Solid*, ADVENTURE_Metis*, ADVENTURE_IO*,
# ADVENTURE_TriPatch*, ADVENTURE_TetMesh*, ADVENTURE_BCtool*, ADVENTURE_Visual
# * Indicates: Successfully compiled on Ubuntu6

gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvBaseSourcePack-1.9.tar.gz | tar -xvf -
mv AdvBaseSourcePack-1.9/*.gz $JMB_TMP_INSTALL_DIR ; rm -fr AdvBaseSourcePack-1.9
cd $JMB_TMP_INSTALL_DIR

# ***************************************
# Install module: AdvIO
# ***************************************
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvIO-1.2.tar.gz | tar -xvf -
cd AdvIO-1.2
./configure
# checking host system type... configure: error: can not guess host type; you must specify one
# Fix: sudo aptitude install g++

# checking for GTK - version >= 1.1.14... no
# *** The gtk-config script installed by GTK could not be found
# *** If GTK was installed in PREFIX, make sure PREFIX/bin is in
# *** your path, or set the GTK_CONFIG environment variable to the
# *** full path to gtk-config.
# cannot find gtk (>=1.1.14)
#
# The current version of AdvIO does not use GTK.. So ignore the error message!

make
make install # Success! :)
cd ..

# Header files and libraries will be installed in:
#
# /include/Adv
# /lib
#
# When you compile a program which uses AdvIO,
# an include path and a library path should be specified:
#
# -I/include -L/lib
#
# In the program and links, the following usage is assumed.
#
# #include
# -lAdvDocIO -lAdvFileIO -lAdvBase
#
# The above options can be obtained easily by using a script "advsys-config",
# which will be installed in /bin.
# The execution outputs a suitable include path (-I).
#
# % advsys-config --cflags
#
# Execution of the following command outputs a suitable library
# path (-L and -l):
#
# % advsys-config --libs
#
# Where the category can be selected from:
#
# base
# fileio
# docio
#

~/ADVENTURE/bin/advsys-config --cflags --libs base fileio docio
# Output:
# -I~/ADVENTURE/include
# -L~/ADVENTURE/lib -lAdvDocIO -lAdvFileIO -lAdvBase

# Your program can be compiled in the following way using "advsys-config".
# For example:
#
# % cc prog.c `advsys-config --cflags --libs docio` ...
cd $JMB_TMP_INSTALL_DIR

# **************************
# Install module: AdvBCTool
# **************************

gunzip -cd AdvBCtool-1.02.tar.gz | tar -xvf -
cd $JMB_TMP_INSTALL_DIR/AdvBCtool-1.02
gedit Makefile &
gedit src/bcGUI/Makefile &

# For Ubuntu (Feisty) make the changes mentioned below ...
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Please change AdvBCtool-1.02/Makefile as follows.

# ----- BEGIN OF FILE -----------
# .....................
# .....................
# CXX = g++-2.95
# CXXFLAGS = -O3
# GL_INC = -I/usr/local/include
# GL_LIB = -L/usr/local/lib
# X11_INC = -I/usr/include/X11
# X11_LIB = -L/usr/lib/X11
# MOTIF_INC = -I/usr/local/include
# MOTIF_LIB = -L/usr/local/lib
# GLWFLAGS = -DGLW_HDR_ANOTHER_LOCATION -DnoMotifGLwidget
# GLW = -lGLw
# .....................
# .....................
# ----- END OF FILE -----------

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

make
make install # Success! :)
cd ..

# **************************
# Install module: AdvMetis
# **************************
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvMetis-1.1.tar.gz | tar -xvf -
cd AdvMetis-1.1
./configure
make
make install # Success! :)
cd ..

# **************************
# Install module: AdvSolid
# **************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvSolid-1.1.tar.gz | tar -xvf -
cd AdvSolid-1.1
./configure
make
make install # Success! :)
cd ..

# ***************************************
# Install module: AdvTetMesh - TetMesh_P
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvTetMesh-0.91b.tar.gz | tar -xvf -
cd AdvTetMesh-0.91b/TetMesh_P
gedit Makefile &

# For (Feisty 7.04)
# Change to:
# F90 = gfortran
# FFLAGS = -static
# # LDFLAGS = -non_shared # Commented out, since -non_shared is not understood by gfortran)
make
make install # Success! :)

# ***************************************
# Install module: AdvTetMesh - TetMesh_M
# ***************************************
# One needs the modified sources (See comments for this posting)
# for compilation to be successful, other wise one will get errors:
# bucketTable.h: In member function ‘virtual void BucketTable3D::indicesAt(const Vector3D&, int&, int&, int&)’:
# bucketTable.h:56: error: no matching function for call to ‘divide(Vector3D, Vector3D&)’
# bucketTable.h: In member function ‘virtual void BucketTable2D::indicesAt(Vector2D&, int&, int&)’:
# bucketTable.h:156: error: no matching function for call to ‘divide(Vector2D, Vector2D&)’
# make: *** [bucketTable.o] Error 1

cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/mshome/ADVTetMesh-0.91b_mod.tar.gz | tar -xvf -
cp TetMesh_M/* $JMB_TMP_INSTALL_DIR/AdvTetMesh-0.91b/TetMesh_M
cp TetMesh_E/* $JMB_TMP_INSTALL_DIR/AdvTetMesh-0.91b/TetMesh_E
cd $JMB_TMP_INSTALL_DIR/AdvTetMesh-0.91b/TetMesh_M
make
make install # Success! :)

# ***************************************
# Install module: AdvTetMesh - TetMesh_S
# ***************************************
cd ../TetMesh_S
make
make install # Success! :)

# ***************************************
# Install module: AdvTetMesh - TetMesh_E
# ***************************************
# One needs the modified sources (See comments for this posting)
# for compilation to be successful, otherwise one will get errors:
# Error:
# g++ -Wall -O amk_mesh_ev.cpp -I. -c
# bucketTable.h: In member function ‘virtual void BucketTable3D::indicesAt(const Vector3D&, int&, int&, int&)’:
# bucketTable.h:57: error: no matching function for call to ‘divide(Vector3D, Vector3D&)’
# bucketTable.h: In member function ‘virtual void BucketTable2D::indicesAt(Vector2D&, int&, int&)’:
# bucketTable.h:153: error: no matching function for call to ‘divide(Vector2D, Vector2D&)’
# make: *** [amk_mesh_ev.o] Error 1

cd ../TetMesh_E
make
make install # Success! :)
cd ../../

# ***************************************
# Install module: AdvTriPatch
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvTriPatch-1.8.tar.gz | tar -xvf -
cd AdvTriPatch-1.8
./configure
make

mv ./doc/developers-jp.pdf ./doc/developer-jp.pdf
# Otherwise you get an error: "install: ./doc/developer-jp.pdf does not exist"
make install # Success! :)
cd ..

# ***************************************
# Install module: AdvVisual
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd $JMB_TMP_INSTALL_DIR/AdvVisual-1.0.tar.gz | tar -xvf -
cd $JMB_TMP_INSTALL_DIR/AdvVisual-1.0/server

# ./configure --with-advio=
./configure --with-advio=~/ADVENTURE/bin/

gedit $JMB_TMP_INSTALL_DIR/AdvVisual-1.0/server/Makefile &
# Change AdvVisual-1.0/server/Makefile as follows.
# CXX = g++-2.95
# INSTALL = /usr/bin/install -c # <==== was "$/usr/bin/install -c"

make # Success! :)
make install

# If you get the error:
# make[1]: Entering directory `/tmp/AdvBaseSourcePack-1.9/AdvVisual-1.0/server'
# /bin/sh ./mkinstalldirs /usr/local/bin
# usr/bin/install -c advvis_server /usr/local/bin/advvis_server
# /bin/sh: usr/bin/install: not found
# make[1]: *** [install-binPROGRAMS] Error 127
# make[1]: Leaving directory `/tmp/AdvBaseSourcePack-1.9/AdvVisual-1.0/server'
# make: *** [install-am] Error 2
# --------------------------------------------------------------
# To fix this make the change to the Makefile as shown above!!!
# --------------------------------------------------------------

wget -nd http://downloads.sourceforge.net/mesa3d/MesaLib-6.5.3.tar.gz
gunzip -cd MesaLib-6.5.3.tar.gz | tar -xvf -
cd Mesa-6.5.3
gedit src/glw/Makefile &
# Change src/glw/Makefile as follows.
# INCDIRS = -I$(TOP)/include -I/usr/local/include $(X11_INCLUDES)

make linux-x86
sudo make install
sudo ldconfig /usr/local/lib/

cd ../client
gedit $JMB_TMP_INSTALL_DIR/AdvVisual-1.0/client/Makefile &
# Change AdvVisual-1.0/client/Makefile
# from "-lMesaGLw" to "-LGLw" and "g++" to "g++-2.95"
# ----- BEGIN OF FILE -----------
# MAKE = make
#
# all :
# ${MAKE} -f Build.mk \
"MAKE = ${MAKE}" "CC = g++-2.95" \
"CFLAGS = -DNDEBUG -Wall -O2" \
"ADD_INC = -I/usr/local/include " \
"LIBDIR = -L/usr/local/lib " \
"LIBS = -lGLw -lGLU -lGL -lXm -lXp -lXt -lX11 -lXext -lpthread -lm"
# clean :
# ${MAKE} -f Build.mk clean
# ----- END OF FILE -----------

make # Success! :)
cp advvis ~/ADVENTURE/bin

# To run:
~/ADVENTURE/bin/advvis &

cd ../../

# ***************************************
# Install module: AdvMaterial
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvMaterial-0.8b.tar.gz | tar -xvf -
mv $JMB_TMP_INSTALL_DIR/AdvMaterial-0.8b ~/ADVENTURE

# To run it:
cd ~/ADVENTURE/AdvMaterial-0.8b/classes
java Main # Works! :)

# ***************************************
# Install module: AdvImpact
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvImpact-0.83b.tar.gz | tar -xvf -
cd AdvImpact-0.83b/source
make
make install # Success! :)

# ***************************************
# Install module: AdvForge
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvForge-0.4b.tar.gz | tar -xvf -
cd AdvForge-0.4b/src
make
make install # Success! :)

# ***************************************
# Install module: AdvThermal
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvThermal-1.0.tar.gz | tar -xvf -
cd AdvThermal-1.0
./configure
make
make install # Success! :)

# ***************************************
# Install module: AdviAgent
# ***************************************
# ADVENTURE_iAgent Ver. 0.42 (beta) supports the following ADVENTURE
# modules, which should be installed in advance.
#
# ADVENTURE_TriPatch (V1.8)
# ADVENTURE_TetMesh (V0.9b)
# ADVENTURE_BCtool (V1.02)
# ADVENTURE_Metis (V1.0)
# ADVENTURE_Solid (V1.1)
# ADVENTURE_Thermal (V0.5b)
# ADVENTURE_Visual (V1.0)
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvIAgent-0.42b.tar.gz | tar -xvf -
cd AdvIAgent-0.42b
./install # Success! :)

iAgent-e


# ***************************************
# Install module: AdvOpt
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvOpt-0.1b.tar.gz | tar -xvf -
cd AdvOpt-0.1b
cd SQP/src
make
mkdir ~/bin
make install # Success! :)

# To run:
~/bin/adv_opt_sqp
# Error: Can't Open "adv_sqp_in.dat" !!
# But these are in AdvOpt-0.1b/SQP/usr/shape3d_L/data/adv_sqp_in.dat &
# AdvOpt-0.1b/SQP/usr/rosenbrock_n/data/adv_sqp_in.dat

cd ../../RealGA/src

gedit Makefile &
# Uncomment the first line and comment out the second line
# BINDIR = $(HOME)/bin
# #BINDIR = .

make
make install # Success! :)

# ***************************************
# Install module: AdvMagnetic
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvMagnetic-1.2.tar.gz | tar -xvf -
cd AdvMagnetic-1.2
make
make install # Success! :)

# ***************************************
# Install module: AdvFluid
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvFluid-0.41b.tar.gz | tar -xvf -
cd AdvFluid-0.41b
./configure
make
make install # Success! :)

# ***************************************
# Install module: AdvFEMAPtool
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvFEMAPtool-1.2.tar.gz | tar -xvf -
cd AdvFEMAPtool-1.2
cd nas2adv
make # Success! :)
cp nas2adv ~/ADVENTURE/bin

# To run: nas2adv Nastran-input ADV-mesh

cd ../adv2femap
make # Success! :)
cp adv2femap ~/ADVENTURE/bin
# To run: adv2femap [-o outputfile][-h] ADVinputfile resultfile1 resultfile2 ...

# ***************************************
# Install module: AdvShape
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvShape-0.11b.tar.gz | tar -xvf -
cd AdvShape-0.11b
gedit Makefile &
# Set the absolute path to the top directory, which contains the script "advsys-config"
# of the ADVENTURE_IO library.
# ADVSYSDIR = $(HOME)/ADVENTURE/bin

gedit $JMB_TMP_INSTALL_DIR/AdvShape-0.11b/src/azlibADV/adv_component.c &
# Change
# default :
# To:
# default : ;
make
make install # Success! :)

# ***************************************
# Install module: AdvFlow
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvsFlow-0.11b.tar.gz | tar -xvf -
cd AdvsFlow-0.11b

gedit $JMB_TMP_INSTALL_DIR/AdvsFlow-0.11b/tool/pre/cavity_pre.c &
# The printf line is split into two lines, so merge it into one line as shown below:
# printf( "Usage: advmodel \n" );

make
make install # Success! :)

# ***************************************
# Install module: AdvAuto - a toolkit to automate ADVENTURE
# ***************************************
cd $JMB_TMP_INSTALL_DIR
gunzip -cd /home/LinuxDownLoads/FEA/Adventure/AdvAuto-0.11b.tar.gz | tar -xvf -
cd AdvAuto-0.11b
cd autogl
cd lib
# gedit Makefile &
# Modify variable PLATFORM. (No changes needed if the PC is running Linux)
make # Failed! :(
# gcc -c autogl_gui_gtk.c `gtk-config --cflags` -O
# autogl_gui_gtk.c:27:29: error: gtkgl/gtkglarea.h: No such file or directory
# autogl_gui_gtk.c: In function ‘MakeView’:
# autogl_gui_gtk.c:492: error: ‘GDK_GL_RGBA’ undeclared (first use in this function)
# autogl_gui_gtk.c:492: error: (Each undeclared identifier is reported only once
# autogl_gui_gtk.c:492: error: for each function it appears in.)
# autogl_gui_gtk.c:493: error: ‘GDK_GL_DOUBLEBUFFER’ undeclared (first use in this function)
# autogl_gui_gtk.c:494: error: ‘GDK_GL_DEPTH_SIZE’ undeclared (first use in this function)
# autogl_gui_gtk.c:495: error: ‘GDK_GL_NONE’ undeclared (first use in this function)
# make: *** [autogl_gui_gtk.o] Error 1

# If you want to have different AutoGL install directories,
# copy all the header files (*.h) and archive files (*.a) to
# any directories you want.

# Compile AutoGL sample programs (if you want).
cd sample_c
make # Failed! :(
sample_cpp
make # Failed! :(
sample_f
make # Failed! :(

autogl_command

# To run read the instructions in:
less AdvAuto-0.11b/README

Monday, June 11, 2007

Help wanted!

I am trying to compile Adventure from sources on the same Ubuntu (Feisty Fawn 7.04) PC but have run into some problems. Anybody willing to co-operate or help out? Please contact me.