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

[swak4Foam] SWAK4FOAM_SRC environment variable

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2012, 10:14
Default SWAK4FOAM_SRC environment variable
  #1
New Member
 
Felipe
Join Date: Feb 2011
Posts: 9
Rep Power: 15
fcuevas is on a distinguished road
Hi everybody,

I'm trying to run the CodeStream/cylinderWithSwak example included in swak4Foam library but I have this error

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Compilation of the function object only works if the environment variable SWAK4FOAM_SRC points to the Libraries directory of the swak4Foam-sources


From function swakCodedFunctionObject::read(const dictionary& dict)
in file swakCodedFunctionObject.C at line 225.

FOAM exiting
************************************************** ***

In the README file says for the swakFunctionObjects library: "... Assumes that the =SWAK4FOAM_SRC= environment variable is set to the Libraries=-directory of the =swak4Foam=-sources"

but I don't really know where/when can I set the environment variable (before I compile all swak4Foam or in the controlDictof the case that use this library or...)

The swak4Foam library is installed in $(WM_PROJECT_USER_DIR)/lib/swak4Foam and the compilation doesn't show any strange problem (as far as I know), actually I can use without problems the groovyBC library.

How and where should I set the environment variable?

Regards,
Felipe
fcuevas is offline   Reply With Quote

Old   June 15, 2012, 15:55
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by fcuevas View Post
Hi everybody,

I'm trying to run the CodeStream/cylinderWithSwak example included in swak4Foam library but I have this error

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Compilation of the function object only works if the environment variable SWAK4FOAM_SRC points to the Libraries directory of the swak4Foam-sources


From function swakCodedFunctionObject::read(const dictionary& dict)
in file swakCodedFunctionObject.C at line 225.

FOAM exiting
************************************************** ***

In the README file says for the swakFunctionObjects library: "... Assumes that the =SWAK4FOAM_SRC= environment variable is set to the Libraries=-directory of the =swak4Foam=-sources"

but I don't really know where/when can I set the environment variable (before I compile all swak4Foam or in the controlDictof the case that use this library or...)

The swak4Foam library is installed in $(WM_PROJECT_USER_DIR)/lib/swak4Foam and the compilation doesn't show any strange problem (as far as I know), actually I can use without problems the groovyBC library.

How and where should I set the environment variable?

Regards,
Felipe
The thing is that the functionObject has to know where to find the swak4Foam-sources. As this is not standard-OF-software it depends on the user where it is installed and I didn't want to force anyone on a specific location (because usually 20% are not allowed to install it there because of administrative policies anyway ...) so the user has to give an indication by setting that environment variable. Setting an environment variable depends on the shell you're using. For the location you're giving and the shell I usually use (bash or zsh) you'd type
Code:
export SWAK4FOAM_SRC=$WM_PROJECT_USER_DIR/lib/swak4Foam/Libraries
for csh/tcsh it is setenv I think.

This variable is currently only needed for this functionObject as it is compiling something that requires the swak-headers. groovyBC and friends only need binaries (which you compiled at the start) and don't care where the sources are.

I'll add a test to the Allwmake that prints the proposed value for SWAK4FOAM_SRC

Where you actually set the environment variable (bashrc in your home, the site-configuration of OF, ...) is up to you
nvnkush likes this.
gschaider is offline   Reply With Quote

Old   June 18, 2012, 10:58
Default
  #3
New Member
 
Felipe
Join Date: Feb 2011
Posts: 9
Rep Power: 15
fcuevas is on a distinguished road
Set on bashrc, works perfectly

Regards,
Felipe
fcuevas 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
Environment variable in CCM+ crevoise STAR-CCM+ 0 November 12, 2013 05:29
Environment variable ($MPI_PROCS) in decomposeParDict Pj. OpenFOAM Running, Solving & CFD 2 April 8, 2013 03:38
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 23:10.