Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions configuration/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ db_flags:
@echo "* .F.o := $(FC) -c $(FFLAGS) $(FIXEDFLAGS) $(INCS) $(INCLDIR)"
@echo "* .F90.o := $(FC) -c $(FFLAGS) $(FREEFLAGS) $(INCS) $(INCLDIR)"

#-------------------------------------------------------------------------------
# build rule for makdep: MACFILE, cmd-line, or env vars must provide
# the needed macros
#-------------------------------------------------------------------------------

ifndef $(CFLAGS_HOST)
CFLAGS_HOST :=
endif

$(DEPGEN): $(ICE_CASEDIR)/makdep.c
$(SCC) -o $@ $(CFLAGS_HOST) $<

#-------------------------------------------------------------------------------
# build rules: MACFILE, cmd-line, or env vars must provide the needed macros
#-------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion configuration/scripts/cice.build
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ cat ${ICE_OBJDIR}/Filepath
echo " "

echo "building makdep"
cc -o makdep ${ICE_CASEDIR}/makdep.c || exit 2
${ICE_MACHINE_MAKE} \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHCOMP} makdep || exit 2

echo "building cice > ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}"

Expand Down
14 changes: 13 additions & 1 deletion doc/source/user_guide/ug_running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The CICE scripts are written to allow quick setup of cases and tests. Once a ca
generated, users can manually modify the namelist and other files to custom configure
the case. Several settings are available via scripts as well.

.. _overview:

Overview
~~~~~~~~

Expand Down Expand Up @@ -201,7 +203,7 @@ Once the cases are created, users are free to modify the cice.settings and ice_i
Porting
-------

To port, an **env.[machine]_[environment]** and **Macros.[machine]_[environment}** file have to be added to the
To port, an **env.[machine]_[environment]** and **Macros.[machine]_[environment]** file have to be added to the
**configuration/scripts/machines/** directory and the
**configuration/scripts/cice.batch.csh** file needs to be modified.
In general, the machine is specified in ``cice.setup`` with ``--mach``
Expand Down Expand Up @@ -229,6 +231,16 @@ directory back to **configuration/scripts/machines/** and update
the **configuration/scripts/cice.batch.csh** file, retest,
and then add and commit the updated machine files to the repository.

.. _cross_compiling:

Cross-compiling
~~~~~~~~~~~~~~~
It can happen that the model must be built on a platform and run on another, for example when the run environment is only available in a batch queue. The program **makdep** (see :ref:`overview`), however, is both compiled and run as part of the build process.

In order to support this, the Makefile uses a variable ``CFLAGS_HOST`` that can hold compiler flags specfic to the build machine for the compilation of makdep. If this feature is needed, add the variable ``CFLAGS_HOST`` to the **Macros.[machine]_[environment]** file. For example : ::

CFLAGS_HOST = -xHost

.. _account:

Machine Account Settings
Expand Down