From 91dce53029fac7be597ea4b81a633b8165a3e350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 21 Aug 2018 13:09:39 +0200 Subject: [PATCH 1/4] Declared all custom build options in CMakeLists.txt This way they can use either yes/no, on/off, or true/false. --- CMakeLists.txt | 70 ++++++++++++++++++----------- src/TNL/Experimental/CMakeLists.txt | 2 +- src/UnitTests/CMakeLists.txt | 4 +- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09cbf1503..a0c140f4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,16 @@ project( tnl ) set( tnlVersion "0.1" ) +# declare all custom build options +option(WITH_MIC "Build with MIC support" OFF) +option(WITH_CUDA "Build with CUDA support" ON) +set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") +option(WITH_OPENMP "Build with OpenMP support" ON) +option(WITH_TESTS "Build tests" ON) +option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF) +option(WITH_EXAMPLES "Compile the 'examples' directory" ON) +option(WITH_TEMPLATES_INSTANTIATION "Enable explicit template instantiation" OFF) + # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) set( TNL_TARGET_DATA_DIRECTORY "share/TNL" ) @@ -65,15 +75,15 @@ if( CXX_COMPILER_NAME MATCHES "icpc" ) ##### # Ckeck for MIC # - if( WITH_MIC STREQUAL "yes" ) - message( "Compile MIC support..." ) - set( MIC_CXX_FLAGS "-DHAVE_MIC") - # build all tests with MIC support - set( CXX_TESTS_FLAGS ${CXX_TESTS_FLAGS} -DHAVE_MIC ) - set( WITH_CUDA "no") + if( ${WITH_MIC} ) + message( "Enabled MIC support." ) + set( MIC_CXX_FLAGS "-DHAVE_MIC") + # build all tests with MIC support + set( CXX_TESTS_FLAGS ${CXX_TESTS_FLAGS} -DHAVE_MIC ) + set( WITH_CUDA OFF CACHE BOOL "Build with CUDA support" ) else() - set( MIC_CXX_FLAGS "") - endif( ) + set( MIC_CXX_FLAGS "") + endif() endif() # force colorized output in continuous integration @@ -89,13 +99,13 @@ endif() ##### # Check for CUDA # -if( WITH_CUDA STREQUAL "yes" ) +if( ${WITH_CUDA} ) find_package( CUDA ) if( CUDA_FOUND ) set( BUILD_CUDA TRUE) set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF) set(BUILD_SHARED_LIBS ON) - set(CUDA_SEPARABLE_COMPILATION ON) + set(CUDA_SEPARABLE_COMPILATION ON) # Use the CUDA_HOST_COMPILER environment variable if the user specified it. if( NOT $ENV{CUDA_HOST_COMPILER} STREQUAL "" ) message( "-- Setting CUDA_HOST_COMPILER to '$ENV{CUDA_HOST_COMPILER}'" ) @@ -164,30 +174,30 @@ if( WITH_CUDA STREQUAL "yes" ) #### # Check for CUSPARSE # - if( NOT WITH_CUSPARSE STREQUAL "no" ) + if( WITH_CUSPARSE ) find_path( CUSPARSE_INCLUDE_DIR cusparse.h - /usr/local/cuda/include - ${CUDA_INCLUDE_DIR} + /usr/local/cuda/include + ${CUDA_INCLUDE_DIR} DOC "CUSPARSE headers." ) if( ${CUSPARSE_INCLUDE_DIR} STREQUAL "CUSPARSE_INCLUDE_DIR-NOTFOUND" ) message( "CUSPARSE not found." ) set( HAVE_CUSPARSE "//#define HAVE_CUSPARSE 1" ) - else() + else() message( "CUSPARSE found. -- ${CUSPARSE_INCLUDE_DIR}" ) set( HAVE_CUSPARSE "#define HAVE_CUSPARSE 1" ) cuda_include_directories( ${CUSPARSE_INCLUDE_DIR} ) set( CUSPARSE_LIBRARY "${CUDA_cusparse_LIBRARY}" ) - endif() - endif( NOT WITH_CUSPARSE STREQUAL "no" ) - endif( CUDA_FOUND ) -endif( WITH_CUDA STREQUAL "yes" ) + endif() + endif() + endif() +endif() #### # Check for OpenMP # -if( OPENMP_FOUND AND WITH_OPENMP STREQUAL "yes" ) - message( "Compiler supports OpenMP." ) +if( OPENMP_FOUND AND ${WITH_OPENMP} ) + message( "Enabled OpenMP support." ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENMP ${OpenMP_CXX_FLAGS}" ) endif() @@ -271,17 +281,17 @@ else() set( HAVE_SYS_IOCTL_H "#define HAVE_SYS_IOCTL_H 1" ) endif() -if( WITH_TESTS STREQUAL "yes" ) +if( ${WITH_TESTS} ) enable_testing() # build gtest libs include( BuildGtest ) - if( WITH_COVERAGE STREQUAL "yes" AND CMAKE_BUILD_TYPE STREQUAL "Debug" ) + if( ${WITH_COVERAGE} AND CMAKE_BUILD_TYPE STREQUAL "Debug" ) # enable code coverage reports include( UseCodeCoverage ) endif() -endif( WITH_TESTS STREQUAL "yes" ) +endif() #if( BUILD_MPI ) # FIND_PATH( PETSC_INCLUDE_DIR petsc.h @@ -311,7 +321,7 @@ endif( WITH_TESTS STREQUAL "yes" ) #### # Explicit template instantiation # -#if( WITH_TEMPLATE_INSTANTIATION STREQUAL "yes" ) +#if( ${WITH_TEMPLATE_INSTANTIATION} ) # AddCompilerFlag( "-DTEMPLATE_EXPLICIT_INSTANTIATION " ) # # if( INSTANTIATE_INT STREQUAL "yes" ) @@ -352,7 +362,7 @@ add_subdirectory( src ) add_subdirectory( share ) add_subdirectory( tests ) -if( WITH_EXAMPLES STREQUAL "yes" ) +if( ${WITH_EXAMPLES} ) add_subdirectory( examples ) endif() @@ -384,6 +394,16 @@ set(CPACK_SOURCE_STRIP_FILES "Release") #set(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") INCLUDE( CPack ) +# Print custom build options +message( "-- Build options:" ) +message( " WITH_MIC=${WITH_MIC}" ) +message( " WITH_CUDA=${WITH_CUDA}" ) +message( " WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" ) +message( " WITH_OPENMP=${WITH_OPENMP}" ) +message( " WITH_TESTS=${WITH_TESTS}" ) +message( " WITH_COVERAGE=${WITH_COVERAGE}" ) +message( " WITH_EXAMPLES=${WITH_EXAMPLES}" ) +message( " WITH_TEMPLATES_INSTANTIATION=${WITH_TEMPLATES_INSTANTIATION}" ) # Print compiler options message( "-- Compiler options:" ) message( " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" ) diff --git a/src/TNL/Experimental/CMakeLists.txt b/src/TNL/Experimental/CMakeLists.txt index 3cf0e8020..b543baec6 100644 --- a/src/TNL/Experimental/CMakeLists.txt +++ b/src/TNL/Experimental/CMakeLists.txt @@ -1,4 +1,4 @@ add_subdirectory( Arithmetics ) -if( WITH_EXAMPLES STREQUAL "yes" ) +if( ${WITH_EXAMPLES} ) add_subdirectory( Hamilton-Jacobi ) endif() diff --git a/src/UnitTests/CMakeLists.txt b/src/UnitTests/CMakeLists.txt index fb90e6ee3..a96e178c5 100644 --- a/src/UnitTests/CMakeLists.txt +++ b/src/UnitTests/CMakeLists.txt @@ -1,4 +1,4 @@ -if( WITH_TESTS STREQUAL "yes" ) +if( ${WITH_TESTS} ) ADD_SUBDIRECTORY( Containers ) ADD_SUBDIRECTORY( Matrices ) @@ -41,4 +41,4 @@ ADD_TEST( StringTest ${EXECUTABLE_OUTPUT_PATH}/StringTest${CMAKE_EXECUTABLE_SUFF ADD_TEST( ObjectTest ${EXECUTABLE_OUTPUT_PATH}/ObjectTest${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( UniquePointerTest ${EXECUTABLE_OUTPUT_PATH}/UniquePointerTest${CMAKE_EXECUTABLE_SUFFIX} ) -endif( WITH_TESTS STREQUAL "yes" ) +endif( ${WITH_TESTS} ) -- GitLab From 6b579ed9c28e7de646c24d66a7f7c65c54736acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 21 Aug 2018 13:27:02 +0200 Subject: [PATCH 2/4] Removed check for HAVE_CUSPARSE It is not needed, since CUSPARSE is included in all versions of CUDA since at least 7.0. Also note that CUSPARSE is needed only for some tests and legacy code (tnl-benchmark-spmv and wrappers in Matrices::CSR) and experimental code (Preconditioners::ILU0). Everything is still guarded by the HAVE_CUSPARSE macro, so the user can pass -DHAVE_CUSPARSE -lcusparse to the compiler to enable the features. --- CMakeLists.txt | 19 ------------------- src/TNL/Solvers/Linear/Preconditioners/ILU0.h | 8 ++++---- .../Linear/Preconditioners/ILU0_impl.h | 8 ++++++++ tests/benchmarks/CMakeLists.txt | 6 +++--- tnlConfig.h.in | 4 ---- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0c140f4f..a5d654bb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,25 +170,6 @@ if( ${WITH_CUDA} ) set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; ${CUDA_ARCH} -D_FORCE_INLINES ) # TODO: this is necessary only due to a bug in cmake set( CUDA_ADD_LIBRARY_OPTIONS -shared ) - - #### - # Check for CUSPARSE - # - if( WITH_CUSPARSE ) - find_path( CUSPARSE_INCLUDE_DIR cusparse.h - /usr/local/cuda/include - ${CUDA_INCLUDE_DIR} - DOC "CUSPARSE headers." ) - if( ${CUSPARSE_INCLUDE_DIR} STREQUAL "CUSPARSE_INCLUDE_DIR-NOTFOUND" ) - message( "CUSPARSE not found." ) - set( HAVE_CUSPARSE "//#define HAVE_CUSPARSE 1" ) - else() - message( "CUSPARSE found. -- ${CUSPARSE_INCLUDE_DIR}" ) - set( HAVE_CUSPARSE "#define HAVE_CUSPARSE 1" ) - cuda_include_directories( ${CUSPARSE_INCLUDE_DIR} ) - set( CUSPARSE_LIBRARY "${CUDA_cusparse_LIBRARY}" ) - endif() - endif() endif() endif() diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h index 651f36b73..cf4443184 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h @@ -18,7 +18,7 @@ #include #include -#ifdef HAVE_CUDA +#if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) #include #endif @@ -66,7 +66,7 @@ public: ILU0() { -#ifdef HAVE_CUDA +#if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) cusparseCreate( &handle ); #endif } @@ -84,14 +84,14 @@ public: ~ILU0() { -#ifdef HAVE_CUDA +#if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) resetMatrices(); cusparseDestroy( handle ); #endif } protected: -#ifdef HAVE_CUDA +#if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) Matrices::CSR< RealType, DeviceType, IndexType > A; Containers::Vector< RealType, DeviceType, IndexType > y; diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h b/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h index 58d1c4ad8..62fea2a54 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h @@ -160,6 +160,7 @@ ILU0< double, Devices::Cuda, int >:: update( const MatrixPointer& matrixPointer ) { #ifdef HAVE_CUDA +#ifdef HAVE_CUSPARSE // TODO: only numerical factorization has to be done every time, split the rest into separate "setup" method which is called less often resetMatrices(); @@ -254,6 +255,9 @@ update( const MatrixPointer& matrixPointer ) std::cerr << "A(" << numerical_zero << ", " << numerical_zero << ") is zero." << std::endl; throw 1; } +#else + throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler.") +#endif #else throw Exceptions::CudaSupportMissing(); #endif @@ -265,6 +269,7 @@ ILU0< double, Devices::Cuda, int >:: solve( const Vector1& b, Vector2& x ) const { #ifdef HAVE_CUDA +#ifdef HAVE_CUSPARSE const int m = A.getRows(); const int nnz = A.getValues().getSize(); @@ -289,6 +294,9 @@ solve( const Vector1& b, Vector2& x ) const policy_U, (void*) pBuffer.getData() ); return true; +#else + throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler.") +#endif #else throw Exceptions::CudaSupportMissing(); #endif diff --git a/tests/benchmarks/CMakeLists.txt b/tests/benchmarks/CMakeLists.txt index 12fe883c8..e53ba6878 100644 --- a/tests/benchmarks/CMakeLists.txt +++ b/tests/benchmarks/CMakeLists.txt @@ -4,13 +4,13 @@ ADD_SUBDIRECTORY( heat-equation-benchmark ) IF( BUILD_CUDA ) CUDA_ADD_EXECUTABLE( tnl-benchmark-blas tnl-benchmark-blas.cu ) CUDA_ADD_CUBLAS_TO_TARGET( tnl-benchmark-blas ) - TARGET_LINK_LIBRARIES( tnl-benchmark-blas tnl ${CUSPARSE_LIBRARY} ) + TARGET_LINK_LIBRARIES( tnl-benchmark-blas tnl ) CUDA_ADD_EXECUTABLE( tnl-benchmark-spmv tnl-benchmark-spmv.cu ) - TARGET_LINK_LIBRARIES( tnl-benchmark-spmv tnl ${CUSPARSE_LIBRARY} ) + TARGET_LINK_LIBRARIES( tnl-benchmark-spmv tnl ${CUDA_cusparse_LIBRARY} ) CUDA_ADD_EXECUTABLE( tnl-benchmark-linear-solvers tnl-benchmark-linear-solvers.cu ) - TARGET_LINK_LIBRARIES( tnl-benchmark-linear-solvers tnl ${CUSPARSE_LIBRARY} ) + TARGET_LINK_LIBRARIES( tnl-benchmark-linear-solvers tnl ) ELSE() ADD_EXECUTABLE( tnl-benchmark-blas tnl-benchmark-blas.cpp ) TARGET_LINK_LIBRARIES( tnl-benchmark-blas tnl ) diff --git a/tnlConfig.h.in b/tnlConfig.h.in index cb352fcf3..967ce8e26 100644 --- a/tnlConfig.h.in +++ b/tnlConfig.h.in @@ -4,10 +4,6 @@ @HAVE_SYS_IOCTL_H@ -#ifdef HAVE_CUDA - @HAVE_CUSPARSE@ -#endif - @HAVE_DCMTK_H@ @HAVE_PNG_H@ -- GitLab From e689178a286e6c5ae45f97018a4a8460e7e2ed2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 21 Aug 2018 13:40:36 +0200 Subject: [PATCH 3/4] Disabled linking to the VTK library and enabled all mesh tests for CUDA even for nvcc --- .../Linear/Preconditioners/ILU0_impl.h | 4 +-- src/UnitTests/Meshes/CMakeLists.txt | 35 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h b/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h index 62fea2a54..0ce43ed8b 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILU0_impl.h @@ -256,7 +256,7 @@ update( const MatrixPointer& matrixPointer ) throw 1; } #else - throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler.") + throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler."); #endif #else throw Exceptions::CudaSupportMissing(); @@ -295,7 +295,7 @@ solve( const Vector1& b, Vector2& x ) const return true; #else - throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler.") + throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler."); #endif #else throw Exceptions::CudaSupportMissing(); diff --git a/src/UnitTests/Meshes/CMakeLists.txt b/src/UnitTests/Meshes/CMakeLists.txt index 97cdc0333..c5daaed1f 100644 --- a/src/UnitTests/Meshes/CMakeLists.txt +++ b/src/UnitTests/Meshes/CMakeLists.txt @@ -4,7 +4,7 @@ TARGET_LINK_LIBRARIES( BoundaryTagsTest ${GTEST_BOTH_LIBRARIES} tnl ) -if( BUILD_CUDA AND ${CMAKE_CXX_COMPILER} MATCHES ".*clang\\+\\+" ) +if( BUILD_CUDA ) CUDA_ADD_EXECUTABLE( MeshTest MeshTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MeshTest @@ -48,27 +48,26 @@ ADD_TEST( MeshEntityTest ${EXECUTABLE_OUTPUT_PATH}/MeshEntityTest${CMAKE_EXECUTA ## Tests with VTK ## -find_package( VTK ) -if( VTK_FOUND ) - include(${VTK_USE_FILE}) +#find_package( VTK ) +#if( VTK_FOUND ) +# include(${VTK_USE_FILE}) +# +# AddCompilerFlag( "-DHAVE_VTK " ) +# SET( VTK_COMMON_LIBRARIES vtkCommonCore ; vtkIOLegacy ) +#endif( VTK_FOUND ) - AddCompilerFlag( "-DHAVE_VTK " ) - SET( VTK_COMMON_LIBRARIES vtkCommonCore ; vtkIOLegacy ) -endif( VTK_FOUND ) - -# FIXME: compilation fails with nvcc (CUDA 9.0) -#if( BUILD_CUDA AND ${CMAKE_CXX_COMPILER} MATCHES ".*clang\\+\\+" ) -# CUDA_ADD_EXECUTABLE( MeshReaderTest MeshReaderTest.cu -# OPTIONS ${CXX_TESTS_FLAGS} ) -# TARGET_LINK_LIBRARIES( MeshReaderTest -# ${GTEST_BOTH_LIBRARIES} -# ${VTK_COMMON_LIBRARIES} -# tnl ) -#else() +if( BUILD_CUDA ) + CUDA_ADD_EXECUTABLE( MeshReaderTest MeshReaderTest.cu + OPTIONS ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( MeshReaderTest + ${GTEST_BOTH_LIBRARIES} + ${VTK_COMMON_LIBRARIES} + tnl ) +else() ADD_EXECUTABLE( MeshReaderTest MeshReaderTest.cpp ) TARGET_COMPILE_OPTIONS( MeshReaderTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MeshReaderTest ${GTEST_BOTH_LIBRARIES} ${VTK_COMMON_LIBRARIES} tnl ) -#endif() +endif() -- GitLab From de3a13e7a676e9c956b38405aca5c1c77f93d26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 21 Aug 2018 14:21:59 +0200 Subject: [PATCH 4/4] Added --offline-build option to skip update of external Cmake projects --- CMakeLists.txt | 2 ++ build | 3 +++ cmake/Gtest.cmake.in | 3 +++ src/Python/pybind11.cmake.in | 3 +++ 4 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5d654bb7..3e92d6eef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ project( tnl ) set( tnlVersion "0.1" ) # declare all custom build options +option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF) option(WITH_MIC "Build with MIC support" OFF) option(WITH_CUDA "Build with CUDA support" ON) set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") @@ -377,6 +378,7 @@ INCLUDE( CPack ) # Print custom build options message( "-- Build options:" ) +message( " OFFLINE_BUILD=${OFFLINE_BUILD}" ) message( " WITH_MIC=${WITH_MIC}" ) message( " WITH_CUDA=${WITH_CUDA}" ) message( " WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" ) diff --git a/build b/build index 305a7e5d1..8601731d7 100755 --- a/build +++ b/build @@ -11,6 +11,7 @@ CMAKE="cmake" CMAKE_ONLY="no" HELP="no" VERBOSE="" +OFFLINE_BUILD="no" WITH_CLANG="no" WITH_CUDA="yes" @@ -40,6 +41,7 @@ do --cmake=* ) CMAKE="${option#*=}" ;; --cmake-only=* ) CMAKE_ONLY="${option#*=}" ;; --verbose ) VERBOSE="VERBOSE=1" ;; + --offline-build ) OFFLINE_BUILD="yes" ;; --help ) HELP="yes" ;; --with-clang=* ) WITH_CLANG="${option#*=}" ;; --with-mic=* ) WITH_MIC="${option#*=}" ;; @@ -104,6 +106,7 @@ echo "Configuring ${BUILD} $TARGET ..." ${CMAKE} ${ROOT_DIR} \ -DCMAKE_BUILD_TYPE=${BUILD} \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DOFFLINE_BUILD=${OFFLINE_BUILD} \ -DWITH_MIC=${WITH_MIC} \ -DWITH_CUDA=${WITH_CUDA} \ -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \ diff --git a/cmake/Gtest.cmake.in b/cmake/Gtest.cmake.in index 762cff74a..cdb2e4548 100644 --- a/cmake/Gtest.cmake.in +++ b/cmake/Gtest.cmake.in @@ -19,4 +19,7 @@ ExternalProject_Add(googletest BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" + # Disable update of the external project in an offline build + # reference: https://stackoverflow.com/a/40423683 + UPDATE_DISCONNECTED ${OFFLINE_BUILD} ) diff --git a/src/Python/pybind11.cmake.in b/src/Python/pybind11.cmake.in index 18f1aeac6..885e62e5e 100644 --- a/src/Python/pybind11.cmake.in +++ b/src/Python/pybind11.cmake.in @@ -9,4 +9,7 @@ ExternalProject_Add(pybind11 SOURCE_DIR "${CMAKE_BINARY_DIR}/pybind11-src" BINARY_DIR "${CMAKE_BINARY_DIR}/pybind11-build" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYBIND11_TEST=FALSE + # Disable update of the external project in an offline build + # reference: https://stackoverflow.com/a/40423683 + UPDATE_DISCONNECTED ${OFFLINE_BUILD} ) -- GitLab