Hello sir,
I am trying to compile ROMS for the first time. I followed on windows 10 this: Tutorial: Installing ROMS in Windows XP / Vista / 7 (via Cygwin) and everything was fine. But when I tried to compile ROMS with the command $ ./build_roms.sh I obtain the following lines ,which I am attaching as a picture of cygwin terminal:
aBc@DESKTOP-UOIVLQT ~/roms/Projects/Upwelling
$ ./build_roms.sh
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Using customized library paths from: /home/aBc/roms/trunk/Compilers/my_build_paths.sh
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
rm -f -r core *.ipo /home/aBc/roms/Projects/Upwelling/Build_roms /home/aBc/make_macros.mk
which: no gfortran-4 in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/IntelSWTools/compilers_and_libraries_2020.0.166/windows/mpi/intel64/bin:%INTEL_DEV_REDIST%redist/intel64_win/mpirt:%INTEL_DEV_REDIST%redist/ia32_win/mpirt:%INTEL_DEV_REDIST%redist/intel64_win/compiler:%INTEL_DEV_REDIST%redist/ia32_win/compiler:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/MATLAB/R2019b/runtime/win64:/cygdrive/c/Program Files/MATLAB/R2019b/bin:/cygdrive/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/c/Program Files/dotnet:/cygdrive/c/Users/aBc/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/aBc/.dotnet/tools)
/bin/sh: --: invalid option
Usage: /bin/sh [GNU long option] [option] ...
/bin/sh [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
--wordexp
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
cp -f /opt/gfortransoft/serial/netcdf3/include/netcdf.mod /home/aBc/roms/Projects/Upwelling/Build_roms
cp: cannot stat '/opt/gfortransoft/serial/netcdf3/include/netcdf.mod': No such file or directory
make: *** No rule to make target '/home/aBc/roms/Projects/Upwelling/Build_roms/netcdf.mod', needed by '/home/aBc/roms/Projects/Upwelling/Build_roms/MakeDepend'. Stop.
My paths were as follows:
cygwin: C:\cygwin64
for the build_roms.sh : C:\cygwin64\home\aBc\roms\Projects\Upwelling
for the netcdf-3.6.1: C:\cygwin64\home\aBc\netcdf-3.6.1
I am attaching my error snippet and build_roms.sh file as an attachment.
I also checked quite a few forum discussion but nothing was able to solve my problem and I am not sure why this is not compiling. Could you please help me out with the compilation? I am new to ROMS .
Kind regards
Shankhaneel Basak
Error while compiling ROMS for the first time.
- neelbasak08
- Posts: 99
- Joined: Wed Dec 09, 2020 3:58 pm
- Location: Thapar Institute of Engineering and Technology, Patiala, PN, India
Error while compiling ROMS for the first time.
- Attachments
-
- build_roms.sh
- (10.97 KiB) Downloaded 292 times
Re: Error while compiling ROMS for the first time.
I would suggest trying Windows Subsystem for Linux (WSL) if that is an option for you. More information can be found here. We don't have a tutorial for that but, once you have your WSL setup, the procedure should be the same as regular Linux.
The Cygwin tutorial in the wiki is very old and many things have changed in Cygwin. For example, NetCDF can be selected as a package and gcc4 isn't even an option. The specific error you are encountering is because the gfortran executable is not called gfortran-4 anymore. It's most likely just called 'gfortran' now without any version specification. If you are using gfortran 10 you may need to add "-fallow-argument-mismatch" to FFLAGS in your CYGWIN-gfortran.mk file.
That tutorial also still references the old version of the ROMS build script before the library path information was split into a separate file (see Trac Ticket #794). This is resulting in incorrect paths set for NETCDF_INCDIR and NETCDF_LIBDIR, thus your "No such file or directory" error. We suggest that you create a Compilers/ROMS directory in your home directory and copy the my_build_paths.sh and CYGWIN-gfortran.mk files from the ROMS source code into it. Then you can edit that my_build_paths.sh file setting the appropriate paths and update your build script (COMPILERS environment variable) to load the correct my_build_paths.sh file.
All that said, if you install the NetCDF package provided by Cygwin, undo the edit to CYGWIN-gfortran.mk, and enable USE_NETCDF4 and set USE_MY_LIBS to no in the build script, there's a good chance it will build correctly.
The Cygwin tutorial in the wiki is very old and many things have changed in Cygwin. For example, NetCDF can be selected as a package and gcc4 isn't even an option. The specific error you are encountering is because the gfortran executable is not called gfortran-4 anymore. It's most likely just called 'gfortran' now without any version specification. If you are using gfortran 10 you may need to add "-fallow-argument-mismatch" to FFLAGS in your CYGWIN-gfortran.mk file.
That tutorial also still references the old version of the ROMS build script before the library path information was split into a separate file (see Trac Ticket #794). This is resulting in incorrect paths set for NETCDF_INCDIR and NETCDF_LIBDIR, thus your "No such file or directory" error. We suggest that you create a Compilers/ROMS directory in your home directory and copy the my_build_paths.sh and CYGWIN-gfortran.mk files from the ROMS source code into it. Then you can edit that my_build_paths.sh file setting the appropriate paths and update your build script (COMPILERS environment variable) to load the correct my_build_paths.sh file.
All that said, if you install the NetCDF package provided by Cygwin, undo the edit to CYGWIN-gfortran.mk, and enable USE_NETCDF4 and set USE_MY_LIBS to no in the build script, there's a good chance it will build correctly.
- neelbasak08
- Posts: 99
- Joined: Wed Dec 09, 2020 3:58 pm
- Location: Thapar Institute of Engineering and Technology, Patiala, PN, India
Re: Error while compiling ROMS for the first time.
Thank you Mr. Robertson
It worked like magic for me. Now I am able to compile ROMS with ease. Thank you so much for your guidance.
It worked like magic for me. Now I am able to compile ROMS with ease. Thank you so much for your guidance.