CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OpenFOAM 2.3.x on Mac OS X Yosemite 10.10.5 Installation Errors (https://www.cfd-online.com/Forums/openfoam-installation/160324-openfoam-2-3-x-mac-os-x-yosemite-10-10-5-installation-errors.html)

shipman October 5, 2015 22:06

OpenFOAM 2.3.x on Mac OS X Yosemite 10.10.5 Installation Errors
 
Dear All,

First time I try to install OpenFOAM 2.3.x on MAC OS X Yosemite 10.10.5 using the instructionhttp://openfoamwiki.net/index.php/Installation/Mac_OS/OpenFOAM_2.3.x.

Although I am struggling since several days to set the port selection similar to tutorial, I have following errors during setting db:

First one:
Code:

sudo port select --set db db48
Selecting 'db48' for 'db' failed: The configuration file '/opt/local/etc/select/db/base' could not be opened

Second one:
Code:

sudo port select --set llvm mp-llvm-3.5
Selecting 'mp-llvm-3.5' for 'llvm' failed: The specified version 'mp-llvm-3.5' is not valid.


How can I fix these problems. Your help will be appreciated.

By the way my selection looks $port sure select --summary

Code:

Name    Selected              Options
====    ========              =======
db      none                  db46 db48 none
gcc      mp-gcc48              mp-gcc46 mp-gcc47 mp-gcc48 mp-gcc49 none
llvm    mp-llvm-3.4            mp-llvm-3.4 none
mpi      openmpi-gcc48-fortran  mpich-mp-fortran openmpi-gcc48-fortran openmpi-mp-fortran none
python  python27              python26-apple python27 python27-apple none
python2  none                  python26-apple python27 python27-apple none


Thank you.

Baris

wyldckat October 10, 2015 09:17

Quick answer: http://www.cfd-online.com/Forums/ope...lems-db48.html

shipman October 12, 2015 00:18

Quote:

Originally Posted by wyldckat (Post 567445)

Dear Bruno,

Thank you very much for your kind reply. I have installed finally openfoam into this version of mac. It can be run both manual and parallel as well. However, I have 2 other problems, If you can help be I will be really appraciated.

First one is when I open new terminal and write icoFoam -help it shows following error:
Code:

-bash: icoFoam: command not found
to get rid of this error I should always go into OpenFOAM-2.3.x/ and then should run source etc/bashrc then it works: you can find my .bashrc as follows. How can I set it to work at every opening of terminal?

Code:

export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=2.3.x

################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# either set $FOAM_INST_DIR before sourcing this file or set
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################

#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR

#- Compiler location:
#    foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system

#- Compiler:
#    WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Clang | Icc (Intel icc)
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH

#- Architecture:
#    WM_ARCH_OPTION = 32 | 64
export WM_ARCH_OPTION=64

#- Precision:
#    WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP

#- Optimised, debug, profiling:
#    WM_COMPILE_OPTION = Opt | Debug | Prof
export WM_COMPILE_OPTION=Opt

#- MPI implementation:
#    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
#              | MPI | QSMPI | SGIMPI
export WM_MPLIB=SYSTEMOPENMPI

#- Operating System:
#    WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX

#- Floating-point signal handling:
#    set or unset
export FOAM_SIGFPE=

#- memory initialisation:
#    set or unset
#export FOAM_SETNAN=


################################################################################

# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"
if [ "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ]
then
    foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
fi


# Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION

# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION

# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
if [ -d "$WM_PROJECT_SITE" ]
then
    export WM_PROJECT_SITE
else
    unset WM_PROJECT_SITE
fi

# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION


# Source files, possibly with some verbosity
_foamSource()
{
    while [ $# -ge 1 ]
    do
        [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2
        . $1
      shift
    done
}

# Evaluate command-line parameters
_foamEval()
{
    while [ $# -gt 0 ]
    do
        case "$1" in
        -*)
            # stray option (not meant for us here) -> get out
            break
            ;;
        *=)
            # name=      -> unset name
            [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}" 1>&2
            eval "unset ${1%=}"
            ;;
        *=*)
            # name=value  -> export name=value
            [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" 1>&2
            eval "export $1"
            ;;
        *)
            # filename: source it
            if [ -f "$1" ]
            then
                _foamSource "$1"
            else
                _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
            fi
            ;;
        esac
        shift
    done
}


# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`

# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify alternative pref files
export FOAM_SETTINGS="$@"
_foamEval $@

# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

#- Clean PATH
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
    && LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
if [[ `uname -s` == "Darwin" ]]
then
    cleaned=`$foamClean "$DYLD_LIBRARY_PATH" "$foamOldDirs"` && DYLD_LIBRARY_PATH="$cleaned"
fi

export PATH LD_LIBRARY_PATH MANPATH


# Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh


# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/gperftools.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.sh`


# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean PATH
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH (trailing ':' to find system pages)
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"

export PATH LD_LIBRARY_PATH MANPATH

#- Clean LD_PRELOAD
if [ -n "$LD_PRELOAD" ]
then
    cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
    export LD_PRELOAD
fi

if [[ `uname -s` == "Darwin" ]]
then
    if [[ `ulimit -n` == "unlimited" || `ulimit -n` < 8192 ]]
    then
        # higher limit needed for wmkdeps
        ulimit -n 8192
    fi
fi

if [ -f $/Users/wuguanghao/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc ]; then
  . $/Users/wuguanghao/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
fi

# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource _foamEval




# ----------------------------------------------------------------- end-of-file

echo "WM_CC=mpicc" >> /Users/wuguanghao/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
echo "WM_CXX=mpicxx" >> /Users/wuguanghao/OpenFOAM/OpenFOAM-2.3.x/etc/bashrcWM_CC=mpicc
WM_CXX=mpicxx
WM_CC=mpicc
WM_CC=mpicc
WM_CC=mpicc
WM_CC=mpicc

Another problem is that after running simply a case I can't open paraview. It gives following error:

Code:

ERROR: ParaView not found in /Users/wuguanghao/OpenFOAM/ThirdParty-2.3.x/platforms/darwinIntel64Gcc/ParaView-4.1.0/

FATAL ERROR: ParaView reader module libraries do not exist

Please build the reader module before continuing:
cd $FOAM_UTILITIES/postProcessing/graphics/PV4Readers
./Allwclean
./Allwmake

To install the preview into mac i followed following link: https://openfoamwiki.net/index.php/I...OpenFOAM_2.2.2

Thank you in advance.

Baris

wyldckat October 12, 2015 17:24

Hi Baris,

In the file "~/.bashrc" you should not have all of that content. The idea is to only have the content that you originally had and then to add the line related to sourcing the OpenFOAM environment, for example:
Code:

source /Users/wuguanghao/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
I don't have access to a Mac, so I don't know what is the default content of the file "~/.bashrc".

As for using paraFoam, the instructions are given here: https://openfoamwiki.net/index.php/I...w_Installation

Best regards,
Bruno

shipman October 29, 2015 10:18

Hi Bruno,

Thank you very much for your help. You are great man :) Finally successfully I have installed OF into my mac. After that a friend asked me to install OF into same version of his MAC. I have tried several times same way, however I am getting following error when I am installing mpirun-gcc48 or mpirun-gcc49. By the way I can't not install gcc48 but I was able to install gcc49. I don't know the reason. Could you tell me that How can I fix following problem and install mpirun:

Quote:

Error: org.macports.build for port openmpi-gcc49 returned: command execution failed

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org _release_tarballs_ports_sc ience_openmpi/openmpi-gcc49/work/openmpi-1.10.0/opal/mca/hwloc/base/hwloc_base_util.c:1482:13: error: 'HWLOC_OBJ_OSDEV_COPROC' undeclared (first use in this function)
Your help will make me so appreacited.

Thanks in advance.

Baris

wyldckat October 31, 2015 08:14

Quick answer: I have no specific idea about this, because I don't have access to a Mac.
Nonetheless, I suspect that it has something to do with using OpenMPI 1.10, which is very recent and is possibly the reason for the problems you're having.

I'm currently advising people to follow the instructions given by Alexei, which relies in Homebrew instead of Macports: https://github.com/mrklein/openfoam-...ion-&-Homebrew

AliVali May 16, 2016 01:50

Hi,

I have the same problem when I want to install Openfoam on my macbook OS X 10.9.4

sudo port select --set llvm mp-llvm-3.5
Selecting 'mp-llvm-3.5' for 'llvm' failed: The specified version 'mp-llvm-3.5' is not valid.

Any help is highly appreciated

windscion May 16, 2016 13:24

Quote:

Originally Posted by AliVali (Post 600181)
Hi,

I have the same problem when I want to install Openfoam on my macbook OS X 10.9.4

sudo port select --set llvm mp-llvm-3.5
Selecting 'mp-llvm-3.5' for 'llvm' failed: The specified version 'mp-llvm-3.5' is not valid.

Any help is highly appreciated

What is output of port select --summary? Presumably a version after 3.5 should work. (Myself, I have only 3.7 since installing 10.11)

shipman May 16, 2016 20:18

Hi to all,

This is the tutorial which I have prepared how to install openfoam into MAC.

Hope it helps you.

https://www.researchgate.net/publica...nFOAM_into_MAC

AliVali May 18, 2016 00:00

Hi Windscin,
port select --summary
Name Selected Options
==== ======== =======
db none db48 none
gcc mp-gcc48 mp-gcc48 mp-gcc5 none
llvm none mp-llvm-3.7 none
mpi openmpi-gcc48-fortran openmpi-gcc48-fortran openmpi-mp-fortran none
python python27 python25-apple python26-apple python27 python27-apple none
python2 none python25-apple python26-apple python27 python27-apple none

I'll try to install a newer version next week.

AliVali May 18, 2016 00:04

Quote:

Originally Posted by shipman (Post 600273)
Hi to all,

This is the tutorial which I have prepared how to install openfoam into MAC.

Hope it helps you.

https://www.researchgate.net/publica...nFOAM_into_MAC

Thanks Shipman,
your tutorial looks very useful, I'll try it soon.

Regards

windscion May 18, 2016 09:54

Ali: Looks okay so far, except that you don't have mp-llvm-3.7 selected, which I am guessing is irrelevant since the only alternative is none.

I used this setup:
Name Selected Options
==== ======== =======
cython none cython26 none
gcc mp-gcc49 mp-gcc49 mp-gcc5 none
llvm mp-llvm-3.7 mp-llvm-3.7 none
mpi openmpi-gcc49-fortran mpich-gcc49-fortran openmpi-gcc49-fortran openmpi-mp-fortran none
nosetests none nosetests26 none
python python27 python26 python26-apple python27 python27-apple none
python2 none python26 python27 none
wxWidgets none wxWidgets-3.0 none

I managed to get 2.3.x working with gcc49 and mp-llvm-3.7, but I also added WM_CC=/opt/local/bin/mpicc and WM_CXX=/opt/local/bin/mpicxx at the end of $HOME/OpenFoam/OpenFoam-2.3.x/etc/bashrc. (After verifying that the chain of symbolic links ended successfully. No kidding, at one point the chain broke and `which mpicc` said one thing, but mpicc -v said another.)

Then I used this hack to allow macport's flex (2.6.0) to work with the package:

% find . -name '*.L' -print

then for each file found above, change
#if YY_FLEX_SUBMINOR_VERSION < 34
to
#if YY_FLEX_SUBMINOR_VERSION < 34 && YY_FLEX_MINOR_VERSION < 6
and then the code will work properly with flex 2.6

I used gcc49 mostly because it saved me adding another compiler version, but also because it has memory safeguards not found in gcc48.

I trust you are installing on a case-sensitive filesystem? I.e., not the root filesystem -- which must be case insensitive or OS X breaks.


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