diff --git a/scm/doc/TechGuide/chap_quick.tex b/scm/doc/TechGuide/chap_quick.tex index 44fa9b15d..e6e3198b0 100644 --- a/scm/doc/TechGuide/chap_quick.tex +++ b/scm/doc/TechGuide/chap_quick.tex @@ -70,7 +70,7 @@ \section{System Requirements, Libraries, and Tools} \item cmake 2.8.12.1, 2.8.12.2, and 3.6.2 \item netCDF 4.3.0, 4.4.0, 4.4.1.1, 4.5.0, 4.6.1 and 4.6.3 (not 3.x) with HDF5, ZLIB and SZIP \item Python 2.7.5, 2.7.9, and 2.7.13 (not 3.x) - \item Libxml2 2.2 and 2.9.7 (not 2.9.9) + \item Libxml2 2.2, 2.9.7, 2.9.9 \end{itemize} Because these tools and libraries are typically the purview of system administrators to install and maintain, they are considered part of the basic system requirements. @@ -157,7 +157,10 @@ \section{Compiling SCM with CCPP} \begin{lstlisting}[language=bash] -DPC_LIBXML_INCLUDEDIR=... -DPC_LIBXML_LIBDIR=... \end{lstlisting} - to the cmake command. + to the cmake command. If a compilation error appears related to \execout{libxml2}, namely that a unicode file is not found in the include path, add the appropriate include path to the \execout{CFLAGS} environment variable +\begin{lstlisting}[language=bash] +export CFLAGS="-I/include_path" +\end{lstlisting} before cleaning out the \execout{bin} directory and rerunning \execout{cmake}. \item Compile. Add \execout{VERBOSE=1} to obtain more information on the build process. \begin{lstlisting}[language=bash] make diff --git a/scm/doc/TechGuide/main.pdf b/scm/doc/TechGuide/main.pdf index cf149b9aa..ca67ac04e 100644 Binary files a/scm/doc/TechGuide/main.pdf and b/scm/doc/TechGuide/main.pdf differ diff --git a/scm/src/CMakeLists.txt b/scm/src/CMakeLists.txt index 93c8972fa..c638251ce 100644 --- a/scm/src/CMakeLists.txt +++ b/scm/src/CMakeLists.txt @@ -80,9 +80,22 @@ endif() # Set compile options if (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Basic settings - set (CMAKE_C_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) - set (CMAKE_CXX_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) - set (CMAKE_Fortran_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) + #if CFLAGS, CXX_FLAGS, or FFLAGS are defined via environment variables, use them + if (DEFINED ENV{CFLAGS}) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{CFLAGS}) + set (CMAKE_C_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{CFLAGS}) + if (DEFINED ENV{CXXFLAGS}) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{CXXFLAGS}) + set (CMAKE_CXX_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{CXXFLAGS}) + if (DEFINED ENV{FFLAGS}) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{FFLAGS}) + set (CMAKE_Fortran_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{FFLAGS}) # Compiler-dependent settings if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb") @@ -100,9 +113,22 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug") message (FATAL_ERROR "This program has only been compiled with gfortran, pgf90 and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt") endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") elseif (${CMAKE_BUILD_TYPE} MATCHES "Release") - set (CMAKE_C_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) - set (CMAKE_CXX_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) - set (CMAKE_Fortran_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) + #if CFLAGS, CXX_FLAGS, or FFLAGS are defined via environment variables, use them + if (DEFINED ENV{CFLAGS}) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{CFLAGS}) + set (CMAKE_C_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{CFLAGS}) + if (DEFINED ENV{CXXFLAGS}) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{CXXFLAGS}) + set (CMAKE_CXX_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{CXXFLAGS}) + if (DEFINED ENV{FFLAGS}) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE) + else (DEFINED ENV{FFLAGS}) + set (CMAKE_Fortran_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE) + endif (DEFINED ENV{FFLAGS}) # Compiler-dependent settings if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -cpp -fdefault-real-8")