DOI-USGS / COAWST

COAWST modeling system git repository
Other
104 stars 48 forks source link

Compilation issues - Linux gfortran #121

Closed xpijuan closed 1 year ago

xpijuan commented 1 year ago

Hello, I am trying to compile the sandy case, but with no luck. OS is a Centos 7.9, gfortran (gcc 11.2.1), all prerequisits compiled. After some testing I think the cause is MCT, make mct_params is returning:

make mct_params

svn: E155007: '/mnt/data2/kgeorge/coawst30' is not a working copy svn: E155007: '/mnt/data2/kgeorge/coawst30' is not a working copy \ cd Build; \ cpp -P -DSHOREFACE -D'HEADER="shoreface.h"' -D'ROMS_HEADER="shoreface.h"' -I/ROMS/Include /Master/MCT_coupler/mod_coupler_kinds.F > mod_coupler_kinds.f90; \ /ROMS/Bin/cpp_clean mod_coupler_kinds.f90; \ /opt/rh/devtoolset-11/root/usr/bin/gfortran -c -frepack-arrays -fallow-argument-mismatch -O3 -ffast-math -O3 -ftree-vectorize -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none -frecord-marker=4 -fconvert=big-endian mod_coupler_kinds.f90; \ cpp -P -DSHOREFACE -D'HEADER="shoreface.h"' -D'ROMS_HEADER="shoreface.h"' -I/ROMS/Include /Master/MCT_coupler/mct_coupler_params.F > mct_coupler_params.f90; \ /ROMS/Bin/cpp_clean mct_coupler_params.f90; \ /opt/rh/devtoolset-11/root/usr/bin/gfortran -c -frepack-arrays -fallow-argument-mismatch -O3 -ffast-math -O3 -ftree-vectorize -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none -frecord-marker=4 -fconvert=big-endian mct_coupler_params.f90; cc1: fatal error: /Master/MCT_coupler/mod_coupler_kinds.F: No such file or directory compilation terminated. /bin/sh: line 3: /ROMS/Bin/cpp_clean: No such file or directory cc1: fatal error: /Master/MCT_coupler/mct_coupler_params.F: No such file or directory compilation terminated. /bin/sh: line 6: /ROMS/Bin/cpp_clean: No such file or directory

The .F files are in their place, permissions checked (trying as root). Any thoughts? I cannot find what I am doing wrong. Thank you. Regards, Xavier

jcwarner-usgs commented 1 year ago

looks like some files are missing "/Master/MCT_coupler/mod_coupler_kinds.F: No such file or directory" is this a new version of code? This is not MCT problem, i made some routines and put them in a directory /Master/MCT_coupler do you have that folder?

xpijuan commented 1 year ago

Hello, Yes the folder is there, ls shows:

ls Master

CMakeLists.txt master.F mct_roms_ww3.h read_model_inputs.F coupler.F MCT_coupler mod_coupler_iounits.F roms_export.F esmf_driver.h mct_coupler_utils.F Module.mk roms_import.F esmf_roms.F mct_driver.h ocean_control.F waves.h get_numswan_grids.F mct_roms_hydro.h ocean_coupler.F ww3_iounits.F get_sparse_matrix.F mct_roms_refdif.h ocean.h get_wrf_moving_grids.F mct_roms_swan.h propagator.F inwave.h mct_roms_wrf.h read_coawst_par.F

ls Master/MCT_coupler/

mct_coupler_params.F mod_coupler_kinds.F

It is a build from some days ago, I was trying to resolve another compilation issue with the last possible version. Attached you'll find the coawst.bash -nocleanwrf error log.

log.txt

jcwarner-usgs commented 1 year ago

i think there is a path issue, and maybe some other issues. can you send me the coawst.bash. also, do you have the coawst.bash in the COAWST root dir?

xpijuan commented 1 year ago

