-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling ISCA on Mac laptop #252
Comments
Hi there :) Sorry it's taken a while to reply. First, make sure you've got conda, and that you've used it to install the isca python environment. To compile Isca on a Mac, you'll also need to make some changes to the code. See this list of differences: master...sit23:Isca:mac_clean. I don't think you need all of these changes. Instead, just:
Finally, in your bashrc, set GFDL_ENV with: export GFDL_ENV=mac_conda NB: I haven't actually tested this, but it should get you going in the right direction. @sit23, when you have a spare second, could you check the above just to see if I've missed anything? |
Hi, I am also trying to compile and run ISCA on macOS. I made the changes suggested above, and I also had to define the isHeadNode function (as suggested here: 4956c4a), and I was able to run ISCA once. When I tried to run a second time, I got the following error (pasted below - I put in bold what I think is triggering the error). The pull request that defines the isHeadNode function also adds the "-fallow-invalid-boz" to FFLAGS in src/extra/python/isca/templates/mkmf.template.gfort. I tried doing this, but it didn't resolve the issue. Is this a common issue? Thanks! 2024-03-02 17:08:21,435 - isca - WARNING - Environment variable GFDL_SOC not set, but this is only required if using SocratesCodebase. Setting to None RAN: /bin/bash /Users/cml99/Desktop/ISCA/isca_work/codebase/_Users_cml99_Desktop_ISCA_isca/build/column_isca/compile.sh STDOUT: STDERR: Traceback (most recent call last): RAN: /bin/bash /Users/cml99/Desktop/ISCA/isca_work/codebase/_Users_cml99_Desktop_ISCA_isca/build/column_isca/compile.sh STDOUT: STDERR: |
Hi @claralarson, could you type It should correspond to the name of a file in the directory It should correspond to a file in the directory Could you take a look inside the mkmf template your environment file is pointing to, and confirm that it includes the If it is not present, then add the flag. Before recompiling, navigate to the directory Isca uses to compile the code with Let me know if you had already added the compiler flag to the correct environment file, and we'll try to figure out what else could be causing your issue. |
Thanks @ntlewis , now it works! |
Hi all!
I am an undergrad attempting to run ISCA for a senior project and am running into some errors when compiling.
Has anyone been able to run ISCA on a Mac laptop or non HPC?
Below is my bashrc:
directory of the Isca source code
export GFDL_BASE=/Users/physics.astronomy/Isca
"environment" configuration for emps-gv4
export GFDL_ENV=emps-gv
temporary working directory used in running the model
export GFDL_WORK=/Users/physics.astronomy/gfdl_work
directory for storing model output
export GFDL_DATA=/Users/physics.astronomy/gfdl_data
These are the errors I am running into when attempting the held_suarez_test_case:
(isca_env) ROS-0232-02-19:held_suarez physics.astronomy$ python held_suarez_test_case.py
2023-06-19 12:52:14,582 - isca - WARNING - Environment variable GFDL_SOC not set, but this is only required if using SocratesCodebase. Setting to None
2023-06-19 12:52:14,796 - isca - INFO - RRTM compilation disabled.
2023-06-19 12:52:14,797 - isca - INFO - SOCRATES compilation disabled.
2023-06-19 12:52:14,811 - isca - INFO - Writing path_names to '/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/path_names'
2023-06-19 12:52:14,817 - isca - INFO - Running compiler
2023-06-19 12:52:14,838 - isca - INFO - loadmodules for emps-gv machines
2023-06-19 12:52:14,845 - isca - INFO - /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 21: nf-config: command not found
2023-06-19 12:52:14,846 - isca - INFO - /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 23: ulimit: stack size: cannot modify limit: Operation not permitted
2023-06-19 12:52:14,846 - isca - INFO - Compiling postprocessing tools
2023-06-19 12:52:14,861 - isca - INFO - loadmodules for emps-gv machines
2023-06-19 12:52:15,078 - isca - WARNING - clang: warning: -lnetcdf: 'linker' input unused [-Wunused-command-line-argument]
2023-06-19 12:52:15,140 - isca - WARNING - clang: warning: argument unused during compilation: '-L/usr/local/netcdf-4.9.2/lib' [-Wunused-command-line-argument]
2023-06-19 12:52:17,420 - isca - WARNING - mppnccombine.c:162:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
2023-06-19 12:52:17,421 - isca - INFO - sprintf(outfilename,argv[outputarg]); outlen=strlen(outfilename);
2023-06-19 12:52:17,421 - isca - INFO - ^~~~~~~~~~~~~~~
2023-06-19 12:52:17,421 - isca - INFO - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
2023-06-19 12:52:17,422 - isca - INFO - __builtin___sprintf_chk (str, 0, __darwin_obsz(str), VA_ARGS)
2023-06-19 12:52:17,422 - isca - INFO - ^~~~~~~~~~~
2023-06-19 12:52:17,423 - isca - INFO - mppnccombine.c:162:24: note: treat the string as an argument to avoid this
2023-06-19 12:52:17,423 - isca - INFO - sprintf(outfilename,argv[outputarg]); outlen=strlen(outfilename);
2023-06-19 12:52:17,423 - isca - INFO - ^
2023-06-19 12:52:17,423 - isca - INFO - "%s",
2023-06-19 12:52:17,423 - isca - INFO - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
2023-06-19 12:52:17,423 - isca - INFO - __builtin___sprintf_chk (str, 0, __darwin_obsz(str), VA_ARGS)
2023-06-19 12:52:17,423 - isca - INFO - ^
2023-06-19 12:52:17,889 - isca - WARNING - 1 warning generated.
2023-06-19 12:52:18,703 - isca - INFO - ln: /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/mppnccombine.x: File exists
2023-06-19 12:52:18,707 - isca - INFO - ln: /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/mppnccombine_run.sh: File exists
2023-06-19 12:52:18,707 - isca - INFO - /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/path_names
2023-06-19 12:52:19,922 - isca - INFO - ........................................................................................................................... Makefile is ready.
2023-06-19 12:52:19,956 - isca - INFO - gfortran -Duse_libMPI -Duse_netCDF -Duse_LARGEFILE -DINTERNAL_FILE_NML -DOVERLOAD_C8 -DRRTM_NO_COMPILE -DSOC_NO_COMPILE -I/usr/local/include -I/usr/local/include -fpp -stack_temps -safe_cray_ptr -ftz -assume byterecl -shared-intel -i4 -r8 -g -O2 -diag-disable 6843 -mcmodel large -c -I/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/code/src/shared/include /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/code/src/shared/mpp/mpp_parameter.F90
2023-06-19 12:52:20,056 - isca - INFO - gfortran: error: unrecognized command-line option '-fpp'; did you mean '-cpp'?
2023-06-19 12:52:20,061 - isca - INFO - gfortran: error: unrecognized command-line option '-stack_temps'
2023-06-19 12:52:20,071 - isca - INFO - gfortran: error: unrecognized command-line option '-safe_cray_ptr'
2023-06-19 12:52:20,071 - isca - INFO - gfortran: error: unrecognized command-line option '-ftz'
2023-06-19 12:52:20,073 - isca - INFO - gfortran: error: unrecognized command-line option '-assume'
2023-06-19 12:52:20,080 - isca - INFO - gfortran: error: unrecognized command-line option '-shared-intel'
2023-06-19 12:52:20,080 - isca - INFO - gfortran: error: unrecognized command-line option '-i4'
2023-06-19 12:52:20,080 - isca - INFO - gfortran: error: unrecognized command-line option '-r8'; did you mean '-k8'?
2023-06-19 12:52:20,082 - isca - INFO - gfortran: error: unrecognized command-line option '-mcmodel'; did you mean '-mcmodel='?
2023-06-19 12:52:20,083 - isca - INFO - make: *** [mpp_parameter.o] Error 1
2023-06-19 12:52:20,084 - isca - INFO - ERROR: mkmf failed for held_suarez.x
Exception in thread background thread for pid 96649:
Traceback (most recent call last):
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 1655, in wrap
fn(*rgs, **kwargs)
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 2657, in background_thread
handle_exit_code(exit_code)
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 2348, in fn
return self.command.handle_command_exit_code(exit_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 839, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /bin/bash /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh
STDOUT:
loadmodules for emps-gv machines
/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 21: nf-config: command not found
/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 23: ulimit: stack size: cannot modify limit: Operation not permitted
Compiling postprocessing tools
loadmodules for emps-gv machines
clang: warning: -lnetcdf: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/netcdf-4.9.2/lib' [-Wunused-command-line-argument]
mppnccombine.c:162:24: warning: format string is not a string litera... (3152 more, please see e.stdout)
STDERR:
Traceback (most recent call last):
File "/Users/physics.astronomy/isca/exp/test_cases/held_suarez/held_suarez_test_case.py", line 21, in
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase
^^^^^^^^^^^^
File "/Users/physics.astronomy/isca/src/extra/python/isca/helpers.py", line 38, in _useworkdir
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/physics.astronomy/isca/src/extra/python/isca/helpers.py", line 22, in _destructive
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/physics.astronomy/isca/src/extra/python/isca/codebase.py", line 279, in compile
for line in sh.bash(P(self.builddir, 'compile.sh'), _iter=True, _err_to_out=True):
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 895, in next
self.wait()
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 812, in wait
self.handle_command_exit_code(exit_code)
File "/Users/physics.astronomy/anaconda3/envs/isca_env/lib/python3.11/site-packages/sh.py", line 839, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /bin/bash /Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh
STDOUT:
loadmodules for emps-gv machines
/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 21: nf-config: command not found
/Users/physics.astronomy/gfdl_work/codebase/_Users_physics.astronomy_Isca/build/held_suarez/compile.sh: line 23: ulimit: stack size: cannot modify limit: Operation not permitted
Compiling postprocessing tools
loadmodules for emps-gv machines
clang: warning: -lnetcdf: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/netcdf-4.9.2/lib' [-Wunused-command-line-argument]
mppnccombine.c:162:24: warning: format string is not a string litera... (3152 more, please see e.stdout)
STDERR:
If anyone has any ideas on where I'm going wrong, I would greatly appreciate the input!
The text was updated successfully, but these errors were encountered: