-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encountered an issue while compiling RegCM5.0 #35
Comments
After configuring environment variable, can you find the nf-config? On my development machine: nf-config --all This netCDF-Fortran 4.6.0 has been built with the following features: --cc -> gcc --fc -> gfortran --has-nc2 -> yes --prefix -> /home/netapp-clima/users/ggiulian/m20 Path will be different on your system, obviously, but is the nf-config script available in the path? |
Thank you very much for your answer. Based on your guidance, I gave it a try and my computer output is as follows: This netCDF-Fortran 4.4.4 has been built with the following features: --cc -> gcc --fc -> gfortran --has-nc2 -> yes --prefix -> /data/user/local/netcdf4-needed |
Can you post the config.log? |
[root@localhost RegCM5]# cat -n config.log |
The problem is this one: I think your netcdf Fortran + netcdf C library is not in shape. My guess is that you compiled the Fortran library against a system present netcdf C library somewhere else in in the system. This is error comes usually in trying to link against conflicting versions of netCDF libraries. Have you used the install_prereq.sh script? |
Thank you very much for your support. I did not use the install_prereq.sh scripts, and each one was installed separately. I replaced the versions of netcdf-c and netcdf-fortran, but encountered a problem during reinstallation. An error was reported when installing netcdf-fortran for compilation, as follows,The version of netcdf-c is 4.7.4 and the version of netcdf-fortran is 4.6.1: gfortran -DPACKAGE_NAME="netCDF-Fortran" -DPACKAGE_TARNAME="netcdf-fortran" -DPACKAGE_VERSION="4.6.1" -DPACKAGE_STRING="netCDF-Fortran\ 4.6.1" -DPACKAGE_BUGREPORT="[email protected]" -DPACKAGE_URL="" -DPACKAGE="netcdf-fortran" -DVERSION="4.6.1" -DNF_RELAX_COORD_BOUND=1 -DENABLE_CDF5=1 -DHAVE_F2008=1 -DHAVE_TS29113_SUPPORT=1 -DTEMP_LARGE="." -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHA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_DOUBLE=8 -DSIZEOF_OFF_T=8 -DSIZEOF_SIZE_T=8 -DSIZEOF_PTRDIFF_T=8 -I. -I/data/user/local/netcdf4-needed/include -I../fortran -g -O2 -c -o module_tests.o module_tests.F90
Fatal Error: File 'netcdf4_f03.mod' opened at (1) is not a GNU Fortran module file |
My take is that on your system you have multiple fortran compilers, and the build system is using both messing up the compilation. Try forcing the values of FC,CC in the environment. Take a look at the prereq_install.sh script and try adopting a similar strategy. Note the use also of of CPPFLAGS, FCFLAGS and LD_FLAGS and the setup of PATH, LD_LIBRARY_PATH. If you use cmake, I think it may be CMAKE_SYSTEM_PREFIX_PATH that you want to set. I don't have access to your system to sort things out for you, though, and I am guessing the problem from the symptoms without the means for a sure remedy. |
I reported an error while compiling RegCM5.0. Configure: error: NetCDF library not found, but my NetCDF has been installed and my environment variables have also been configured. I don't know why? awaiting for a reply.Thanks.
The text was updated successfully, but these errors were encountered: