Skip to content

Commit

Permalink
Reinstate compiler env vars; pass to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Oct 29, 2024
1 parent 8c960ee commit 3a8e436
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env:
GISS_HOME: /__w/GISS-GC/GISS-GC
ModelE_Support: /__w/GISS-GC/GISS-GC/run
DATA: /__w/GISS-GC/GISS-GC/run/prod_input_files
# Environment variables for compiler
CC: gcc
CXX: g++
FC: gfortran
F90: gfortran
F77: gfortran
# Misc. environment variables
F_UFMTENDIAN: big
KMP_STACKSIZE: 100000000
Expand Down
16 changes: 8 additions & 8 deletions decks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ ifeq ($(GC),YES)
@echo "***************************************************************"
mkdir -p $(GC_BUILD_DIR)
mkdir -p $(GC_LIB_DIR)
# If CMAKE_BUILD_TYPE is not specified, it defaults to "Release". May also be set to "Debug"
# If MECH is not specified, it defaults to "fullchem". May also be "carbon".
ifeq ($(COMPILER),gfortran)
cd $(GC_BUILD_DIR) && cmake ../ -DINSTALLCOPY=.. -DCMAKE_BUILD_TYPE=$(TYPE) -DOMP=$(MP) -DMECH=$(MECH) -DCMAKE_EXE_LINKER_FLAGS="-nostartfiles -Wno-main"
endif
ifeq ($(F90),intel)
cd $(GC_BUILD_DIR) && cmake ../ -DINSTALLCOPY=.. -DCMAKE_BUILD_TYPE=$(TYPE) -DOMP=$(MP) -DMECH=$(MECH) -DCMAKE_EXE_LINKER_FLAGS="-nostartfiles -nofor-main"
endif
# If CMAKE_BUILD_TYPE is not specified, it defaults to "Release". May also be set to "Debug"
# If MECH is not specified, it defaults to "fullchem". May also be "carbon".
cd $(GC_BUILD_DIR) && cmake ../ -DINSTALLCOPY=.. \
-DCMAKE_BUILD_TYPE="$(TYPE)" -DOMP="$(MP)" -DMECH="$(MECH)" \
-DCMAKE_C_COMPILER="$(CC)" \
-DCMAKE_CXX_COMPILER="$(CXX)" \
-DCMAKE_Fortran_COMPILER="$(F90)" \
-DCMAKE_EXE_LINKER_FLAGS="$(LFLAGS)"
cd $(GC_BUILD_DIR) && make -j install
cp $(GC_BUILD_DIR)/mod/*.mod $(MODEL_DIR)/mod/
cp $(GC_BUILD_DIR)/src/HEMCO/mod/*.mod $(MODEL_DIR)/mod/
Expand Down
6 changes: 6 additions & 0 deletions doc/GISS-GC-DOC/build_on_linux_laptop.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ mkdir -p ${ModelE_Support}/huge_space
mkdir -p ${ModelE_Support}/prod_decks
mkdir -p ${ModelE_Support}/prod_input_files
mkdir -p ${ModelE_Support}/prod_runs
# Environment variables for compiler
export CC=gcc # NOTE: Edit if you're using a different C compiler
export CXX=g++ # NOTE: Edit if you're using a different C++ compiler
export FC=gfortran # NOTE: Edit if you're using a different Fortran compiler
export F90=gfortran # NOTE: Edit if you're using a different Fortran compiler
export F77=gfortran # NOTE: Edit if you're using a different Fortran compiler
# Misc. environment variables
export F_UFMTENDIAN=big
export KMP_STACKSIZE=100000000
Expand Down

0 comments on commit 3a8e436

Please sign in to comment.