Create ROMS executable in build directory

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
m.hadfield
Posts: 518
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Create ROMS executable in build directory

#1 Post by m.hadfield » Sun May 13, 2007 10:06 pm

Kate & Hernan have done an admirable job of designing the ROMS build process so that all files generated during the build are in a single directory. The name of this directory is specified by the makefile's SCRATCH_DIR variable. By default it is the Build subdirectory, but it can be overridden when make is called, eg, the following would cause ROMS to use a subdirectory specific to the OS and compiler

Code: Select all

export SCRATCH_DIR=build-$(uname -s -m | tr " " "-")-${FORT}
make
I said "all" the files, but there's one exception: the executable, which is create in the master directory (by which I mean the one the makefile is in).

What about creating the executable in the build directory? One would still run it from the master directory, either by specifying its path explicitly

Code: Select all

$SCRATCH_DIR/oceanS < ROMS/External/ocean.in
or with a symbolic link

Code: Select all

ln -s $SCRATCH_DIR/oceanS .
./oceanS < ROMS/External/ocean.in
This would allow one to have different builds on the same system without any interference. Eg, one might have a debug build and an optimised build, or builds with different compilers.

User avatar
arango
Site Admin
Posts: 1082
Joined: Wed Feb 26, 2003 4:41 pm
Location: IMCS, Rutgers University
Contact:

#2 Post by arango » Sun May 13, 2007 10:24 pm

The excutable goes to the value of the BINDIR macro in makefile:

Code: Select all

#--------------------------------------------------------------------------
#  Set directory for executable.
#--------------------------------------------------------------------------

      BINDIR ?= .
So you can set this macro to the path that you want to sent the executable. See also the following script ROMS/Bin/build.sh. I have a build.sh script in each of my application directories.

Thank you for your kind remarks :wink:
Last edited by arango on Sun May 13, 2007 10:56 pm, edited 1 time in total.

User avatar
m.hadfield
Posts: 518
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

#3 Post by m.hadfield » Sun May 13, 2007 10:31 pm

Oh yes :oops:

User avatar
arango
Site Admin
Posts: 1082
Joined: Wed Feb 26, 2003 4:41 pm
Location: IMCS, Rutgers University
Contact:

#4 Post by arango » Sun May 13, 2007 11:17 pm

Also noticed that I modified the makefile today. The macro MY_HEADER_DIR needs to have the full path of the directory containing the application header file. This allows the user to modify existing ROMS/ test cases outside of ROMS directory tree. Recall that one good way for user to start learning ROMS capabilities is to run any of the test cases and modify them :idea:. We just ask you that you do such modifications outside the ROMS/ directory tree. The new ROMS structure allows such modifications.

We highly recommend the user to not change any of the files in the ROMS/ directory tree to preserve the vadility of the distributed adjoint codes :!: The protocol is for the user to suggest changes to ROMS using the trac website :arrow: Then we will consider the suggestion(s) and update the codes accordingly. Of course, this is subject to our time priorities.

Post Reply