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: BUILD FAIL

KingLee

KingLee
New Member
Recently, I tried to build a case by runing the case.build. But there is always a problem. I tried to fix it many times, however, it still went wrong.
The Output is below:
```
ERROR: BUILD FAIL: siac.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/iac.bldlog.220502-203151
BUILD FAIL: sesp.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/esp.bldlog.220502-203151
BUILD FAIL: docn.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/ocn.bldlog.220502-203151
BUILD FAIL: swav.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/wav.bldlog.220502-203151
```

And any of the bldlog shows:
```
usage: buildlib.internal_components [-h] [-d] [-v] [-s]
caseroot libroot bldroot
buildlib.internal_components: error: too few arguments
```

I don't know how to fix it because I don't really understand the inner processes of the code,
so if someone konw how to fix it, please help me, thank you very much!!
 

sacks

Bill Sacks
CSEG and Liaisons
Staff member
I'm not sure if I'll be able to help with this, but to start, please provide all of the information requested in Information to include in help requests . The python version (from running "python --version") would also be helpful.

In addition, it could help if you edit the file cime/src/build_scripts/buildlib.internal_components : Just before the last line (_main_func(sys.argv)) add:

Code:
print("buildlib.internal_components: {}".format(sys.argv))

so the last few lines of this file should look like this:

Code:
if __name__ == "__main__":
    print("buildlib.internal_components: {}".format(sys.argv))
    _main_func(sys.argv)

Then rerun case.build and let us know what the bldlog files now show.
 

KingLee

KingLee
New Member
My python's version is 2.7.5. And I'm sorry for that I don't give a operation detail.

One:
When I first ran case.build, it reported a BUILD ERROR:
ERROR: BUILD FAIL: swav.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/wav.bldlog.220503-093501
BUILD FAIL: siac.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/iac.bldlog.220503-093501
BUILD FAIL: sesp.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/esp.bldlog.220503-093501
BUILD FAIL: docn.buildlib failed, cat /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/ocn.bldlog.220503-093501
Any of bldlog is:
/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/components/stub_comps_mct/swav/cime_config/buildlib: line 1: ../../../../build_scripts/buildlib.internal_components: No such file or directory
It seems that the model failed to identify the path "../../../../build_scripts/buildlib.internal_components"
So I check the buildlib file, and change "../../../../" to my cime path to let the machine know the specific path:
"/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components"

Two:
I keep running the case.build, it also report an BUILD ERROR:
Any of bldlog is:
Traceback (most recent call last):
File "/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components", line 14, in <module>
from standard_script_setup import *
ImportError: No module named standard_script_setup
So I think it may be the python's env path failure, so I add code segment to "buildlib.internal_components"
_CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..","..","..","..", "..")
sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools"))
sys.path.append("/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/scripts/Tools") ## Added
To ensure the machine can find the module in suitable path.
I ran the case.build, it also report an BUILD ERROR:
usage: buildlib.internal_components [-h] [-d] [-v] [-s]
caseroot libroot bldroot
buildlib.internal_components: error: too few arguments
This is a description in detail.


I do what you told me, and the bldlog show:
buildlib.internal_components: ['/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components']
usage: buildlib.internal_components [-h] [-d] [-v] [-s]
caseroot libroot bldroot
buildlib.internal_components: error: too few arguments
If I don't change anything, just add the "print("buildlib.internal_components: {}".format(sys.argv))": the bldlog is:
/data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/components/stub_comps_mct/swav/cime_config/buildlib: line 1: ../../../../build_scripts/buildlib.internal_components: No such file or directory
 

sacks

Bill Sacks
CSEG and Liaisons
Staff member
Thank you for the additional explanation. These buildlib files are normally symbolic links to the buildlib.internal_components file. It seems like your system is not handling these symbolic links correctly. I would undo all of the changes you made, and instead: For each of the buildlib files you changed before, instead of changing them, copy the file /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components to overwrite that buildlib file. For example, the file /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/components/stub_comps_mct/swav/cime_config/buildlib should now be an exact copy of /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components, and same for the other buildlibs that are causing problems.

