Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Sat Sep 21, 2019 7:15 am




Post new topic Reply to topic  [ 7 posts ] 

All times are UTC

Author Message
 Post subject: compile ROMS error
PostPosted: Thu Sep 27, 2018 6:02 pm 
Offline

Joined: Thu Apr 05, 2018 6:34 pm
Posts: 15
Location: Ha Noi University Sience and Technology, Vietnam
Hi everyone,i compile ROMS using Ubuntu app,i get trouble:

cd Build; -c -fno-second-underscore -O3 -ffast-math mod_kinds.f90
/bin/sh: 1: -c: not found
ROMS/Modules/Module.mk:15: recipe for target 'Build/mod_kinds.o' failed
make: *** [Build/mod_kinds.o] Error 127


please help me :cry: :cry: :cry:


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Thu Sep 27, 2018 7:14 pm 
Offline
Site Admin
User avatar

Joined: Wed Feb 26, 2003 3:12 pm
Posts: 121
Location: IMCS, Rutgers University
From the flags it appears that you have enabled gfortran but my first guess is that either gfortran is not installed or is not in your path. Most modern Linux distributions have a separate package for the GNU fortran compiler; it no longer comes as part of the gcc package. I believe Ubuntu has many to choose from.

try:

which gfortran

if the full path to your gfortran executable is not returned then you need to install/get gfortran in your path.

Dave


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Tue May 14, 2019 10:46 pm 
Offline

Joined: Mon Apr 29, 2019 8:01 pm
Posts: 4
Location: National Taiwan University
I'm new in ROMS. If I'm sure gfortran is installed, which file should I edit to point to the path. Thanks~


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Tue May 14, 2019 11:23 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3671
Location: IMS/UAF, USA
From the command line, see what "which gfortran" or "which mpif90" give you. That's what the ROMS build system will execute to find the correct path. If it doesn't come up already, you need to change your user path to point there, perhaps in your ~/.bashrc file or similar. On a supercomputer, it might be something like "module load XXX" where on the system here, XXX is "toolchain/foss/2016b" (foss here stands for free and open source software). You might need to ask a local expert on your computer.


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Wed May 15, 2019 5:52 pm 
Offline

Joined: Mon Apr 29, 2019 8:01 pm
Posts: 4
Location: National Taiwan University
This is what I've got. Please help me, tks~

ROMS/Bin/cpp_clean /home/njtsai/src/trunk/ROMS/Bin/Build_roms/mod_kinds.f90
cd /home/njtsai/src/trunk/ROMS/Bin/Build_roms; -c -frepack-arrays -O3 -ffast-math mod_kinds.f90
/bin/sh: 1: -c: not found
ROMS/Modules/Module.mk:15: recipe for target '/home/njtsai/src/trunk/ROMS/Bin/Build_roms/mod_kinds.o' failed
make: *** [/home/njtsai/src/trunk/ROMS/Bin/Build_roms/mod_kinds.o] Error 127


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Wed May 15, 2019 6:51 pm 
Offline
Site Admin
User avatar

Joined: Wed Feb 26, 2003 4:41 pm
Posts: 1081
Location: IMCS, Rutgers University
Your problem is that you haven't configured the build_roms.sh and build_roms.bash correctly. For example, notice that in the build_roms.sh script we have:
Code:
#--------------------------------------------------------------------------
# If applicable, use my specified library paths.
#--------------------------------------------------------------------------

 setenv USE_MY_LIBS no           # use system default library paths
#setenv USE_MY_LIBS yes          # use my customized library paths

set MY_PATHS = ${COMPILERS}/my_build_paths.sh

if ($USE_MY_LIBS == 'yes') then
  source ${MY_PATHS} ${MY_PATHS}
endif


If you set USE_MY_LIBS it to yes, then you need to modify source code root file Complilers/my_build_paths.sh and edit the appropriate paths for the desired compiler. You need to spend sometime reading and understanding the information provided in the build scripts.

What I recommend to everybody is to have a customized version of these make configuration files in a different directory, say ${HOME}/Compilers/ROMS or any other, to avoid overwriting during svn updates. Notice that in build_roms.sh, we have logic for such strategy:

Code:
# Set path of the directory containing makefile configuration (*.mk) files.
# The user has the option to specify a customized version of these files
# in a different directory than the one distributed with the source code,
# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep these
# configurations files up-to-date.

 setenv COMPILERS            ${MY_ROMS_SRC}/Compilers
#setenv COMPILERS            ${HOME}/Compilers/ROMS


If after these suggestions you still have problems, you need to seek help from a computer technician at your institution. There is not much that we can do for you neither have the time for messaging you back.

We are in a profession that requires lots of patience and curiosity. All users of ROMS go through the learning phase by themselves slowly by exploring the code and reading the instructions provided in the Wiki. ROMS is not a black box, and some knowledge of the computer environment, Unix, compilers, and ocean modeling is required. There are several examples of ROMS configuration in the test repository. See the ROMA Wiki for more information.


Top
 Profile  
Reply with quote  
 Post subject: Re: compile ROMS error
PostPosted: Fri Jun 07, 2019 10:07 am 
Offline

Joined: Tue May 28, 2019 11:37 pm
Posts: 1
Location: Ecosost
Hi! I'm new in ROMS and I got several errors while trying to installing it, but I have fixed every one until this last one I got some days ago. It happens while I try to compile ROMS. I have read some other topics but I can't fix it even if I try to follow what you recommended to other people.

I think I get one of the most popular errors, but I can't fix it. It's the one explained in the FAQ section in the wiki.
Code:
/home/keles/roms/Projects/Upwelling/Build_roms/libUTIL.a(close_io.o):close_io.f90:(.text+0x120c): undefined reference to `__netcdf_MOD_nf90_strerror'

Followed by many, many messages like this one. But after the first one I get:
Code:
/home/keles/roms/Projects/Upwelling/Build_roms/libUTIL.a(close_io.o):close_io.f90:(.text+0x120c): truncated relocation to adjust: R_X86_64_PC32 against the undefined reference to: `__netcdf_MOD_nf90_strerror'

(Sorry if it doesn't make sense, but I got the messages in Spanish and I tried to translate them to the way I supposed they are shown in English)

I have copied build_roms.bash and my_build_paths.bash to the Upwelling folder and customized them changing:
Code:
 export         COMPILERS=/home/keles/roms/Projects/Upwelling

and
Code:
#export USE_MY_LIBS=no            # use system default library paths
 export USE_MY_LIBS=yes           # use my customized library paths
MY_PATHS=${COMPILERS}/my_build_paths.bash

in the build_roms.bash file.

At the bottom, I get:
Code:
collect2: error: ld returned 1 exit status
make: *** [Master/Module.mk:22: /home/keles/roms/Projects/Upwelling/romsS.exe] Error 1

I have also changed in the my_build_paths.bash file:
Code:
      export    NETCDF_INCDIR=/usr/local/include
      export    NETCDF_LIBDIR=/usr/local/lib

Because that is the place I compile NETCDF (both NetCDF C 4.7.0 and NetCDF Fortran 4.4.5). Finally, I have also modified the CYGWIN-gfortran.mk file to look like:
Code:
    NETCDF_INCDIR ?= /usr/local/include
    NETCDF_LIBDIR ?= /usr/local/lib
      NETCDF_LIBS ?= -lnetcdff -lnetcdf


Do you know if I am missing some step or if I am not doing something in the right way?

Thank you very much for your concern!
Carlos.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group