LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 06-06-2020, 04:12 AM   #1
Mishel
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Rep: Reputation: Disabled
NoahMP _ Problems compiling with MAX_SOIL_LEVELS


(cd Utility_routines; make)
make[1]: Entering directory `/home/HRLDAS/src/HRLDAS-v3.6/Utility_routines'

rm -f module_date_utilities.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_date_utilities.F > module_date_utilities.f
gfortran -o module_date_utilities.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_date_utilities.f


rm -f module_model_constants.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_model_constants.F > module_model_constants.f
gfortran -o module_model_constants.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_model_constants.f


rm -f module_wrf_utilities.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_wrf_utilities.F > module_wrf_utilities.f
gfortran -o module_wrf_utilities.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_wrf_utilities.f


rm -f kwm_string_utilities.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ kwm_string_utilities.F > kwm_string_utilities.f
gfortran -o kwm_string_utilities.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none kwm_string_utilities.f

make[1]: Leaving directory `/home/HRLDAS/src/HRLDAS-v3.6/Utility_routines'
(cd Noah; make)
make[1]: Entering directory `/home/HRLDAS/src/HRLDAS-v3.6/Noah'

rm -f module_sf_myjsfc.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_myjsfc.F > module_sf_myjsfc.f
gfortran -o module_sf_myjsfc.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_myjsfc.f


rm -f module_sf_sfclay.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_sfclay.F > module_sf_sfclay.f
gfortran -o module_sf_sfclay.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_sfclay.f


rm -f module_sf_noahmplsm.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_noahmplsm.F > module_sf_noahmplsm.f
gfortran -o module_sf_noahmplsm.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_noahmplsm.f


rm -f module_sf_noahmp_glacier.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_noahmp_glacier.F > module_sf_noahmp_glacier.f
gfortran -o module_sf_noahmp_glacier.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_noahmp_glacier.f


rm -f module_sf_noahmp_groundwater.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_noahmp_groundwater.F > module_sf_noahmp_groundwater.f
gfortran -o module_sf_noahmp_groundwater.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_noahmp_groundwater.f


rm -f module_sf_noahmpdrv.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_sf_noahmpdrv.F > module_sf_noahmpdrv.f
gfortran -o module_sf_noahmpdrv.o -c -I. -I../Utility_routines -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none module_sf_noahmpdrv.f

make[1]: Leaving directory `/home/HRLDAS/src/HRLDAS-v3.6/Noah'
(cd IO_code; make)
make[1]: Entering directory `/home/HRLDAS/src/HRLDAS-v3.6/IO_code'

rm -f module_hrldas_netcdf_io.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_hrldas_netcdf_io.F > module_hrldas_netcdf_io.f
gfortran -o module_hrldas_netcdf_io.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none -I../Utility_routines -I/home/HRLDAS/LIBRARIES/netcdf/include module_hrldas_netcdf_io.f


rm -f module_NoahMP_hrldas_driver.f
cpp -C -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_ module_NoahMP_hrldas_driver.F > module_NoahMP_hrldas_driver.f
gfortran -o module_NoahMP_hrldas_driver.o -c -g -fconvert=big-endian -fbounds-check -fno-range-check -ffree-form -ffree-line-length-none -I. \
-I../Noah -I../Utility_routines -I/home/HRLDAS/LIBRARIES/netcdf/include module_NoahMP_hrldas_driver.f
module_NoahMP_hrldas_driver.f:334.18:

REAL, DIMENSION(MAX_SOIL_LEVELS) :: soil_thick_input ! depth to soil in
1
Error: Expression at (1) must be of INTEGER type, found REAL
module_NoahMP_hrldas_driver.f:334.18:

REAL, DIMENSION(MAX_SOIL_LEVELS) :: soil_thick_input ! depth to soil in
1
Error: Expression at (1) must be of INTEGER type, found REAL
module_NoahMP_hrldas_driver.f:334.54:

REAL, DIMENSION(MAX_SOIL_LEVELS) :: soil_thick_input ! depth to soil in
1
Error: The module or main program array 'soil_thick_input' at (1) must have constant shape
make[1]: *** [module_NoahMP_hrldas_driver.o] Error 1
make[1]: Leaving directory `/home/HRLDAS/src/HRLDAS-v3.6/IO_code'
make: *** [all] Error 2
 
Old 06-07-2020, 08:03 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Somehow, the issue you opened in HRLDAS repo on GitHub includes more info than your post here.

Perhaps the version of gfortran in Ubuntu 20.04 enforces some restrictions that weren't in place previously. Try to compile with -std=legacy.

One thing I noticed is the affected code line in your post above is #334 and in the compiler output from the GitHub issue #31 it is line #341, whereas the relevant code line in the git repository is #565. Looks like you're compiling an older version. Try checking out the latest git snapshot, maybe your issue is already fixed there.

And if everything else fails try replacing the constant MAX_SOIL_LEVELS with its value in the code:
Code:
REAL, DIMENSION(10) :: soil_thick_input
 
Old 06-08-2020, 01:38 PM   #3
Mishel
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
New issues regarding HRLDAS

Hi shruggy:
I tried what you suggested me.
First comment, did not change any result
Regarding isntalling new version, now I'm having new outputs as follows:

Code:
mishel@mishel-VirtualBox:~/HRLDAS/HRLDAS$ make
(cd Utility_routines;		make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/Utility_routines'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/Utility_routines'
(cd phys;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/phys'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/phys'
(cd IO_code;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/IO_code'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/IO_code'
(cd run;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/run'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/run'
(cd HRLDAS_forcing;		make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
(cd lib; make)
make[2]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
(make -f Makefile all)
make[2]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'

rm -f create_forcing.f90
/usr/bin/cpp -C -P -traditional -D_GFORTRAN_  create_forcing.F > create_forcing.f90
/usr/bin/gfortran -ffree-form -ffree-line-length-none -g -fconvert=big-endian -fbounds-check -fno-range-check -fno-underscoring -c -I/usr/include/ -I./lib -I./lib create_forcing.f90
create_forcing.f90:1:1:

    1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc.
      | 1
Error: Invalid character in name at (1)
create_forcing.f90:16:4:

   16 |    <https://www.gnu.org/licenses/>.  */
      |    1
Error: Invalid character in name at (1)
create_forcing.f90:19:1:

   19 | /* This header is separate from features.h so that the compiler can
      | 1
Error: Invalid character in name at (1)
create_forcing.f90:22:4:

   22 |    <features.h> because the implicit include comes before any feature
      |    1
Error: Invalid character in name at (1)
create_forcing.f90:27:1:

   27 | /* glibc's intent is to support the IEC 559 math functionality, real
      | 1
Error: Invalid character in name at (1)
create_forcing.f90:36:1:

   36 | /* wchar_t uses Unicode 10.0.0.  Version 10.0 of the Unicode Standard is
      | 1
Error: Invalid character in name at (1)
make[2]: *** [Makefile:25: create_forcing.o] Error 1
make[2]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
make[1]: *** [Makefile:13: default] Error 2
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
make: *** [Makefile:12: all] Error 2
This happened trying with Ubuntu 20.04.
DO you have any guess what this is happening?
THanks in advance for your help.
Cheers,
Mishel
 
Old 06-08-2020, 01:52 PM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Remove the -C option from the cpp command line. You want C-style comments to be discarded, not to be passed through to the Fortran compiler.
 
Old 06-08-2020, 01:57 PM   #5
Mishel
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
I did that. AWesome!
But I'm still having issues. Those are my outputs so far:

Code:
(cd Utility_routines;		make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/Utility_routines'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/Utility_routines'
(cd phys;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/phys'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/phys'
(cd IO_code;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/IO_code'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/IO_code'
(cd run;			make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/run'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/run'
(cd HRLDAS_forcing;		make)
make[1]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
(cd lib; make)
make[2]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
(make -f Makefile all)
make[2]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
(cd lib; make)
make[3]: Entering directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib'
/usr/bin/gfortran -o create_forcing.exe -I./lib -g -fconvert=big-endian -fbounds-check -fno-range-check -fno-underscoring -I./lib create_forcing.o \
	-L./lib -lsmda -L/usr/include/ -lnetcdf -lnetcdff -lbz2 -ljpeg -L/usr/lib/x86_64-linux-gnu/ -ljasper
/usr/bin/ld: ./lib/libsmda.a(module_grib2.o): in function `__module_grib2_MOD_fortran_decode_jpeg2000':
/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib2.f90:146: undefined reference to `info_jpeg2000'
/usr/bin/ld: /home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib2.f90:154: undefined reference to `decode_jpeg2000'
/usr/bin/ld: ./lib/libsmda.a(module_grib.o): in function `__module_grib_MOD_findgrib':
/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:184: undefined reference to `io_fread'
/usr/bin/ld: /home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:201: undefined reference to `io_fread'
/usr/bin/ld: /home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:221: undefined reference to `io_fread'
/usr/bin/ld: /home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:278: undefined reference to `io_ftell'
/usr/bin/ld: ./lib/libsmda.a(module_grib.o): in function `__module_grib_MOD_getgrib':
/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:112: undefined reference to `io_fread'
/usr/bin/ld: ./lib/libsmda.a(module_grib.o): in function `__module_grib_MOD_gribclose':
/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:75: undefined reference to `c_close'
/usr/bin/ld: ./lib/libsmda.a(module_grib.o): in function `__module_grib_MOD_gribopen':
/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing/lib/module_grib.f90:65: undefined reference to `c_gribopen'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:29: create_forcing.exe] Error 1
make[2]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
make[1]: *** [Makefile:13: default] Error 2
make[1]: Leaving directory '/home/mishel/HRLDAS/HRLDAS/HRLDAS_forcing'
make: *** [Makefile:12: all] Error 2
 
Old 06-08-2020, 02:07 PM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Undefined references usually mean a library is missing. See this issue though. The solution is to delete the -fno-underscoring in user_build_options.
 
Old 06-09-2020, 10:01 AM   #7
Mishel
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Undefined references usually mean a library is missing. See this issue though. The solution is to delete the -fno-underscoring in user_build_options.
I did that but still. Perhaps is the Ubuntu version I'm using? (20.04)
 
Old 06-09-2020, 10:51 AM   #8
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
But still what? You have the same issue? Or something different? Ubuntu 20.04 ships with four versions of gfortran:
Code:
$ aptitude -F%p search '~Pfortran95-compiler~rnative'
gfortran-10
gfortran-7
gfortran-8
gfortran-9
That's not counting flang-7. None of them works for you?

Last edited by shruggy; 06-10-2020 at 10:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling a Slackware package from source vs Compiling from source. khronosschoty Slackware 5 09-26-2008 06:09 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Compiling in ACPI support on Compaq 2135CA (system crashes while compiling) Dag Linux - Laptop and Netbook 20 07-30-2004 07:56 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration