Recompile OpenFoam from double precison to single precision

copyright (C) 2011-2017

Recompile OpenFoam from double precison to single precision

For, I just want to play with GPGPU
Some of the ATI cards does not support double precision for openCL;
use speedIT openfoam plugin on cuda platform。

Follow the instructions for compile OF

make sure you have install the Double precison OF sucessfully,
There are quite a lot dependencies, you must meet, or the compiling will stop with error.

you DO need to download src pack.

check gcc version, must be >=4.4,

export WM_COMPILER=<pathofgcc44>/gcc

or edit the wmake/rulels/<platform>/c  and c++

% cd $HOME/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64Gcc
% vim c
cc = gcc44 -m64
% vim c++
CC = g++44 -m64

—————edit env. var.
gedit $WM_PROJECT_DIR /etc/bashrc
# change from default DP to SP
the file look like

# WM_ARCH_OPTION = 32 | 64
# this is the OS , 32bit Linux or 64bit linux, leave it because you just recompile it


————check the env
$ source ~/.bashrc
$ env|grep WM_*

WM_PRECISION_OPTION=SP    # just check this line,
WM_ARCH_OPTION=64      #if you OS is 64bit,

—————–test compilation

Go to the top-level source directory $WM_PROJECT_DIR
and execute the top-level build script ./Allwmake.



Tested on OF1.7.1  Linux64 or Linux32

May 2011

BSD documentation licensed Free for non-commercial usage only
Author: Qingfeng XIA
copyright (C) 2011-2017
please keep the original link in your reference.
This entry was posted in Uncategorized. Bookmark the permalink.