functional path

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

functional path

#1 Unread post by drewa »

I've been trying to understand where the functionals are called in the build.bash and makefile. What I've done is make Projects/ocean_upwelling and Projects/cblast directories. They both successfully compile using build.bash. I'm compiling using g95 and Cygwin (Win XP).

I wanted to start working on files for my test case and used and modified the User/Functionals templates and put them at Projects/test/Functionals. The build.bash doesn't see those templates. So, to test things further, I copied everything in ROMS/Functionals into the Projects/ocean_upwelling and Projects/cblast Functional directories and then renamed ROMS/Functionals_old (just to force it to use the local files). The build.bash (and makefile) doesn't see those local files. The error I get is:

drewa@Drew_Dell /ROMS/Projects/cblast
$ ./build.bash -j 2
makefile:436: ROMS/Functionals/Module.mk: No such file or directory
make: *** No rule to make target `ROMS/Functionals/Module.mk'. Stop.
makefile:226: INCLUDING FILE /ROMS/Projects/cblast/Build/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
makefile:436: ROMS/Functionals/Module.mk: No such file or directory
make: *** No rule to make target `ROMS/Functionals/Module.mk'. Stop.


My build.bash definitions are:

export ROMS_APPLICATION=CBLAST

export MY_ROOT_DIR=`pwd`
export MY_PROJECT_DIR=`pwd`

export MY_ROMS_SRC=/ROMS

export MY_HEADER_DIR=${MY_PROJECT_DIR}

export MY_ANALYTICAL_DIR=${MY_PROJECT_DIR}/Functionals

export BINDIR=${MY_PROJECT_DIR}

export SCRATCH_DIR=${MY_PROJECT_DIR}/Build


Thanks for helping with this.

User avatar
wilkin
Posts: 879
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

#2 Unread post by wilkin »

You must tell build.bash where you have placed the code you wish to include to override the default Functionals.

Your posting indicates your code is in Projects/test/Functionals which I interpret to mean something like /home/drewa/X/Projects/test/Functionals. So make this clear to build.bash:

export MY_ANALYTICAL_DIR=/home/drewa/X/Projects/test/Functionals

Your use of 'pwd' may be confounding build.bash depending on where you invoke the script from. build.bash is local to each application, so you have the luxury of being explicit and unambiguous, rather than clever. If you are unsure what build.bach is interpreting 'pwd' to be, put an 'echo $pwd' in there to see what it is trying to do.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

jprinehimer
Posts: 20
Joined: Fri Oct 20, 2006 3:34 pm
Location: VIMS

#3 Unread post by jprinehimer »

Your error shows that make can't seem to find a file:

Code: Select all

makefile:436: ROMS/Functionals/Module.mk: No such file or directory 
If you copied over the entire Functionals directory, there's a sub-makefile Module.mk that you also copied over. I don't think you need that in your MY_ANALTICAL_DIR directory and it may be messing up the make script. It should probably be deleted. I'm not completely sure how all the makefile logic works, but I've never had Module.mk in my analytical directory and it's always worked for me.

If that's not the problem, I've used:

Code: Select all

export     MY_PROJECT_DIR=`pwd`
export     MY_HEADER_DIR=${MY_PROJECT_DIR}/inc
export MY_ANALYTICAL_DIR=${MY_PROJECT_DIR}/inc
without trouble before. I'd follow John's suggestion about hard-coding the path though, to make sure that's your problem. One of (or both):

Code: Select all

echo $MY_PROJECT_DIR
OR

Code: Select all

echo $MY_ANALYTICAL_DIR 
in build.bash would give you a clue.

Also, I think the correct syntax is:

Code: Select all

echo `pwd`
and not

Code: Select all

echo $pwd 
The first version echos the results of the command while the second version would look for a variable pwd that doesn't exist...:wink:

J.Paul

drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

#4 Unread post by drewa »

BINGO! When I renamed the Functionals directory, the build.bash couldn't find the analytical.f and module.mk files. Putting them into the Functionals directory cleared things up. It's all good in modeling world now.

Post Reply