Yes, it is in the root dir. You will see two different paths because the end user (I am the IT support) made a copy of the whole directory to work on the case, but the libraries are in the another (shared) location. The project files are on /mnt/data2/kgeorge/coawst30, whilst our COAWST is in /home/COAWST-master, with the compiled libraries in /home/COAWST-master/Libraries These are the environment vars we source prior to the compilation: export ZDIR=/home/COAWST-master/Libraries export H5DIR=/home/COAWST-master/Libraries export NCDIR=/home/COAWST-master/Libraries export LD_LIBRARY_PATH=/home/COAWST-master/Libraries/lib:$LD_LIBRARY_PATH export NFDIR=/home/COAWST-master/Libraries export NETCDF_INCDIR=/home/COAWST-master/Libraries/include export NETCDF_LIBDIR=/home/COAWST-master/Libraries/lib export NETCDF=/home/COAWST-master/Libraries export NETCDF_CONFIG=/home/COAWST-master/Libraries/bin/nf-config export MCT_INCDIR=/home/COAWST-master/Libraries/include export MCT_LIBDIR=/home/COAWST-master/Libraries/lib export PATH=/home/COAWST-master/Libraries/bin:$PATH

Thank you. PD: I'm attaching the coawst.bash

coawst.bash.txt

jcwarner-usgs commented 1 year ago

when you compile the code, you should type

./coawst.bash

are you using that?

xpijuan commented 1 year ago

Yes, ./coawst.bash -j 6

El dimecres, 22 de febrer de 2023, john warner @.***>) va escriure:

when you compile the code, you should type

./coawst.bash

are you using that?

— Reply to this email directly, view it on GitHub https://github.com/jcwarner-usgs/COAWST/issues/121#issuecomment-1440812935, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLT3EF35UJZJGAZ255WOBLWYZ7NJANCNFSM6AAAAAAVEQPYSM . You are receiving this because you authored the thread.Message ID: @.***>

jcwarner-usgs commented 1 year ago

ok we will need to try a few things here. when you say ./.coawst.bash that is a bash script that sets some env variables, then it basically calls make mct_params In the make file we have the first 3 steps:

mct_params: 1) cd $(SCRATCH_DIR);

2) cpp -P $(ROMS_CPPFLAGS) -I$(MY_ROMS_SRC)/ROMS/Include $(MY_ROMS_SRC)/Master/MCT_coupler/mod_coupler_kinds.F > mod_coupler_kinds.f90;

3) $(MY_ROMS_SRC)/$(CLEAN) mod_coupler_kinds.f90; \

In your output i see:

1) cd Build; [that is good]

Then i see: 2) cpp -P -DSHOREFACE -D'HEADER="shoreface.h"' -D'ROMS_HEADER="shoreface.h"' -I/ROMS/Include /Master/MCT_coupler/mod_coupler_kinds.F > mod_coupler_kinds.f90;

This is bad because it is missing the "$(MY_ROMS_SRC) You call is only -I/ROMS/Include but it should be -I$(MY_ROMS_SRC)/ROMS/Include So your system is not picking up the $(MY_ROMS_SRC)

can you try this. edit the coawst.bash and change line 144 from export MY_ROMS_SRC=${MY_ROOT_DIR}/ to export MY_ROMS_SRC=/mnt/data2/kgeorge/coawst30

and do ./coawst.bash

xpijuan commented 1 year ago

Hello, Thank you for your help. I removed the final slash from the line 144 and some blanks between export and MY_... and it worked. Now I have tried again activating waves, and I have another error, I am attaching the error output from the command: ./coawst.bash -j 4 2>log.txt Could it be related to the fact that openmpi was compiled with a different gcc version than the used in this one? Thank you. Xavier log.txt

jcwarner-usgs commented 1 year ago

glad you are making progress. do not use tabs or spaces in the paths. is that log file only the warning messages? Can you send the full build output?

xpijuan commented 1 year ago

Yes, it was only the error output. Here you have the whole log. build.txt

