Building the getfem++-3.1 interface for Matlab 2007b on Windows XP 32bit

Here I describe how I built the getfem_toolbox. This description is based on the original readme. I hope it is helpful. Feel free to correct this description!

Prerequisites

Building and Installing the Matlab Interface

  • Download the latest release getfem++ (here 3.1 is described): http://home.gna.org/getfem/download.html
  • Untar it to $HOME/getfem++-3.1/
  • Open the msys shell, untar and configure and compile it with the following commands (no need to do a „make install“):
    ./configure --enable-matlab=yes --with-getfem-config=$HOME/getfem++-3.1/getfem-config-notinstalled --with-toolbox-dir=$HOME/getfem_toolbox
    make
  • Ensure that you have mex.bat in the PATH. If necessary, add the path to this file for example with:
    export PATH=/c/Program\ Files/MATLAB/R2007b/bin:$PATH
  • It should build fine until the „mex“ stage. At this point the script will fail, it is expected. Build the mex by hand, in a windows shell (not msys)
    1. use short DOS names (i.e. c:\Progra~1 etc) as the mex.bat of matlab does not handle spaces in file names
    2. add the -D“MATLAB_RELEASE=14“ option
    3. I did use the following command to build the gf_matlab.mexw32 (<YOUR_MSYS_USER> must be replaced):
      cd getfem++-3.1/interface/src/matlab
      "c:/Progra~1/MATLAB704/bin/win32/mex.bat" -v -f c:/path/to/mexopts.bat -output gf_matlab -g -D"MATLAB_RELEASE=14" ./gfm_mex.c ./gfm_common.c -I. -I.. ./../gfi_array.c ../.libs/libgetfemint.a C:/msys/1.0/home/<YOUR_MSYS_USER>/getfem++-2.0/src/.libs/libgetfem.a c:/MinGW/lib/libstdc++.a
    4. If you have set up Matlab correctly for gnumex (http://gnumex.sourceforge.net/#matlab_steps) you can use this from within the MATLAB shell (<YOUR_MSYS_USER> must be replaced):
      cd getfem++-3.1/interface/src/matlab
      mex -v -output gf_matlab -g -D"MATLAB_RELEASE=14" ./gfm_mex.c ./gfm_common.c -i.html">I. -i.html">I.. ./../gfi_array.c ../.libs/libgetfemint.a C:/msys/1.0/home/<YOUR_USERNAME>/getfem++-3.1/src/.libs/libgetfem.a c:/MinGW/lib/libstdc++.a
  • Finally go back in msys and type „make install“. Everything is available in c:\msys\1.0\home\<YOUR_MSYS_USER>\getfem_toolbox
  • Open Matlab, go to
    1. File > Set Path… > Add Folder… >
    2. Choose „c:\msys\1.0\home\<YOUR_MSYS_USER>\getfem_toolbox“
    3. Ok > Save > Close. Now you are ready to work with getfem++ in Matlab.

Remarks

When using the graphical interface of matlab, a number of intermediate messages of getfem get lost (for example those displaying the progression of iterative solvers). You may want to launch matlab from the msys shell instead of launching it from its shortcut. In that case, those intermediate messages from getfem will be displayed in the msys window.

Building getfem++ from SVN on Ubuntu Jaunty 64bit for Matlab 2007b or 2008a

That's what I did - might be incomplete etc.

# Determine MATLAB directory, mex must be in the PATH.
MATLAB_ROOT=`mex -v 2>&1 | grep "MATLAB " | awk '{print $4}' | sed -e '2,$d'`
# May be thats not all you need
sudo apt-get install build-essential subversion libtool
# Get the sources
svn co http://svn.gna.org/svn/getfem/trunk getfem
cd getfem/getfem++/
./autogen.sh
./configure --enable-matlab --with-pic --with-matlab-toolbox-dir=$MATLAB_ROOT/toolbox/getfem_toolbox
make && make check
# If all checks passed do
sudo make install
 
# Add the path to the matlab path definitions file
echo "p=[matlabroot,'/toolbox/getfem_toolbox:',p];" | sudo tee -a $MATLAB_ROOT/toolbox/local/pathdef.m
 
# Then I had to move the old libraries to a different folder to make matlab use the newer ones from ubuntu
cd $MATLAB_ROOT/sys/os/glnxa64/
sudo mkdir old
sudo mv libstdc* libgcc_s* old/.
 
# If you see an empty output, the path should be added correctly
$MATLAB_ROOT/bin/matlab -nojvm -nosplash -r "gf_workspace('clear'); exit;"
 
getfem.txt · Zuletzt geändert: 31.07.2009 15:01 von 192.124.26.250
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki