NOAA-GFDL / ESM4

8 stars 11 forks source link

Issues to compile ESM4 #4

Open JFA-Mbule opened 3 years ago

JFA-Mbule commented 3 years ago

Hello, my name is Jaime a new user. I'm trying to run the ESM4 model from GFDL and, I found some issues with the compilation process. The problem was found in the general Makefile.

I made some changes in the codes to compile. The changes allowed me to compile all subfolders in ESM4/exec/. So, the error is in the generation of the executable (esm4.1.x file). However, to examine the general Makefile and the mpp.F90 file, I found that the issue is in

<esm4.1.x: coupler/libcoupler.a atmos_dyn/libatmos_dyn.a sis2/libsis2.a atmos_cubed_sphere/libatmos_cubed_sphere.a mom6/libmom6.a icebergs/libicebergs.a lm4P/liblm4P.a atmos_phys/libatmos_phys.a fms/libfms.a
$(LD) $^ $(LDFLAGS) -o $@  $(STATIC_LIBS) >". 

The gnu.mk is not creating esm4.1.x in the general Makefile becouse the fms/libfms.a (mpp.o): in the funtion "__mpp_mod_MOD_get_peset": is not defined for this reference to "mpi_comm_creategroup"

In summary the error is:

/home/jaime/ESM4_original/src/atmos_phys/atmos_param/clubb/CLUBB_core/lapack_wrap.F90:720: Undefined reference to "disnan_"
/usr/bin/ld: fms/libfms.a(mpp.o): in the funtion "__mpp_mod_MOD_get_peset":
mpp.F90:(.text+0x5134): Undefined reference to "mpi_comm_create_group_"
collect2: error: ld returned 1 exit status
make: *** [Makefile:22: esm4.1.x] Erro 1

Another information dealing with the error says that:

make [1]: Leaving the '/ home / jaime / ESM4_original / exec / coupler' directory

mpif90 coupler / libcoupler.a atmos_dyn / libatmos_dyn.a sis2 / libsis2.a atmos_cubed_sphere / libatmos_cubed_sphere.a mom6 / libmom6.a icebergs / libicebergs.a lm4P / liblm4P.a atmos_phys / libatmos_phys / libatmos_phys-lib.mos -L / usr / lib / x86_64-linux-gnu -lnetcdff -Wl, -Bsymbolic-functions -Wl, -z, clock -Wl, -z, now -lnetcdf -lnetcdf -ldl -lm -o esm4.1.x "

which seems to me that some command is not being appropriate to connect the files.

please, someone could tell me the real reason for this and how can I resolve it? In addition, someone could tell me if is possible to create the executable (esm4.1.x file) in another way? once I've already managed to compile for other subfolders.

please someone help me!

I'm run on my laptop, Linux-ubuntu-gnu operational system.

thomas-robinson commented 3 years ago

Please make with the option CLUBB=off

make gcc=on CLUBB=off

Add any other options you see fit. They are listen in the gnu.mk file.

I doubt you will be able to run ESM4 on a laptop. It requires a lot of compute power. Let me know if you get it to work.

JFA-Mbule commented 3 years ago

I made this option, but the problem still persists. Is it a conflict between the flags?

I will try to run small experiments.

thomas-robinson commented 3 years ago

Are you using the most up-to-date code? What is the exact make command you are using?

JFA-Mbule commented 3 years ago

I think so. I'm using the code that cloning on the website.

The first I compile using only "make OPENMP=on". I also tested the other README options, but none worked, so I made any changes to the commands by adding CC = gcc and the CXX = g ++. Afterwards I just gave "make" it compiled the subfolders, but it didn't generate the executable.

Oh, I was forgetting it, I also changed/removed the "static" command from the affinity.c file.

thomas-robinson commented 3 years ago

It sounds like there are a bunch of edits and updates that you've made. You should only need to update gnu.mk if you aren't using mpif90 and mpicc. I compile with one of the gcc 10 compilers and mpich built with that compiler.

I suggest maybe starting over (fresh clone), editing the gnu.mk with the correct mpi compilers, and then doing

make gcc=on CLUBB=off

By compiling with CLUBB=off you will remove the lapack dependencies. If you want to run CLUBB, then that is a separate issue.

Don't set CC=gcc, you should use an mpi C compiler like mpicc. You should set it in the gnu.mk file.

If that doesn't work, let me know the libraries that aren't being linked.

JFA-Mbule commented 3 years ago

Right, I will do that!

JFA-Mbule commented 3 years ago

My compiler is gcc 9.3.0. I have MPI installed, so I don't understand why the errors below. Is it the version of gcc?

I didn't change anything I just cloned and gave the "make gcc=on CLUBB=off" as suggested and then I had the errors below.

