how to add OpenFoam in module environment
Hello,
I installed OpenFOAM 1.7.1 in /opt directory on linux cluster and for users, I want to add OpenFOAM in module environment but I don't know how to do it. Module environment has already installed on our system. and I tried to add OpenFOAM by inseting /etc/modulefiles/OpenFOAM/OpenFOAM-1.7.1 file. But, It did not work at all. Here is file I put into. #%Module1.0 ################################################## ################### ## ## Modulefile for OpenFOAM 1.7.1 ## ################################################## ################### proc ModulesHelp { } { puts stderr "OpenFOAM-1.7.1" } module-whatis "sets the environment for OpenFOAM 1.7.1" # for Tcl script use only set topdir /opt/OpenFOAM/OpenFOAM-1.7.1 set version 1.7.1 setenv OpenFOAM_HOME $topdir prepend-path PATH $topdir/bin prepend-path LD_LIBRARY_PATH $topdir/lib and I think I have to put some line about exporting path like source /opt/OpenFOAM/OpenFOAM/etc/bashrc does anyone have idea? thanks in advance. Sangmin |
Hello,
I have the same problem. Have tried with Code:
system("source ..../bashrc") Code:
system "source ..../bashrc" Both gives me a Tcl error. /Niklas |
You only need a very small number of environmental variables to run OPENFOAM (to compile it you need a whole lot more).
With modules it is easier to simply set the exact environmental variables needed to run and do the compiling in a non-modules environment. I can't recall all the variables needed, but there is no more than 10. The ones I remember: - PATH and LD_LIBRARY_PATH - MPI_BUFFER_SIZE - WM_PROJECT_INST_DIR - WM_PROJECT_DIR - FOAM_SIGFPE & FOAM_SETNAN (optional) Some might be superfluous and there might be one or two missing, but as far as I recall, that's the gist of it. |
Thank's a lot Eugene,
I will sort it out that way. You just saved me from wasting time on tedious scripting... -Niklas |
Might as well post the simplest 'obvious' solution. To prepare the contents of a module file, I just run printenv before and after sourcing OpenFOAM, piping output to two different files. A diff on these combined with sed gives a 90% working OpenFOAM-module file. Then clean up the remaining 10% by hand.
Without fancyness: Code:
printenv > /tmp/env_0 /N |
All times are GMT -4. The time now is 13:36. |