Skip to content

Commit

Permalink
BUG: CXXFLAGS is not empty by default under clang
Browse files Browse the repository at this point in the history
  • Loading branch information
TidbitSoftware committed Jul 31, 2024
1 parent 09fe5aa commit bf3a691
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jenkins/mac-intel-basic
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ISSM_CONFIG='\
--enable-debugging \
--with-numthreads=4 \
--with-matlab-dir=${MATLAB_PATH} \
--with-fortran-lib="-L/usr/local/Cellar/gcc/13.2.0/lib/gcc/current -lgfortran" \
--with-fortran-lib="-L/usr/local/Cellar/gcc/14.1.0_2/lib/gcc/current -lgfortran" \
--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
Expand Down
11 changes: 7 additions & 4 deletions m4/issm_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,15 @@ AC_DEFUN([ISSM_OPTIONS],[
IS_MAC=yes
AC_DEFINE([_IS_MAC_], [1], [is macOS])
AC_DEFINE([_IS_MSYS2_], [0], [is Windows (MSYS2 MinGW)])
dnl For some reason, CXXFLAGS is not empty by default under clang
export CXXFLAGS="-g -O2 -fPIC -std=c++11 -D_DO_NOT_LOAD_GLOBALS_"
dnl When standard Dakota installation has been updated to new
dnl version, remove the following
DAKOTA_COMPILER_FLAGS="-Wno-deprecated-register -Wno-return-type"
export CFLAGS="${DAKOTA_COMPILER_FLAGS}"
export CXXFLAGS="${CXXFLAGS} ${DAKOTA_COMPILER_FLAGS}"
dnl NOTE: Commenting out the following, for now, as ISSM seems to
dnl compile and run fine, but certain errors (e.g. file not
dnl found) were not bubbling up, and instead causing MATLAB
Expand Down Expand Up @@ -242,14 +248,11 @@ AC_DEFUN([ISSM_OPTIONS],[
AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
dnl Set default environment variables
if test -z "${CFLAGS+x}"; then
export CFLAGS="${DAKOTA_COMPILER_FLAGS}"
fi
if test ! -z "${COPTFLAGS+x}"; then
AC_MSG_WARN([If you want to use the optimization flags provided by COPTFLAGS (${COPTFLAGS}), please pass them via CFLAGS])
fi
if test -z "${CXXFLAGS+x}"; then
export CXXFLAGS="-g -O2 -fPIC -std=c++11 -D_DO_NOT_LOAD_GLOBALS_ ${DAKOTA_COMPILER_FLAGS}"
export CXXFLAGS="-g -O2 -fPIC -std=c++11 -D_DO_NOT_LOAD_GLOBALS_"
fi
if test ! -z "${CXXOPTFLAGS+x}"; then
AC_MSG_WARN([If you want to use the optimization flags provided by CXXOPTFLAGS (${CXXOPTFLAGS}), please pass them via CXXFLAGS])
Expand Down
2 changes: 1 addition & 1 deletion src/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions w
endif

libISSMCore_la_SOURCES = $(issm_sources)
libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS)
libISSMCore_la_FFLAGS = $(AM_FFLAGS)

libISSMCore_LIB_ADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MPLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB)
Expand Down

0 comments on commit bf3a691

Please sign in to comment.