mpicc -DINTERNAL_FILE_NML -Duse_libMPI -Duse_netCDF -Duse_netCDF -DHAVE_SCHED_GETAFFINITY -DIFC -I/usr/include -I/usr/include/hdf5/serial -O2 -c /home/jaime/ESM4_Model_GFDL/src/FMS/affinity/affinity.c f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? make[1]: * [Makefile:151: platform.o] Erro 1 make[1]: * Esperando que outros processos terminem. f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? make[1]: [Makefile:119: mersennetwister.o] Erro 1 f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? f95: error: unrecognized command line option ‘-fallow-invalid-boz’ make[1]: [Makefile:153: quicksort.o] Erro 1 f95: error: unrecognized command line option ‘-fallow-invalid-boz’ f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? make[1]: [Makefile:123: monin_obukhov_inter.o] Erro 1 make[1]: [Makefile:177: tridiagonal.o] Erro 1 f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? make[1]: [Makefile:161: sat_vapor_pres_k.o] Erro 1 f95: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’? make[1]: [Makefile:29: cloud_interpolator.o] Erro 1 make[1]: [Makefile:65: drifters_io.o] Erro 1 make[1]: *** [Makefile:63: drifters_input.o] Erro 1 /home/jaime/ESM4_Model_GFDL/src/FMS/affinity/affinity.c:46:14: error: static declaration of ‘gettid’ follows non-static declaration 46 | static pid_t gettid(void) | ^~ In file included from /usr/include/unistd.h:1170, from /home/jaime/ESM4_Model_GFDL/src/FMS/affinity/affinity.c:33: /usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here 34 | extern __pid_t gettid (void) THROW; | ^~ make[1]: [Makefile:13: affinity.o] Erro 1 make[1]: Saindo do diretório '/home/jaime/ESM4_Model_GFDL/exec/fms' make: [Makefile:25: fms/libfms.a] Erro 2

thomas-robinson commented 3 years ago

the file gnu.mk FFLAGS on line 85 has the options -fallow-argument-mismatch and -fallow-invalid-boz which are included for gcc10. If you are using gcc 9.3.0 you should remove those options from line 85.

JFA-Mbule commented 3 years ago

Hi, Thomas-Robinson

I made the changes, however, It was still complaining about some libraries (lapark and mpichfort). I added these flags to the line 171 of gnu.mk file, making it look like "LDFLAGS + = $ (LIBS) -lmpichfort -lnetcdff -llapack". In addition, I had to remove the "static" from affinity.c for it to work, following the discussions I found here (https://github.com/NOAA-GFDL/FMS/issues/426).

Doing this, the compilation worked and generated the file esm4.1.x with the size of 74.2 MB. However, as I said, I've been trying other options before, and one of them was using the file linux-gnu.mk and linux-ubuntu-trusty-gnu.mk. Using the file linux-ubuntu-trusty-gnu.mk, of course with the addition of the flags above, the file esm4.1.x was generated, but with a size of 86.7 MB.

Do you have any idea why this difference occur? Besides, could you tell me what is the size of the esm4.1.x file normally?

Thanks!

JFA-Mbule commented 2 years ago

Hi, Robinson,

I'm here again. To remember you, in the previous year (2021) I open an issue about ESM4 compilation.

I want to use ESM4 in my doctoral research. I'm a complete beginner in modeling, so I'm looking for help to overcome the difficulties I'm encountering. I remembered our conversation, and I thought if you could help me with some things about the ESM4 model.

For example, I currently added it to a supercomputer at my institution here in Brazil, but I'm still having problems with the compilation there. I followed the steps presented on the GitHub website, but without success. So I'm testing these options that you passed here in the e-mail.

I've been doing a lot of research to find people who have some experience with this model, but I haven't found anyone who has used it. So it's hard to follow. I would like to know if, by chance, you or someone there at GFDL has an e-book to help me with the first steps.

I searched and didn't find any example of model execution on the internet, I wanted to run some experiments with ERA5 data, is it possible to run this model with ERA5 reanalysis data?

If so, could you guide me on some steps to follow to succeed with the experiments?

*** ---------------------------


Jaime F. António Graduated at Federal University of Alagoas - UFAL MSc. at Center for Weather Forecast and Climate Studies of the National Institute for Space Research - CPTEC/INPE Ph.D. student at CPTEC/INPE @.* https://github.com/JFA-Mbule ***** ---------------------------


[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& 10/06/22 18:34:55

Em ter., 27 de abr. de 2021 às 10:20, Tom Robinson @.***> escreveu:

the file gnu.mk FFLAGS on line 85 https://github.com/NOAA-GFDL/ESM4/blob/main/exec/templates/gnu.mk#L85 has the options -fallow-argument-mismatch and -fallow-invalid-boz which are included for gcc10. If you are using gcc 9.3.0 you should remove those options from line 85.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/ESM4/issues/4#issuecomment-827601111, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCJXRFTTD55QIMIQZT3EV3TK222JANCNFSM43M6WHSA .