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

[OpenFOAM.org] After building OF 2.3.x the motorBike-tutorial does not run

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2015, 03:58
Default After building OF 2.3.x the motorBike-tutorial does not run
  #1
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Hello all,

I have compiled OF 2.3.x successfully, everything went fine. Now I tried to run the motorbike tutorial. For this, every application (even blockMesh, surfaceFeatureExtract,...) fails:

Code:
--> FOAM FATAL IO ERROR:
Cannot open controlDict
file: /fem7a/BL/OpenFOAM/OpenFOAM-2.3.x/etc/controlDict at line 0.
However, this file is present:
Code:
ls -la /fem7a/BL/OpenFOAM/OpenFOAM-2.3.x/etc/controlDict 
-rw-rw-rw- 1 fem user 31268 13. Feb 10:19 /fem7a/BL/OpenFOAM/OpenFOAM-2.3.x/etc/controlDict
I have no idea what is wrong there?
bastil is offline   Reply With Quote

Old   February 17, 2015, 09:29
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 Bastil,

My guess is that you're witnessing SELinux doing its job.
A few questions:
  1. Are you able to open the file with a regular text editor?
  2. Did you build OpenFOAM with user permissions or root permissions?
  3. Try using the "-Z" option for ls:
    Code:
    ls -laZ $WM_PROJECT_DIR/etc/controlDict
    it should tell you what permissions it has associated for the SELinux security system.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 17, 2015, 09:56
Default
  #3
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by wyldckat View Post

Are you able to open the file with a regular text editor?
  1. Did you build OpenFOAM with user permissions or root permissions?
  2. Try using the "-Z" option for ls:
    Code:
    ls -laZ $WM_PROJECT_DIR/etc/controlDict
    it should tell you what permissions it has associated for the SELinux security system.
Thanks Bruno,

yes I can open the file with a text editor and everything in there looks fine.

1. I build with user permissions
2.
Code:
 ls -laZ $WM_PROJECT_DIR/etc/controlDict
-rw-r--r--  fem user                                  /fem7a/BL/OpenFOAM/OpenFOAM-2.3.x/etc/controlDict
Ideas?
bastil is offline   Reply With Quote

Old   February 17, 2015, 16:11
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Bastil,

This error seems very familiar... I was almost certain this was an SELinux issue, but your system isn't even reporting anything about the SELinux context for the file.

OK, the two ideas that come to mind are as follows:
  1. Try using the cat command, since it's an executable:
    Code:
    cat $WM_PROJECT_DIR/etc/controlDict
    It should show the whole content of the file in question.
  2. Create a simple executable in your home area, which reads and prints out this file. For example:
    1. compile a "test.cpp" file with something like this inside it:
      Code:
      // reading a text file
      #include <iostream>
      #include <fstream>
      #include <string>
      using namespace std;
      
      int main () {
        string line;
        ifstream myfile ("/fem7a/BL/OpenFOAM/OpenFOAM-2.3.x/etc/controlDict");
        if (myfile.is_open())
        {
          while ( getline (myfile,line) )
          {
            cout << line << '\n';
          }
          myfile.close();
        }
      
        else cout << "Unable to open file"; 
      
        return 0;
      }
    2. I think you can build it with:
      Code:
      g++ test.cpp -o mytest
    3. Then you can run it simply by running:
      Code:
      ./mytest
      It should do the same as cat did.

Beyond this... it feels like this could be an issue related to NFS? I say this because of the strange path "/fem7a/BL", which suggests a special file-system, which is either network based or has some security measures in place.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 18, 2015, 09:27
Default
  #5
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Thanks. I needed to rebuild because of another problem which now fails (see my other post) so this is not so important at the moment.
bastil is offline   Reply With Quote

Reply


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
motorBike tutorial Eko OpenFOAM Running, Solving & CFD 4 December 20, 2017 07:34
Fix the fairing in the motorbike tutorial stormspirit OpenFOAM Running, Solving & CFD 2 May 4, 2016 12:49
[foam-extend.org] Error compiling OpenFOAM-1.6-ext Canesin OpenFOAM Installation 137 January 20, 2016 14:56
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 04:55
Cannot run Tutorial 11, please help Harendra Siemens 1 November 21, 2005 06:14


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