However, it's possible you'll run into other problems after that, because symbolic links are used in a number of other places in CIME.
 

KingLee

KingLee
New Member
Thank you for the additional explanation. These buildlib files are normally symbolic links to the buildlib.internal_components file. It seems like your system is not handling these symbolic links correctly. I would undo all of the changes you made, and instead: For each of the buildlib files you changed before, instead of changing them, copy the file /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components to overwrite that buildlib file. For example, the file /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/components/stub_comps_mct/swav/cime_config/buildlib should now be an exact copy of /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/build_scripts/buildlib.internal_components, and same for the other buildlibs that are causing problems.

However, it's possible you'll run into other problems after that, because symbolic links are used in a number of other places in CIME.
OK,thank you very much. I'll try what you say. And I wonder that why my machine can't handle these symbolic links correctly? I always think about what the cime's inner process is, But it is too complicated to understand now hahahahaha.
 

KingLee

KingLee
New Member
Yeah!! It works!!!
When I first did this, it reminded me that:
Building esp with output to /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/esp.bldlog.220503-232425
mosart built in 1.686621 seconds
cice built in 1.770133 seconds
cam built in 2.731355 seconds
sesp built in 3.160429 seconds
swav built in 3.202494 seconds
siac built in 3.201641 seconds
docn built in 7.764625 seconds
cism built in 9.203800 seconds
Building cesm from /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/drivers/mct/cime_config/buildexe with output to /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/cesm.bldlog.220503-232425
ERROR: Error gathering provenance information from manage_externals.

manage_externals error message:
WARNING:root:WARNING: Ignoring unknown branch property, in /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/drivers/nuopc/.gitmodules
WARNING:root:WARNING: Ignoring unknown branch property, in /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/drivers/nuopc/.gitmodules
ERROR:root:SVN returned invalid XML message

manage_externals output:
Processing externals description file : Externals.cfg
Processing externals description file : Externals_CLM.cfg
Processing externals description file : Externals.cfg
Processing externals description file : ../Externals_MOM.cfg
Processing submodules description file : /data/atm01/CESM2.2.0/release-cesm2.2.0/components/mom/MOM6/.gitmodules
Processing externals description file : ../Externals_cime.cfg
Processing externals description file : .gitmodules
Processing submodules description file : .gitmodules
Processing externals description file : Externals_FMS.cfg
Processing externals description file : Externals_POP.cfg
Processing externals description file : Externals_CISM.cfg
Processing externals description file : .gitmodules
Processing submodules description file : .gitmodules
Processing externals description file : Externals_CAM.cfg
Checking status of externals: clm, fates, ptclm, mosart, cime, cmeps, nems/lib/parallelio, nems/lib/genf90, ww3, cice, fms, fms, pop, cvmix, marbl, cism, source_cism, rtm, cdeps, fox, mom, mom, pkg/geokdtree, pkg/mom6_da_hooks, pkg/cvmix-src, cam, silhs, clubb, pumas, atmos_phys, cosp2,
ERROR: SVN returned invalid XML message

To solve this, either:

(1) Find and fix the problem: From /data/atm01/CESM2.2.0/release-cesm2.2.0, try to get this command to work:
manage_externals/checkout_externals --status --verbose --no-logging

(2) If you don't need provenance information, rebuild with --skip-provenance-check


I think it would not affect the whole build process, and it's just a code-check, so I rebuild with --skip-provenance-check, and It finally succeeded.

Building cesm from /data/atm01/CESM2.2.0/release-cesm2.2.0/cime/src/drivers/mct/cime_config/buildexe with output to /data/atm01/CESM2.2.0/projects/scratch/F2000climo.test/bld/cesm.bldlog.220503-232957
Time spent not building: 9.318239 sec
Time spent building: 19.298569 sec
MODEL BUILD HAS FINISHED SUCCESSFULLY

I'll try to run this model later. And hopefully, it would be without a hitch.
 
Top