CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Environment and wmake (http://www.cfd-online.com/Forums/openfoam-bugs/64353-environment-wmake.html)

wikstrom May 8, 2009 03:53

Environment and wmake
 
Hi,

low seriousness but still:

Running Ubuntu 9.04, Jaunty

1) setting WM_NCOMPPROCS does not affect wmake. Probably since /bin/sh -> /bin/dash in ubuntu. Has to hard code into wmake.

2) the MANPATH set in etc/apps/cint/bashrc overrides the system MANPATH (which by default is empty) -> No manpages available (but cint).

N.

henry May 9, 2009 05:18

Hi Niklas,

1) setting WM_NCOMPPROCS does not affect wmake. Probably since /bin/sh -> /bin/dash in ubuntu. Has to hard code into wmake.

I don't see why /bin/sh being /bin/dash should affect the setting of WM_NCOMPPROCS, could you elaborate?

2) the MANPATH set in etc/apps/cint/bashrc overrides the system MANPATH (which by default is empty) -> No manpages available (but cint).

in OpenFOAM-1.5.x/etc/apps/cint/bashrc the MANPATH is extended:

export MANPATH=$MANPATH:$CINTSYSDIR/doc

and this works fine for me, could you check to see why this is not working as expected for you?

H

wikstrom May 9, 2009 15:00

Sorry. My error
 
Hmm, I am sorry. At shame even! A misspelled "export ..." has obviously been following me for a while. I just blamed dash out of old habit I'm afraid...

About the MANPATH, however, there might be a changed behaviour of manpath lately (in some linux flavours or only Ubuntu?). Since Ubuntu 8.10, at least: In order to prepend the system manpath defined by /etc/manpath.config, the MANPATH variable must start with a colon :. Otherwise the system manpath is ignored.

From manual page:
Code:

If $MANPATH is set,  manpath  displays  its  value  rather  than
determining  it on the fly.  If $MANPATH is prefixed by a colon,
then the value of the variable is appended to  the  list  deter‐
mined from the content of the configuration files.  If the colon
comes at the end of the value in the variable, then  the  deter‐
mined  list  is appended to the content of the variable.  If the
value of the variable contains a double  colon  (::),  then  the
determined  list is inserted in the middle of the value, between
the two colons.

Hence, the problem probably occurs when foamCleanPath cleans the colon.

I'd say it's devious to destroy "man" by removing the access to all manpages. 22. ;-)

N

henry May 9, 2009 18:58

It is not quite clear what I should do, clearly we need to append to any existing MANPATH setting so

export MANPATH=$MANPATH:$CINTSYSDIR/doc

is necessary, but now you are saying that $MANPATH should start with a :, but whose responsibility is that? The above statement does not make any assumptions about what $MANPATH is initially set to. On my machine I set $MANPATH including all the system locations so I don't have a problem. What happens if you set MANPATH to : in your .bashrc or equivalent for dash file?

An alternative is I could set

export MANPATH=:$MANPATH:$CINTSYSDIR/doc

or

export MANPATH=:$CINTSYSDIR/doc:$MANPATH

assuming that the :: that $MANPATH might end up containing don't cause any problems. What is your preference?

H

wikstrom May 10, 2009 01:33

Manpath
 
Good morning Henry!
A simple, though not beautiful, solution would be to set

MANPATH=:$MANPATH

after the latest call to foamCleanPath in $WM_PROJECT_DIR/etc/bashrc
(cleanPath is the colon remover, obviously.)
or, more compact

cleanPath=`$cleanProg "$MANPATH"` && MANPATH=":$cleanPath"

around line 247 in bashrc
This works for me, but I am not sure if other linux flavours appreciate the initial colon? Please try.

On my systems MANPATH is unset unless the user sets it. The system man paths are instead governed by /etc/manpath.config

Cheers
N

henry May 10, 2009 05:29

Hi Niklas,

OK I think it is sorted now. I have put the ":" at the end rather than the beginning to be consistent with the OpenFOAM additions to PATH; the OpenFOAM-dependent third-party executables must of course take precedence while OpenFOAM is being used. I have also made the equivalent change for csh so man should now work as expected in bash, dash, csh and tcsh. All these changes are now in the 1.5.x git repository, let me know if you have any further problems.

H

wikstrom May 10, 2009 06:32

Great Henry.

Thanks

N.


All times are GMT -4. The time now is 22:30.