ExeClim / Isca

Idealized GCM from the University of Exeter
https://execlim.github.io/IscaWebsite
GNU General Public License v3.0
139 stars 125 forks source link

Compiling issue #238

Closed lorelu closed 1 year ago

lorelu commented 2 years ago

Description

Hi everyone! I am currently trying to install Isca for my Master's degree thesis but I am facing some issues. I followed the instructions but I keep getting the following message when I try to compile:

2022-09-01 17:09:01,099 - isca - WARNING - Environment variable GFDL_SOC not set, but this is only required if using SocratesCodebase. Setting to None
Traceback (most recent call last):
  File "/home/lucaferri/Isca/src/extra/python/isca/helpers.py", line 69, in git_run_in_directory
    git_test = codedir_git.log('-1', '--format="%H"').stdout
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 1566, in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 822, in __init__
    self.wait()
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_128:

  RAN: /home/lucaferri/miniconda3/envs/isca_env/bin/git --no-pager -C Isca log -1 '--format="%H"'

  STDOUT:

  STDERR:
fatal: cannot change to 'Isca': No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lucaferri/Isca/exp/test_cases/held_suarez/held_suarez_test_case.py", line 10, in <module>
    cb = DryCodeBase.from_directory(GFDL_BASE)
  File "/home/lucaferri/Isca/src/extra/python/isca/codebase.py", line 35, in from_directory
    return cls(directory=directory, **kwargs)
  File "/home/lucaferri/Isca/src/extra/python/isca/codebase.py", line 374, in __init__
    super(GreyCodeBase, self).__init__(*args, **kwargs)
  File "/home/lucaferri/Isca/src/extra/python/isca/codebase.py", line 86, in __init__
    self.git = git_run_in_directory(GFDL_BASE, self.codedir)
  File "/home/lucaferri/Isca/src/extra/python/isca/helpers.py", line 73, in git_run_in_directory
    git_test = codedir_git.log('-1', '--format="%H"').stdout
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 1566, in __call__
    return RunningCommand(cmd, call_args, stdin, stdout, stderr)
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 822, in __init__
    self.wait()
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/lucaferri/miniconda3/envs/isca_env/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_128:

  RAN: /home/lucaferri/miniconda3/envs/isca_env/bin/git --no-pager --git-dir=Isca/.git --work-tree=Isca log -1 '--format="%H"'

  STDOUT:

  STDERR:
fatal: 'Isca/.git' not a Git repository

These are the commands I am executing from the top-level directory:

(isca_env)$ export GFDL_BASE=Isca 
(isca_env)$ export GFDL_ENV=emps-gv
(isca_env)$ export GFDL_WORK=gfdl_work
(isca_env)$ export GFDL_DATA=gfdl_data
(isca_env)$ cd $GFDL_BASE/exp/test_cases/held_suarez
(isca_env)$ python held_suarez_test_case.py

Thank you in advance for your help, I am just starting out with computer programming so I could have made trivial mistakes.


System Information: system='Linux', node='ipazia', release='4.19.0-6-amd64', version='#1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11)', machine='x86_64'

sit23 commented 2 years ago

Hi @lorelu. Thanks for your message. I think this is likely because your GFDL_BASE directory needs to point to the full path of this folder. So instead of setting: export GFDL_BASE=Isca you should set something like export GFDL_BASE=/home/ubuntu/Isca or whatever is appropriate for your computer. To find this out, navigate into the Isca folder, and then do pwd and set the result of that command to GFDL_BASE. You should also do the same thing for GFDL_WORK and GFDL_DATA.

Just as a side note too, you'll probably want to use these export statements every time you open a new terminal, which would be a pain, so I'd recommend putting them in your .bashrc file. That way they'll automatically be set in every new terminal instance (assuming you're using BASH). There are lots of places online that will talk about how to do this if you need some help there.

Thanks, Stephen

lorelu commented 2 years ago

Thank you so much for your help and your suggestions! I am still having some issues with the environment file, but I will try to figure out on my own.

Thanks again Lorenza