Skip to content

compilation flag -fPIC for oasis and fesom #1392

@a270105

Description

@a270105

Describe the problem you are facing
I can't compile awiesm-2.6 with recom using my esm-tools branch 'awiesm-2.6-recom'. The error occurs when linking shared libraries during fesom compilation, e.g.:

ld: /work/ab0995/a270105/esm_code/awiesm-2.6-recom/oasis/build/lib/psmile/libpsmile.a(mod_oasis_getput_interface.F90.o): relocation R_X86_64_32 against `__STRLITPACK_135' can not be used when making a shared object; recompile with -fPIC

To Reproduce

cd esm_tools
git checkout awiesm-2.6-recom
esm_master install-awiesm-2.6-recom

Dirty solution
'-fPIC' is included in oasis3mct.env.yaml. So I don't really understand why this needs to be added.
I tried to add the flag in CMake files. But it didn't work. At the end I added cmake option directly in comp-fesom... and comp-oasis...shell scripts and recompiled all model components by running shell scripts.

New problems
After successfully compiling the model, I got errors by running experiment:

Traceback (most recent call last):
  File "/home/a/a270105/.local/bin/esm_runscripts", line 33, in <module>
    sys.exit(load_entry_point('esm-tools', 'console_scripts', 'esm_runscripts')())
  File "/home/a/a270105/esm_tools/src/esm_runscripts/cli.py", line 289, in main
    setup()
  File "/home/a/a270105/esm_tools/src/esm_runscripts/sim_objects.py", line 139, in __call__
    self.prepcompute()
  File "/home/a/a270105/esm_tools/src/esm_runscripts/sim_objects.py", line 230, in prepcompute
    self.config = prepcompute.run_job(self.config)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/prepcompute.py", line 26, in run_job
    config = evaluate(config, "prepcompute", "prepcompute_recipe")
  File "/home/a/a270105/esm_tools/src/esm_runscripts/helpers.py", line 71, in evaluate
    config = esm_plugin_manager.work_through_recipe(
  File "/home/a/a270105/esm_tools/src/esm_plugin_manager/esm_plugin_manager.py", line 159, in work_through_recipe
    config = getattr(submodule, workitem)(config)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/filelists.py", line 1395, in report_missing_files
    config = _check_fesom_missing_files(config)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/filelists.py", line 1429, in _check_fesom_missing_files
    if not os.path.exists(path):
  File "/sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not Namelist
Traceback (most recent call last):
  File "/home/a/a270105/.local/bin/esm_runscripts", line 33, in <module>
    sys.exit(load_entry_point('esm-tools', 'console_scripts', 'esm_runscripts')())
  File "/home/a/a270105/esm_tools/src/esm_runscripts/cli.py", line 289, in main
    setup()
  File "/home/a/a270105/esm_tools/src/esm_runscripts/sim_objects.py", line 125, in __call__
    self.config = prepexp.run_job(self.config)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/prepexp.py", line 28, in run_job
    evaluate(config, "prepexp", "prepexp_recipe")
  File "/home/a/a270105/esm_tools/src/esm_runscripts/helpers.py", line 71, in evaluate
    config = esm_plugin_manager.work_through_recipe(
  File "/home/a/a270105/esm_tools/src/esm_plugin_manager/esm_plugin_manager.py", line 159, in work_through_recipe
    config = getattr(submodule, workitem)(config)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/prepexp.py", line 261, in call_esm_runscripts_from_prepexp
    _call_esm_runscripts_internally(config, new_command, scriptsdir)
  File "/home/a/a270105/esm_tools/src/esm_runscripts/prepexp.py", line 194, in _call_esm_runscripts_internally
    subprocess.check_call(command.split(), cwd=exedir)
  File "/sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['esm_runscripts', 'PI_2.6_2p1z1d_tp.yaml', '-e', 'PI_2.6_2p1z1d_tp', '--open-run', '-c', '--no-motd', '--last-jobtype', 'prepcompute', '-t', 'prepcompute']' returned non-zero exit status 1.
[a270105@levante6 esm_runscripts]$ ls -l /home/a/a270105/esm_tools/configs/runscript
ls: cannot access '/home/a/a270105/esm_tools/configs/runscript': No such file or directory

What do these messages mean? Is this related to the problem with -fPIC?

System (please complete the following information):

  • Supercomputer: levante
  • Version [6.58.0]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions