dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #00047
Installing dolfin with gcc-3.4.1
Installing Dolfin in Gentoo-Linux 2004.2 kernel 2.4.26-gentoo-r6
Installing dolfin with g++
--------------------------
1) when using g++-3.3.3 (Gentoo Distribution 2004.2)
localhost dolfin-0.4.11 # gcc --version
gcc (GCC) 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
There is not problem!
Everything is fine!
2) when using g++-3.4.1, the latest version downloaded and installed
from http://gcc.gnu.org we get the following errors:
---------------
#export CXX=g++-3.4.1
#export CPPFLAGS='-O3 -funroll-loops -march=athlon-xp -fomit-frame-pointer'
#./configure
#make
**************************
Function.cpp: In member function `dolfin::real dolfin::Function::abs(const
dolfin::Node&, dolfin::real)':
Function.cpp:133: error: `fabs' undeclared (first use this function)
Function.cpp:133: error: (Each undeclared identifier is reported only once for
each function it appears in.)
Function.cpp: In member function `dolfin::real dolfin::Function::abs(const
dolfin::Point&, dolfin::real)':
Function.cpp:138: error: `fabs' undeclared (first use this function)
Function.cpp: In member function `dolfin::real
dolfin::Function::abs(dolfin::real, dolfin::real, dolfin::real, dolfin::real)':
Function.cpp:143: error: `fabs' undeclared (first use this function)
Function.cpp: In member function `dolfin::real dolfin::Function::abs(unsigned
int, dolfin::real)':
Function.cpp:148: error: `fabs' undeclared (first use this function)
make[4]: *** [Function.o] Error 1
make[4]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel/function'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel/function'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/dolfin-0.4.11/src'
make: *** [all-recursive] Error 1
***************************
This error can be corrected by opening the file ...
---------------------------
#emacs /usr/local/src/dolfin-0.4.11/src/kernel/function/Function.cpp and adding
#include <cmath>
under
#include <dolfin/ODEFunction.h>
such that the include statements are as follows:
#include <dolfin/dolfin_settings.h>
#include <dolfin/Point.h>
#include <dolfin/Cell.h>
#include <dolfin/Mesh.h>
#include <dolfin/ElementFunction.h>
#include <dolfin/FiniteElement.h>
#include <dolfin/GenericFunction.h>
#include <dolfin/DofFunction.h>
#include <dolfin/ExpressionFunction.h>
#include <dolfin/ScalarExpressionFunction.h>
#include <dolfin/VectorExpressionFunction.h>
#include <dolfin/ODEFunction.h>
#include <dolfin/Function.h>
----------------------------
Then if we type make again
#make
we get another error ...
***************************
ReducedModel.cpp:207: error: `fabs' undeclared (first use this function)
ReducedModel.cpp:207: error: (Each undeclared identifier is reported only once
for each function it appears in.)
make[4]: *** [ReducedModel.o] Error 1
make[4]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel/ode'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel/ode'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/kernel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/dolfin-0.4.11/src'
make: *** [all-recursive] Error 1
****************************
Going on the same way as before we open the file
#emacs /usr/local/src/dolfin-0.4.11/src/kernel/ode/ReducedModel.cpp
and adding
#include <cmath>
under
#include <dolfin/ReducedModel.h>
such that the #include statements are as follows:
#include <dolfin/dolfin_settings.h>
#include <dolfin/ReducedModel.h>
#include <cmath>
we are finished!
------------------------------------------
------------------------------------------
An Alternative
------------------------------------------
------------------------------------------
Since the above files have in common the .h file dolfin_settings.h
and since dolfin_settings.h is to include some other important files
localhost dolfin-0.4.11 # more src/kernel/settings/dolfin/dolfin_settings.h
#ifndef __DOLFIN_SETTINGS_H
#define __DOLFIN_SETTINGS_H
/// DOLFIN settings
#include <dolfin/Parameter.h>
#include <dolfin/ParameterList.h>
#include <dolfin/SettingsMacros.h>
#endif
we can add #include <cmath> right below
#include <dolfin/SettingsMacros.h>
such that the file dolfin_settings.h becomes:
#ifndef __DOLFIN_SETTINGS_H
#define __DOLFIN_SETTINGS_H
/// DOLFIN settings
#include <dolfin/Parameter.h>
#include <dolfin/ParameterList.h>
#include <dolfin/SettingsMacros.h>
#include <cmath>
#endif
Now the compiler will not complain a second time!
-------------------------------------------------------------------------------
- DOLFIN successfully compiled -
If you have reached this far, this is a good indication that the compilation
was successful. The next thing you want to do is probably to try out some of
the demo programs in the sub-directory src/demo/.
To improve future releases of DOLFIN, any feedback or suggestions are very much
appreciated. Send any comments to dolfin@xxxxxxxxxxxxxxxx.
If you like, you can try to type the following command:
uname -a | mail -s 'DOLFIN 0.4.11 installed' dolfin@xxxxxxxxxxxxxxxx
This will send an email with the output of 'uname -a' to the above address,
which will help to give us an indication of the platforms on which people
have successfully compiled DOLFIN. Should you be worried about the information
you send, type 'uname -a' first to see what it does. The output should be
something like
Linux elrond 2.4.19 #4 tis aug 27 09:33:15 CEST 2002 i686 GNU/Linux
SunOS mathtest4 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-5_1
Enjoy!
-------------------------------------------------------------------------------
make[2]: Leaving directory `/usr/local/src/dolfin-0.4.11/src/greeting'
make[2]: Entering directory `/usr/local/src/dolfin-0.4.11/src'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/usr/local/src/dolfin-0.4.11/src'
make[1]: Leaving directory `/usr/local/src/dolfin-0.4.11/src'
make[1]: Entering directory `/usr/local/src/dolfin-0.4.11'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/local/src/dolfin-0.4.11'
That's all!
References