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

Error compiling OF application on shared system

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2019, 17:40
Default Error compiling OF application on shared system
  #1
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
Hi, I am trying to compile the pisoFoam application (following the example given here) on OpenFOAM 6, on a shared Linux system that I have a user account on (but do not have admin rights to).

I have copied the pisoFoam source folder to a personal directory that I have write access to. I do not have write access to the main OpenFOAM project/installation directory on the shared system.

I have set $FOAM_USER_APPBIN to point to a personal directory that I have write access to, and $LIB_SRC is set correctly. However, when I type wmake in the pisoFoam folder, I get the following:

Code:
$ wmake
wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
    mkdir: cannot create directory '$WM_PROJECT_DIR/src/OSspecific//lnInclude': Permission denied
wmakeLnInclude error: failed to create include directory $WM_PROJECT_DIR/src/OSspecific//lnInclude
(I have substituted part of the path above with '$WM_PROJECT_DIR', so as not to divulge the folder structure of the shared system)

So, clearly it is throwing the error because it is trying to create a directory in the main OF installation tree, which I don't have write access to. However, why is it trying to do this? All I want to do is read the installed OF headers and link to the installed libraries, so I can compile and run the application in the area I do have write access to. I have no desire to re-compile or update any of the installed OF libraries.

Is there some way I can compile pisoFoam, without the build script trying to write to installed OF directories, which I haven't got write access to?
Time4Tea is offline   Reply With Quote

Old   May 15, 2019, 09:32
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

It looks like wmake tries to recompile OpenFOAM itself. Are you sure OpenFOAM-6 is compiled? Keep in mind compilation flags (i.e. Opt, Prof, size of label type, etc). Is there $WM_PROJECT_DIR/src/OSspecific/lnInclude folder?
alexeym is offline   Reply With Quote

Old   May 15, 2019, 10:46
Default
  #3
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
@alexeym: yes, OpenFOAM definitely seems to be compiled. All of the dynamic libraries are present in $FOAM_LIBBIN and if I do which pisoFoam, which icoFoam etc. the application binaries are present.


There is no $WM_PROJECT_DIR/src/OSspecific/lnInclude folder though, no.
Time4Tea is offline   Reply With Quote

Old   May 16, 2019, 11:52
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

My second guess was: OpenFOAM(R) was installed from binary package (so there is no compilation folders) but I have checked and at least Foundation packages lnInclude folders in their package.

Unfortunately include flags with $(LIB_SRC)/OpenFOAM/lnInclude and $(LIB_SRC)/OSspecific/POSIX/lnInclude are automatically added by wmake, so you wont be able to proceed without them.

Maybe you can ask to recompile OpenFOAM? Or al least run Allwmake script to recreate lnInclude folders.
alexeym is offline   Reply With Quote

Old   May 20, 2019, 11:38
Default
  #5
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
@alexeym: $(LIB_SRC)/OSspecific/POSIX/lnInclude does exist. It's $(LIB_SRC)/OSspecific//lnInclude that it's trying to create. Actually, the fact there are two slashes in that path seems a little odd. Perhaps there is a wmake-related environment variable that relates to the OS, which is not set (and is therefore returning a blank)?



If there is no way to modify the build script, then I think that is a shame, because it seems to make it very difficult to compile OF applications on shared systems. What I might have to do is try copying the entire OF installation tree to my own directory (depending on how large it is).
Time4Tea is offline   Reply With Quote

Old   May 20, 2019, 15:41
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
You are right, there is WM_OSTYPE environment variable, which normally is set to POSIX (at least on Linux and macOS). In your case it is empty for some reason.

If you would like to discuss wmake idiosyncrasies, it would be better to start new thread (or do it directly in Foundation's bug-tracker).
alexeym is offline   Reply With Quote

Old   May 20, 2019, 16:14
Default
  #7
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
@alexeym: yes, I had a look through the $WM_PROJECT_DIR/etc/bashrc script and saw that variable. For some reason, it wasn't set and setting it to 'POSIX' does seem to resolve the error I was having. Thanks for your help!
Time4Tea is offline   Reply With Quote

Old   May 21, 2019, 15:21
Default
  #8
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
So, setting the WM_OSTYPE variable resolved the error I was getting initially; however, I am now getting the following error when I try to compile pisoFoam:


Code:
Compiling enabled on 2 cores
icpc -std=c++11 -fp-trap=common -fp-model precise -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_ -DWM_LABEL_SIZE= -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076 -O3  -DNoRepository -I($LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude -I($LIB_SRC)/TurbulenceModels/incompressible/lnInclude -I($LIB_SRC)/transportModels -I($LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel -I($LIB_SRC)/finiteVolume/lnInclude -I($LIB_SRC)/meshTools/lnInclude -I($LIB_SRC)/sampling/lnInclude -IlnInclude -I. -I($LIB_SRC)/OpenFOAM/lnInclude -I($LIB_SRC)/OSspecific/POSIX/lnInclude   -fPIC -c pisoFoam.C -o Make/linux64IccDPInt32Opt/pisoFoam.o
In file included from ($LIB_SRC)/OpenFOAM/lnInclude/labelList.H(47),
                 from ($LIB_SRC)/OpenFOAM/lnInclude/UPstream.H(42),
                 from ($LIB_SRC)/OpenFOAM/lnInclude/Pstream.H(42),
                 from ($LIB_SRC)/OpenFOAM/lnInclude/parRun.H(35),
                 from ($LIB_SRC)/finiteVolume/lnInclude/fvCFD.H(4),
                 from pisoFoam.C(37):
($LIB_SRC)/OpenFOAM/lnInclude/label.H(47): error: expected an expression
  #if WM_LABEL_SIZE != 32 && WM_LABEL_SIZE != 64
                    ^
Do you have any idea what might be causing this? It seems to be a fairly basic preprocessor #if statement, so I have no idea why it is not recognizing the '!=' expression.
Time4Tea is offline   Reply With Quote

Old   May 21, 2019, 16:03
Default
  #9
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
Hmm ... I set WM_LABEL_SIZE=32 and that error went away, but now I'm getting another one:


Code:
($LIB_SRC)/OpenFOAM/lnInclude/scalar.H(101): error: #error directive: "Precision not set, please set either WM_SP, WM_DP or WM_LP"
      #error "Precision not set, please set either WM_SP, WM_DP or WM_LP"
       ^

It seems there are several environment variables that have not been set properly. I'll have to look into this - I did source the bashrc file, so perhaps some of the variables are not set correctly for this system.
Time4Tea is offline   Reply With Quote

Old   May 21, 2019, 16:03
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Your WM_LABEL_SIZE environment variable is empty. The is why compiler flag looks like:

Code:
-DWM_LABEL_SIZE=
it should be 32 or 64, so the flag becomes -DWM_LABEL_SIZE=32 (or -DWM_LABEL_SIZE=64).

The next error will be caused by WM_PRECISION_OPTION environment variable being empty. Due to this, compiler flag looks like:

Code:
-DWM_
usually value is DP and the flag looks like -DWM_DP.
Time4Tea likes this.
alexeym is offline   Reply With Quote

Old   May 21, 2019, 16:28
Default
  #11
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
Awesome - I set those variables and it compiled fine. Thanks very much for your help @alexeym, I really appreciate it!
Time4Tea is offline   Reply With Quote

Reply

Tags
compilation, openfoam-6


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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
Ansys Licence Serve on Ubuntu 16.04 LTS david.pasquale ANSYS 2 January 20, 2017 11:52
System Build Advice for FEA cycleback Hardware 1 February 8, 2013 20:53
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
Need ideas-fuel discharge system Jan FLUENT 1 October 10, 2006 23:05


All times are GMT -4. The time now is 05:09.