CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

CentFOAM Python Script Installation: Error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2012, 10:16
Default CentFOAM Python Script Installation: Error
  #1
New Member
 
Shaun
Join Date: May 2012
Posts: 14
Rep Power: 14
socon009 is on a distinguished road
Hi all,

First things first - thanks to the contributors and developers out there who are helping to make this amazing software available to all.

Now, on to business.

I have been trying to install CentFOAM by using the python script supplied at the following website:

http://sourceforge.net/apps/mediawik...itle=Main_Page

I continue by relocating the file to my preferred installation directory:

Code:
mv centFOAM.py /home/username/centFOAM/
From that directory I begin to use the script:

Code:
python centFOAM.py -h
sudo python centFOAM.py --yum
python centFOAM.py --nonOF
It is at this point that I encounter the following problem...

Code:
Traceback (most recent call last):
  File "centFOAM.py", line 338, in <module>
    main()    
  File "centFOAM.py", line 297, in main
    installParaview(options.path, "3.10.0",rel)
  File "centFOAM.py", line 167, in installParaview
    writeStartParaview(path, package, "paraview",version[:-2])
  File "centFOAM.py", line 64, in writeStartParaview
    fileHandle = open ( fileName , 'w' )
IOError: [Errno 2] No such file or directory: '/home/shaun/centFOAM//paraview-3.10.0/bin/start_paraview'
This example is from the script's attempt to download, unpack, install ParaView. However, the problem was first encountered with NetGen. After consulting the script in gedit, I found that it seemed to get hung up on "unpacking" the .tar.gz compressed directory. So, as an experiment, I manually unpacked NetGen, which solved that error only to give the same error as before, except now with "ParaView" in the place of "NetGen" as you see in the code above.

My hunch is that the path is not being defined correctly. The reason I can be clearly viewed in the following code...

Code:
IOError: [Errno 2] No such file or directory: '/home/shaun/centFOAM//paraview-3.10.0/bin/start_paraview'
The path appears to include and extra forward slash between "centFOAM" and "paraview" in this example. Now, please pardon if this is acceptable file path syntax, as it is my first time encountering such an expression.

Continuing on this notion, I tried to find where in the script that the path was being defined. Unfortunately, I do not speak "python" very well and could only deduce that a variable referred to as "path" was being used in arguments, but I could not find the source of its definition.

Still, I noticed lines like this...

Code:
def writeTobashrc(path,version,name,extra):
    fileHandle = open ( os.environ['HOME']+"/.bashrc", 'a' )
    fileHandle.write ( 'alias '+name+'=\"'+path+'/'+name+'-'+version+'/'+extra+'\"\n' )
    fileHandle.close()
Notice the inclusions of a second forward slash directly following "path" in the third line. Assuming that the script takes its definition for path to be of the following format: /dir/dir/dir/ (ending with a "/"), then my guess is that this may be the source of my troubles.

As I type, I am flabbergasted. Since I hate to leave loose ends untied, I decided to post here in order to see if there is an easy solution while also providing documentation of this "bug" so others who encounter it in the future may rest easy knowing that they are not alone in their pain.

While I wait, hopefully, for a response to this thread, I will attempt to make small modifications in the python script to resolve the potentially problematic "//" phenomenon.

Thank you for reading!

Shaun
socon009 is offline   Reply With Quote

Old   May 24, 2012, 11:14
Default
  #2
New Member
 
Shaun
Join Date: May 2012
Posts: 14
Rep Power: 14
socon009 is on a distinguished road
::Update::

Manually unpacking these files has worked. Each program is usable.

Still interested if anyone has any ideas about the python script though.

Thanks,
Shaun
socon009 is offline   Reply With Quote

Old   May 26, 2012, 09:36
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,980
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Shaun,

Here's a recent thread about using CentFOAM: http://www.cfd-online.com/Forums/ope...01308-gcc.html - I know, the title is misleading...

As for me, the day I tested using the CentFOAM.py script, Sourceforge.net was having existential problems, so I didn't trigger any of those bugs, since I ended up having to do more steps manually.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
polynomial thermophysical properties II sebastian OpenFOAM Running, Solving & CFD 54 November 21, 2019 07:12
Problem running perturbUCyl sen.1986 OpenFOAM 17 June 4, 2019 05:56
issue compiling new turbulence model perplexed user OpenFOAM Programming & Development 1 January 13, 2012 03:40
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


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