jcwarner-usgs commented 1 year ago

wow. there is a missing comma. sorry

edit SWAN/Src/swanout1.F and change line 1588 from & COMPDA(1,JDP2) ,CROSS 40.86 to & COMPDA(1,JDP2) ,CROSS , 40.86

be careful to line up the comma with the line above it.

and do a ./coawst.bash -nocleanwrf -noclean

and see if that works.

jcwarner-usgs commented 1 year ago

ok so i ended up rolling back the stokes_spectra formulation that i had just added. it seems to have some issues with some applications so i rolled it back. can you do a: git pull and that will correct the comma issue above. you will need to recompile with ./coawst.bash sorry. let me know it that works.

xpijuan commented 1 year ago

Hello, Thanks for your efforts. I changed only the two files you changed in your last commit, globaldefs.h and swanout1.F, Compilation now throws a new error. I'm attaching the build log. Thank you! build2.txt

jcwarner-usgs commented 1 year ago

ok. yes i fixed that one too. sorry sorry. i did an update and then tried to roll it back. you didnt get the full rollback do a git pull and try again. -j

John C. Warner, Ph.D. U.S. Geological Survey 384 Woods Hole Road Woods Hole, MA 02543 508-457-2237 ph. 508-457-2310 fax @.**@.>

https://www.usgs.gov/staff-profiles/john-warner


From: xpijuan @.> Sent: Tuesday, February 28, 2023 3:04 AM To: jcwarner-usgs/COAWST @.> Cc: Warner, John C @.>; Comment @.> Subject: [EXTERNAL] Re: [jcwarner-usgs/COAWST] Compilation issues - Linux gfortran (Issue #121)

This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.

Hello, Thanks for your efforts. I changed only the two files you changed in your last commit, globaldefs.h and swanout1.F, Compilation now throws a new error. I'm attaching the build log. Thank you! build2.txthttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjcwarner-usgs%2FCOAWST%2Ffiles%2F10847829%2Fbuild2.txt&data=05%7C01%7Cjcwarner%40usgs.gov%7C5a0bbab389c04832d76f08db19626c43%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638131682780003355%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1arEIMMgkpefp2uiNFhFqlmKt%2BI9W5Dn72oS40thi58%3D&reserved=0

— Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjcwarner-usgs%2FCOAWST%2Fissues%2F121%23issuecomment-1447739009&data=05%7C01%7Cjcwarner%40usgs.gov%7C5a0bbab389c04832d76f08db19626c43%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638131682780003355%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=C16DavrvZ4p3dTUk1ffVQJIuTMB21wxbYoulJL039nw%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACZ6MOE7CTXKCGUQZXCEOZLWZWWQZANCNFSM6AAAAAAVEQPYSM&data=05%7C01%7Cjcwarner%40usgs.gov%7C5a0bbab389c04832d76f08db19626c43%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638131682780003355%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YN4THQS%2BpwZcErtQluQTV%2BxqcDi4r%2FVt0R0yqj6zFpE%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

jcwarner-usgs commented 1 year ago

is this resolved?

xpijuan commented 1 year ago

The compilation was fine, I’m waiting for the end user to make some tests because he got an error running it and I’m not sure if the cause is compilation related. Sorry for the delay, and thank you for all your help! I’ll come back to you as soon as I have something new. Xavier

El diumenge, 5 de març de 2023, john warner @.***>) va escriure:

is this resolved?

— Reply to this email directly, view it on GitHub https://github.com/jcwarner-usgs/COAWST/issues/121#issuecomment-1454969645, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLT3EBM74SF55Y4ZFCGRVTW2P5RHANCNFSM6AAAAAAVEQPYSM . You are receiving this because you authored the thread.Message ID: @.***>

xpijuan commented 1 year ago

Hello, Thanks for all your help, it appears that everything is ok now. The final user is still having some problemes, but they seem to be related to the used roms. Regards, Xavier