CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Install Optional Packages from Ubuntu 12.10 Repositories (http://www.cfd-online.com/Forums/openfoam-installation/114360-install-optional-packages-ubuntu-12-10-repositories.html)

mgdenno March 9, 2013 17:48

Install Optional Packages from Ubuntu 12.10 Repositories
 
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

wyldckat March 9, 2013 19:31

Greetings Matthew,

According to Bernhard:
Quote:

Originally Posted by gschaider (Post 412412)
- 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

mgdenno March 10, 2013 14:51

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


wyldckat March 10, 2013 15:31

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 :rolleyes:

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

Best regards,
Bruno

mgdenno March 11, 2013 14:59

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

atg April 22, 2014 23:19

--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 (Post 412963)
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 :rolleyes:

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

Best regards,
Bruno


wyldckat April 25, 2014 15:51

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

atg April 25, 2014 16:08

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 (Post 488240)
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



All times are GMT -4. The time now is 21:59.