Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

error trying to build AMIP CCSM scenario

Hi all,I'm new to running/building CCSM.  Im trying to set up an AMIP run on an intel 64bit RHEL pgi machine...I am able to get through the first few steps, but I am now getting stuck on the getting the build script to compile properly (with an AMIP intel pgi test case).  I get the following error, which I trace back through the error logs and it looks like it cannot find a gcc or C compiler when I look at the config.log file and all the error messages below.  (although 'which gcc' definitely shows that I have it installed on the machine)Does anyone happen to know where/why my error may be occurring?  Any help would be greatly appreciated!   When I open the config file I see the following error(s):./configure  CC="mpicc" FC="mpif90" F90="mpif90" INCLUDEPATH="-I/usr/local/mpich-1.2.7p1-intel-3.2.02/include"checking for C compiler default output file name... configure: error: C compiler cannot create executables. When I open this config.log file it is alluding to, it looks mostly like it is just outputting my path and throws an error when it is look for the C compiler: configure:1663: checking for C compiler default output file nameconfigure:1666: mpicc  -I/home/i63639/netcdf/include  conftest.c –lnetcdf >&5gcc: –lnetcdf: No such file or directoryconfigure:1669: $? = 1configure: failed program was:| /* confdefs.h.  */|| #define PACKAGE_NAME "MCT"| #define PACKAGE_TARNAME "mct"| #define PACKAGE_VERSION "2.0"| #define PACKAGE_STRING "MCT 2.0"| #define PACKAGE_BUGREPORT ""| /* end confdefs.h.  */|| int| main ()| {||   ;|   return 0;| }configure:1708: error: C compiler cannot create executables 
 

jedwards

CSEG and Liaisons
Staff member
This error:gcc: –lnetcdf: No such file or directory Indicates that it can't find your netcdf lib.    You should have -L $NETCDF_PATH/lib in your LDFLAGS
 
Hi jedwards,
Thanks for the response; much appreciated!  However, in my chsrc I do have my netcdf libs defined and they are located where the cshrc is looking (see below).  Is it possible that CESM or some program/script it is calling is hardcoded to look for the netcdf and other variables in a specific (other) location and is actually overriding my .cshrc file?  Or do I need to set the location of my netcdf locations somewhere else in the CCSM build?  My chsrc lines for netcdf env:#setenv NETCDF /usr/lib64setenv NETCDF /home/i63639/netcdfsetenv PATH ${PATH}:/usr/lib64setenv CPPFLAGS -I${NETCDF}/includesetenv LD_LIBRARY_PATH ${NETCDF}/libsetenv LDFLAGS -L${NETCDF}/libsetenv LIBS –lnetcdf 
 

jedwards

CSEG and Liaisons
Staff member
You shouldn't need to set these in your .cshrc.In your env_mach_specific.$HOST file try settingsetenv NETCDF_PATH /home/i63639/netcdfthat should be all that you need except that newer versions of netcdf also require -lnetcdff  
 
Hi, Ok thank you! In my test case directory though, all I have is an env_mach_specific file.  Not a env_mach_specific.$HOST file.  Do I just need to edit the line in there that is commented out like such:#--- set env variables for Macros if neededsetenv NETCDF_PATH /home/i63639/netcdf Apologies for all the questions but brand new to CESM and compiling/building this model.  Thank you for your help and patience with this!
 

jedwards

CSEG and Liaisons
Staff member
The file scripts/ccsm_utils/Machines/env_mach_specific.$HOST is copied to env_mach_specific in your case directory.   So if you change it inenv_mach_specific you will change it only for your case.   Did you do the port to this machine, or did someone else?
 
I ported/dl'ed CESM directly to this machine from the web.  I do understand how changing this specific file will only work for this test case, but that is fine for the time being.  Unfortunately though, even when I edited that file I still get the following error when I try to execute the build script, however I now feel like there is maybe a different error in the log file?:CCSM BUILDEXE SCRIPT STARTING - Build Libraries: mct pio csm_share Thu Dec 5 14:52:29 EST 2013 /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/mct.bldlog.131205-145144ERROR: mct.buildlib failed, see /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/mct.bldlog.131205-145144ERROR: cat /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/mct.bldlog.131205-145144Thu Dec 5 14:52:29 EST 2013 /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/mct.bldlog.131205-145144Copying source to CCSM EXEROOT...New build of MCTRunning configure...for OS=Linux MACH=generic_linux_pgicat: Filepath: No such file or directorycat: Srcfiles: No such file or directory/opt/cesm/scripts/F_AMIP_CN_PGI/Tools/mkSrcfiles > /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/Srcfilescp -f /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/Filepath /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/Deppath/opt/cesm/scripts/F_AMIP_CN_PGI/Tools/mkDepends Deppath Srcfiles > /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/Depends./configure  FC="mpif90" F90="mpif90" --host=Linuxconfigure: WARNING: If you wanted to set the --build type, don't use --host.    If a cross compiler is detected then cross compile mode will be used.checking for Linux-cc... nochecking for cc... ccchecking for C compiler default output file name... configure: error: C compiler cannot create executablesSee `config.log' for more details.gmake: *** [configure] Error 77cp: cannot stat `Makefile.conf': No such file or directoryMakefile:4: Makefile.conf: No such file or directorymake: *** No rule to make target `Makefile.conf'.  Stop.~                                                                
 

jedwards

CSEG and Liaisons
Staff member
See `config.log' for more details in directory /sffiles/mmarcella/cesm_scratch/F_AMIP_CN_PGI/mct/
 
Hi jedwards,  I did and it is the same error message as before, as not being able to find -lnetcdf.  So Im guessing editing the env_mach_specific file did not work, or I did not edit it properly? 
 
Top