CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

Install Optional Packages from Ubuntu 12.10 Repositories

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By atg

Reply
 
LinkBack Thread Tools Display Modes
Old   March 9, 2013, 17:48
Default Install Optional Packages from Ubuntu 12.10 Repositories
  #1
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 8
mgdenno is on a distinguished road
Hi All,

I am wondering if installing the optional gmp, mpfr, mpc, cgal and boost from the repositories instead of from source works for OpenFOAM? The current versions are:

libgmp-dev (2:5.0.2+dfsg-2ubuntu1 Ubuntu:12.04/precise [amd64])
libmpfr-dev (3.1.0-3ubuntu2 Ubuntu:12.04/precise [amd64])
libgmp-dev (2:5.0.2+dfsg-2ubuntu1 Ubuntu:12.04/precise [amd64])
libboost1.46-dev (1.46.1-7ubuntu3 Ubuntu:12.04/precise [amd64])
libcgal8 (3.9-1build1 Ubuntu:12.04/precise [amd64])

Looks like maybe some values in settings.sh might need to be adjusted? But I have never ventured this far beyond the standard install procedure.

Edit: It is easy enough to just try to install this packages and compile, but how can I tell it it worked when it compiles without them to begin with?

MD
mgdenno is offline   Reply With Quote

Old   March 9, 2013, 19:31
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,215
Blog Entries: 35
Rep Power: 94
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Matthew,

According to Bernhard:
Quote:
Originally Posted by gschaider View Post
- boost and cgal (these are optional. If found they will be used for surfaceExtractFeatures).
As for GMP, MPFR and MPC, these are usually only necessary for building GCC.

Best regards,
Bruno
__________________
___
I'll be at OFW11 in Portugal
wyldckat is offline   Reply With Quote

Old   March 10, 2013, 13:51
Default
  #3
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 8
mgdenno is on a distinguished road
Bruno,

Thanks for your input. That post by Bernhard was what got me thinking about CGAL and OpenFOAM. I have worked with the CGAL libraries for a different project and was interested about using them with OF.

I installed CGAL from the repositories, but it says that it is compiling without CGAL curvature support, but does include a line "-ICGALPolyhedron"

From my make.log:
Code:
+ [ -n  ]
+ echo

+ echo Compiling surfaceFeatureExtract without CGAL curvature support
Compiling surfaceFeatureExtract without CGAL curvature support
+ echo

+ wmake
make[2]: Entering directory `/home/matt/OpenFOAM/OpenFOAM-2.2.0/applications/utilities/surface/surfaceFeatureExtract'
Making dependency list for source file surfaceFeatureExtract.C
make[2]: Leaving directory `/home/matt/OpenFOAM/OpenFOAM-2.2.0/applications/utilities/surface/surfaceFeatureExtract'
make[2]: Entering directory `/home/matt/OpenFOAM/OpenFOAM-2.2.0/applications/utilities/surface/surfaceFeatureExtract'
SOURCE=surfaceFeatureExtract.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100    -Wno-old-style-cast -I/include -I/include -I/include -I/include -ICGALPolyhedron -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/edgeMesh/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/triSurface/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/surfMesh/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/sampling/lnInclude -IlnInclude -I. -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/surfaceFeatureExtract.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100    -Wno-old-style-cast -I/include -I/include -I/include -I/include -ICGALPolyhedron -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/edgeMesh/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/triSurface/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/surfMesh/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/sampling/lnInclude -IlnInclude -I. -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/matt/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/surfaceFeatureExtract.o -L/home/matt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/lib \
             -L/lib -L/lib -L/lib       -lmeshTools -ledgeMesh -ltriSurface -lsampling -lOpenFOAM -ldl   -lm -o /home/matt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/surfaceFeatureExtract
make[2]: Leaving directory `/home/matt/OpenFOAM/OpenFOAM-2.2.0/applications/utilities/surface/surfaceFeatureExtract'
I am wondering if I need to change my etc/config/settings.sh file to reflect the correct versions of boost and CGAL. Looks like I have CGAL 3.9 and Boost 1.46.1 from the repos. I found this with grep but don't fully understand how it all works.

Code:
# boost and CGAL
# ~~~~~~~~~~~~~~

boost_version=boost_1_45_0
cgal_version=CGAL-4.0

export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version

# enabled if CGAL is available
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
    echo "Checking for"
    echo "    $cgal_version at $CGAL_ARCH_PATH"
    echo "    $boost_version at $BOOST_ARCH_PATH"
fi

if [ -d "$CGAL_ARCH_PATH" ]
then
    if [ -d "$BOOST_ARCH_PATH" ]
    then
        _foamAddLib $BOOST_ARCH_PATH/lib
    else
        unset BOOST_ARCH_PATH
    fi
    _foamAddLib $CGAL_ARCH_PATH/lib
else
    unset BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH GMP_ARCH_PATH
fi

unset boost_version cgal_version
mgdenno is offline   Reply With Quote

Old   March 10, 2013, 14:31
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,215
Blog Entries: 35
Rep Power: 94
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Matthew,

I haven't tried this yet, but the following massive hack will probably be necessary (or similar):
Code:
export BOOST_ARCH_PATH=/usr/include/boost
export CGAL_ARCH_PATH=/usr/include/CGAL

#this one probably won't be needed
_foamAddLib /usr/lib
You can either replace the other bunch of code, or simply place these lines after the last "unset" line.

Wait... this is only the tip of the iceberg

You also need to hack the following files:
And you should confirm that "lapack" and "blas" are also installed!

Best regards,
Bruno
__________________
___
I'll be at OFW11 in Portugal
wyldckat is offline   Reply With Quote

Old   March 11, 2013, 13:59
Default
  #5
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 8
mgdenno is on a distinguished road
Thanks Bruno,

I made the changes that you suggested and it seems to have compiled without errors but I haven't tried to use it yet. I will try this evening and report back.

MD
mgdenno is offline   Reply With Quote

Old   April 22, 2014, 22:19
Default
  #6
atg
Member
 
Karl
Join Date: Jan 2011
Posts: 36
Rep Power: 7
atg is on a distinguished road
--edit--

Well, I have to temper my enthusiasm. It attempted to compile, and reported that it found all the libraries, but when the time came to build surfaceFeatureExtract, it appears to have failed with the following error (see below). Something about the wrong number of arguments and a missing "initializer". So it looks like the "Monge" related variables are missing (I have no idea what they are or if they are necessary to get SurfaceFeatureExtract to work, so I need to do some homework). Maybe I need a different version of CGAL?

Code:
make[2]: `/home/karl/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64GccDPOpt/bin/surfaceToPatch' is up to date.
surfaceFeatureExtract.C: In function ‘Foam::scalarField calcCurvature(const Foam::triSurface&)’:
surfaceFeatureExtract.C:85:47: error: wrong number of template arguments (1, should be 3)
/usr/local/include/CGAL/Monge_via_jet_fitting.h:56:9: error: provided for ‘template<class DataKernel, class LocalKernel, class SvdTraits> class CGAL::Monge_via_jet_fitting’
surfaceFeatureExtract.C:85:78: error: invalid type in declaration before ‘;’ token
surfaceFeatureExtract.C:86:57: error: expected initializer before ‘Monge_form’
make[2]: `/home/karl/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64GccDPOpt/bin/surfaceTransformPoints' is up to date.
surfaceFeatureExtract.C:148:9: error: ‘Monge_form’ was not declared in this scope
surfaceFeatureExtract.C:148:20: error: expected ‘;’ before ‘monge_form’
surfaceFeatureExtract.C:164:21: error: ‘monge_form’ was not declared in this scope
surfaceFeatureExtract.C:146:31: warning: unused variable ‘monge_fit’ [-Wunused-variable]
surfaceFeatureExtract.C:92:18: warning: unused variable ‘d_monge’ [-Wunused-variable]
make[2]: *** [Make/linux64GccDPOpt/surfaceFeatureExtract.o] Error 1
make[2]: Target `/home/karl/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64GccDPOpt/bin/surfaceFeatureExtract' not remade because of errors.
make[1]: *** [surfaceFeatureExtract] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [surface] Error 2
make: Target `application' not remade because of errors.
This is the part where it finds the libraries, which seems to have worked:

Code:
make[3]: `/home/karl/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64GccDPOpt/bin/createPatch' is up to date.
+ [ -n /usr/include/CGAL ]
+ echo

+ echo Compiling surfaceFeatureExtract with CGAL curvature support
Compiling surfaceFeatureExtract with CGAL curvature support
+ echo

+ wmake ENABLE_CURVATURE=-DENABLE_CURVATURE            EXE_FROUNDING_MATH=-frounding-math            USE_F2C=-DCGAL_USE_F2C            CGAL_LIBDIR=-L/usr/lib            LAPACK_LIB=-llapack            BLAS_LIB=-lblas            CGAL_LIB=-lCGAL            CGAL_BOOST_LIB=-lboost_thread            CGAL_MPFR_LIB=-lmpfr
Quote:
Originally Posted by wyldckat View Post
Hi Matthew,

I haven't tried this yet, but the following massive hack will probably be necessary (or similar):
Code:
export BOOST_ARCH_PATH=/usr/include/boost
export CGAL_ARCH_PATH=/usr/include/CGAL

#this one probably won't be needed
_foamAddLib /usr/lib
You can either replace the other bunch of code, or simply place these lines after the last "unset" line.

Wait... this is only the tip of the iceberg

You also need to hack the following files:
And you should confirm that "lapack" and "blas" are also installed!

Best regards,
Bruno
atg is offline   Reply With Quote

Old   April 25, 2014, 14:51
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,215
Blog Entries: 35
Rep Power: 94
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Karl,

Any chance you can switch to OpenFOAM 2.3.0 or 2.3.x instead? Because OpenFOAM 2.3 is better connected to CGAL and Boost.

If not, I'll need more information, namely which CGAL version you're using and which Ubuntu version.
And those paths "/usr/local/include/" seem to indicate that you're using a custom build of CGAL?

Best regards,
Bruno
__________________
___
I'll be at OFW11 in Portugal
wyldckat is offline   Reply With Quote

Old   April 25, 2014, 15:08
Default
  #8
atg
Member
 
Karl
Join Date: Jan 2011
Posts: 36
Rep Power: 7
atg is on a distinguished road
Well the goal is to keep using helyxos which only works with 2.2 apparently.

I was able to downgrade cgal to 4.1 and build surfacefearureextract correctly with cgal support.

Yes installed cgal in ubuntu 12.04 and pointed openfoam build to the system cgal directories. You actually posted the method for that above.

Unfortunately I have another problem with open mpi at the moment that I will post about separately.

Thank you for your response.

Regards,
Karl

Quote:
Originally Posted by wyldckat View Post
Greetings Karl,

Any chance you can switch to OpenFOAM 2.3.0 or 2.3.x instead? Because OpenFOAM 2.3 is better connected to CGAL and Boost.

If not, I'll need more information, namely which CGAL version you're using and which Ubuntu version.
And those paths "/usr/local/include/" seem to indicate that you're using a custom build of CGAL?

Best regards,
Bruno
wyldckat likes this.
atg is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Openfoam Ubuntu 12.04 Unmet dependencies slls33 OpenFOAM Installation 10 April 9, 2013 04:16
Installing OpenFOAM 2.1.1 and ParaView 3.12.0 on Ubuntu 12.10 wyldckat OpenFOAM Installation 14 February 12, 2013 05:43
errors when installing openfoam2.1 on ubuntu12.o4 hewei OpenFOAM Installation 5 May 29, 2012 07:43
Problem? with Installation of OpenFOAM 2.1.0 on to Ubuntu 10.4.4 VirtualBox Stubby OpenFOAM Installation 8 March 5, 2012 16:12
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43


All times are GMT -4. The time now is 06:18.