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

No rule to make target `/Macros.make'.

Peipei

New Member
Hi,
I am trying to run CESM2. I encountered a problem in building the case. The following are the error messages:

...calling pop buildcpp to set build time options
ERROR: Command gmake complib -j 8 MODEL=pop COMPLIB=/data/home/ppwu/cesm/output/global_ocean/bld/lib/libocn.a -f /data/home/ppwu/cesm/mycase/global_ocean/Tools/Makefile USER_CPPDEFS="-DCCSMCOUPLED -DMARBL_TIMING_OPT=CIME -DBLCKX=64 -DBLCKY=64 -DMXBLCKS=2 -DZERO_SEA_ICE_REF_SAL -DNT=3 -DMARBL_NT=0 -DIRF_NT=0 " failed rc=2
out=/mkSrcfiles
err=/data/home/ppwu/cesm/mycase/global_ocean/Tools/Makefile:90: /Macros.make: No such file or directory
cat: Srcfiles: No such file or directory
gmake: /mkSrcfiles: Command not found
gmake: *** No rule to make target `/Macros.make'. Stop.
gmake: *** Waiting for unfinished jobs....

Attached is Makefile and Macros.make.

Any help would be much appreciated.
Regards
 

Attachments

  • Macros.make.txt
    1.7 KB · Views: 3
  • Makefile.txt
    29.8 KB · Views: 4

jedwards

CSEG and Liaisons
Staff member
This error is encountered if you do not have variable CASEROOT defined when you invoke make.
It's not clear to me how you would arrive at this circumstance. Please provide instructions to reproduce the problem.
 

Peipei

New Member
Hello, Thanks a lot for your help. I reinstalled CESM and built the case successfully. I guess there was probably a problem with XML files in my last try.
 

AndrewY

New Member
This error is encountered if you do not have variable CASEROOT defined when you invoke make.
It's not clear to me how you would arrive at this circumstance. Please provide instructions to reproduce the problem.
Hi jedwards,

I met the same problem when porting CESM and changing the version of CLM used. I modified the arguments in Externals.cfg to check out CLM tagged by 'release-clm5.0.14'. The command './manage_externals/checkout_externals' ran successfully. However, the error was encountered during the process of case building.

With xmlquery, I found that the variable 'CASEROOT' had already been defined and there's indeed 'Macros.make' under this path. Do you have any idea why this error still happen?

Thank you!
 

jedwards

CSEG and Liaisons
Staff member
Is this the exact text of the error message?
err=/data/home/ppwu/cesm/mycase/global_ocean/Tools/Makefile:90: /Macros.make: No such file or directory
cat: Srcfiles: No such file or directory
gmake: /mkSrcfiles: Command not found
gmake: *** No rule to make target `/Macros.make'. Stop.
gmake: *** Waiting for unfinished jobs....
You see /Macros.make should be a full path to the case directory. If it isn't then somehow CASEROOT is not being defined.
 

AndrewY

New Member
Is this the exact text of the error message?

You see /Macros.make should be a full path to the case directory. If it isn't then somehow CASEROOT is not being defined.
Thanks for your reply!

So I checked this file called 'Makefile', the 90th line in that reads 'include $(CASEROOT)/Macros.make'. If I do not change the version of CLM to be checked out, this 'Makefile' would be exactly the same as well as the 90th line and no error would be encountered. I suppose that the modified Externals.cfg somehow makes the '$(CASEROOT)' unrecognized. But I don't know if that is the source of error and how to fix it.

Or do you think the error would be fixed if I replace '$(CASEROOT)' by the specific path to the case directory?
 

jedwards

CSEG and Liaisons
Staff member
The CASEROOT variable is defined in env_case.xml in your case directory. First make sure that it is set there and correct, you can use
./xmlquery CASEROOT to confirm.
 

AndrewY

New Member
The CASEROOT variable is defined in env_case.xml in your case directory. First make sure that it is set there and correct, you can use
./xmlquery CASEROOT to confirm.
I did checked env_case.xml for CASEROOT by both 'grep' command and xmlquery. It is correctly set as the case directory.

Do you think the error might be related to the fortran compiler used?

I also attached my env_case.xml for reference (extension has been changed for upload purpose).
 

Attachments

  • env_case.txt
    17.9 KB · Views: 1

AndrewY

New Member
Maybe the problem is your make tool. What version of make do you have?
I received the following lines by typing 'gmake --version':

GNU Make 4.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <The GNU General Public License v3.0 - GNU Project - Free Software Foundation>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Is that for the make you mentioned?
 
Top