[Tgcmgroup] Having a little trouble compiling
lluengo at dgeo.udec.cl
Fri Jan 14 15:17:00 MST 2011
Thanks Ben and Frederick,
I know what the system function tries to do, i tried fixing it linking
against libgfortran, that supplies "system" and "unlink" functions, but
the linking step of the model is looking for the "system_" and "unlink_"
functions. Also tried some compiler switches like "-fno-underscore", but
when i compile using this switch, it breaks compatibility with netcdf (a
HUGE drawback), that uses that style of underscored function names in
Next thing that I will try will be compiling my own version of
libgfortran (a long recompilation of gcc), to build the library using
the underscores. Maybe ubuntu defaults for libgfortran uses
"-fno-underscores" switch and that is causing this trouble.
The only modifications I've been making are in the
"tiegcm1.93-linux.job" and tiegcm1.93/scripts/Makefile" tweaking some
flags and paths to the libraries. Most of the build process has gone
I'll let you know if i can make it work.
Thanks for all you advice.
PD: Did both of you reply directly to me? I think is better replying to
the whole list, for pipermail to archive this.
El 14-01-2011 14:49, Ben Foster escribió:
> The "system" function attempts to escape to the OS and execute
> a shell command. It may be platform dependent (different names),
> so the model checks the current OS to make the correct call. These
> calls are mostly for file searching and manipulation on the local
> disk e.g., the "unlink" function it complained about.
> The OS is obtained by the Makefile with the "uname -s" command.
> If you can get the results of this command, or its equivalent
> in Ubuntu, we can add it to the list of OS's known to the model.
> When you get the OS, look in src/util.F and search on "function isystem"
> This is the local function that calls system according to the OS,e.g.,
> you see UNICOS, AIX, OSF1, SUN, LINUX, IRIX, etc. Here you can
> add your Ubuntu or UBUNTU, or whatever. Same for iunlink. Several
> functions in util.F
> check the OS with #ifdef statements for various reasons. Actually,
> you could simply add or change the default case in the #ifdef statements
> in util.F.
> Having said this, most of the system and unlink calls refer to
> local NCAR file archiving, mss, searching the disk, etc., and do not
> really belong in the Community model. I am planning on removing it
> soon, and rely only on simple fortran intrinsic file i/o. However, there
> are other functions in util.F that depend on the OS, so you will probably
> need to add the new OS, or defaults, to the conditionals in util.F.
> Let me know how it goes.
> On 1/13/2011 9:44 PM, Lorenzo Luengo C. wrote:
>> Hi everyone
>> Today i tried to compile the model in a VM running Ubuntu, using
>> After installing some required libraries (mpich2, netcdf, zlib), and
>> tweaking some compiler flags, it compiles, but it's not linking.
>> The error is an undefined reference to functions named system_ and
>> unlink_ (notice the underscores). I couldn't find a suitable library
>> providing this functions, I tried using libf2c, but it did not work.
>> Any advice on how to filfull this requirement?
Lorenzo Luengo Contreras
Ingeniero Civil Electrónico
Laboratorio MIDGEO (LF-106)
Facultad de Ciencias Físicas y Matemáticas
Universidad de Concepción
Concepción - Chile
More information about the tgcmgroup