← Back to team overview

dolfin team mailing list archive

Re: [noreply@xxxxxxxxxxxxx: [Branch ~dolfin-core/dolfin/main] Rev 5030: Use find_package_handle_standard_args in Armadillo config]

 

On Thu, Aug 19, 2010 at 09:11:47PM +0200, Anders Logg wrote:
> Something is strange with the Armadillo test. It should throw a FATAL
> error when it fails but it doesn't.

Current list of problems with Armadillo (on Mac)

1. Does not throw a FATAL error although REQUIRED is used

2. Test program does not run (but seems to build after adding special
-I/opt/local/include)

Another strangeness is that the SLEPc test only works when I include
--debug-trycompile...

--
Anders


Return-Path: <bounces@xxxxxxxxxxxxx>
Received: from mail-imap5.uio.no ([unix socket])
	by mail-imap5.uio.no (Cyrus v2.3.16) with LMTPA;
	Thu, 19 Aug 2010 21:06:23 +0200
X-Sieve: CMU Sieve 2.3
Delivery-date: Thu, 19 Aug 2010 21:06:23 +0200
Received: from mail-mx2.uio.no ([129.240.10.30])
	by mail-imap5.uio.no with esmtp (Exim 4.69)
	(envelope-from <bounces@xxxxxxxxxxxxx>) id 1OmARS-0006p5-WB
	for logg@xxxxxxxxx; Thu, 19 Aug 2010 21:06:22 +0200
Received: from adelie.canonical.com ([91.189.90.139])
	by mail-mx2.uio.no with esmtp  (Exim 4.69)
	(envelope-from <bounces@xxxxxxxxxxxxx>) id 1OmARS-0000TM-9b
	for logg@xxxxxxxxx; Thu, 19 Aug 2010 21:06:22 +0200
Received: from loganberry.canonical.com ([91.189.90.37])
	by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian))
	id 1OmARR-0003r7-Lb
	for <logg@xxxxxxxxx>; Thu, 19 Aug 2010 20:06:21 +0100
Received: from loganberry.canonical.com (localhost [127.0.0.1])
	by loganberry.canonical.com (Postfix) with ESMTP id A28542E803E
	for <logg@xxxxxxxxx>; Thu, 19 Aug 2010 20:06:21 +0100 (BST)
Content-Type: multipart/mixed; boundary="===============4145576408808279347=="
MIME-Version: 1.0
X-Launchpad-Project: dolfin
X-Launchpad-Branch: ~dolfin-core/dolfin/main
X-Launchpad-Message-Rationale: Subscriber @dolfin-core
X-Launchpad-Branch-Revision-Number: 5030
X-Launchpad-Notification-Type: branch-revision
To: Anders Logg <logg@xxxxxxxxx>
From: noreply@xxxxxxxxxxxxx
Subject: [Branch ~dolfin-core/dolfin/main] Rev 5030: Use
	find_package_handle_standard_args in Armadillo config
Message-Id: <20100819190621.12348.26594.launchpad@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Aug 2010 19:06:21 -0000
Reply-To: noreply@xxxxxxxxxxxxx
Sender: bounces@xxxxxxxxxxxxx
Errors-To: bounces@xxxxxxxxxxxxx
Precedence: bulk
X-Generated-By: Launchpad (canonical.com); Revision="None";
	Instance="initZopeless config overlay"
X-Launchpad-Hash: 207bfd8a1fd9fd40d31e5091072e29fef07fc380
X-UiO-MailScanner: No virus found
X-UiO-Spam-info: not spam, SpamAssassin (score=-0.7, required=5.0,
	autolearn=disabled, MIME_QP_LONG_LINE=0.001,
	RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01, uiobl=NO,
	uiouri=NO)
X-UiO-Scanned: F385FD9D3E23211A5CFDFAC05A1F2715FB19B84A
X-UiO-SPAM-Test: remote_host: 91.189.90.139 spam_score: -6 maxlevel 30
	minaction 1 bait 0 mail/h: 35 total 28217 max/h 214 blacklist 0
	greylist 0 ratelimit 0
>
> ------------------------------------------------------------
> revno: 5030
> committer: Anders Logg <logg@xxxxxxxxx>
> branch nick: dolfin
> timestamp: Thu 2010-08-19 20:58:58 +0200
> message:
>   Use find_package_handle_standard_args in Armadillo config
> modified:
>   CMakeLists.txt
>   cmake/FindArmadillo.dolfin.cmake
>
>

> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt	2010-08-19 13:48:42 +0000
> +++ CMakeLists.txt	2010-08-19 18:58:58 +0000
> @@ -95,7 +95,7 @@
>  #------------------------------------------------------------------------------
>  # Run tests to find required packages
>
> -find_package(UFC.dolfin  REQUIRED)
> +find_package(UFC.dolfin REQUIRED)
>  find_package(Armadillo.dolfin REQUIRED)
>  find_package(LibXml2 REQUIRED)
>
>
> === modified file 'cmake/FindArmadillo.dolfin.cmake'
> --- cmake/FindArmadillo.dolfin.cmake	2010-08-16 09:42:59 +0000
> +++ cmake/FindArmadillo.dolfin.cmake	2010-08-19 18:58:58 +0000
> @@ -10,51 +10,50 @@
>  # Setting these changes the behavior of the search
>  # ARMADILLO_DIR - directory in which Armadillo resides
>
> -if(NOT ARMADILLO_FOUND)
> -  message(STATUS "Checking for package 'Armadillo'")
> -
> -  find_path(ARMADILLO_INCLUDE_DIR
> -    NAMES armadillo
> -    HINTS $ENV{ARMADILLO_DIR}
> -    PATHS /usr/local /opt/local /sw
> -    PATH_SUFFIXES include
> -    DOC "Directory where the Armadillo header file is located"
> -    )
> -  mark_as_advanced(ARMADILLO_INCLUDE_DIR)
> -
> -  find_library(ARMADILLO_LIBRARY
> -    NAMES armadillo
> -    HINTS $ENV{ARMADILLO_DIR}
> -    PATHS /usr/local /opt/local /sw
> -    PATH_SUFFIXES lib lib64
> -    DOC "The Armadillo library"
> -    )
> -  mark_as_advanced(ARMADILLO_LIBRARY)
> -
> -  # On mac systems, we likely have to link against the vecLib framework
> -  if(APPLE)
> -    include(CMakeFindFrameworks)
> -    CMAKE_FIND_FRAMEWORKS(vecLib)
> -    if(vecLib_FRAMEWORKS)
> -      set(ARMADILLO_LINK_FLAGS "-framework vecLib")
> -      mark_as_advanced(ARMADILLO_LINK_FLAGS)
> -    else(vecLib_FRAMEWORKS)
> -      message(STATUS "vecLib framework not found.")
> -    endif(vecLib_FRAMEWORKS)
> -  endif(APPLE)
> -
> -  if(ARMADILLO_INCLUDE_DIR AND ARMADILLO_LIBRARY)
> -    include(CheckCXXSourceRuns)
> -
> -    # These are needed for the try_run and check_cxx_source_runs commands below
> -    set(CMAKE_REQUIRED_INCLUDES ${ARMADILLO_INCLUDE_DIR})
> -    set(CMAKE_REQUIRED_LIBRARIES ${ARMADILLO_LIBRARY})
> -    if(ARMADILLO_LINK_FLAGS)
> -      set(CMAKE_REQUIRED_LIBRARIES "${ARMADILLO_LINK_FLAGS} ${CMAKE_REQUIRED_LIBRARIES}")
> -    endif(ARMADILLO_LINK_FLAGS)
> -
> -    set(ARMADILLO_CONFIG_TEST_VERSION_CPP ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/check_armadillo/armadillo_config_test_version.cpp)
> -    file(WRITE ${ARMADILLO_CONFIG_TEST_VERSION_CPP} "
> +message(STATUS "Checking for package 'Armadillo'")
> +
> +find_path(ARMADILLO_INCLUDE_DIR
> +  NAMES armadillo
> +  HINTS $ENV{ARMADILLO_DIR}
> +  PATHS /usr/local /opt/local /sw
> +  PATH_SUFFIXES include
> +  DOC "Directory where the Armadillo header file is located"
> +  )
> +mark_as_advanced(ARMADILLO_INCLUDE_DIR)
> +
> +find_library(ARMADILLO_LIBRARY
> +  NAMES armadillo
> +  HINTS $ENV{ARMADILLO_DIR}
> +  PATHS /usr/local /opt/local /sw
> +  PATH_SUFFIXES lib lib64
> +  DOC "The Armadillo library"
> +  )
> +mark_as_advanced(ARMADILLO_LIBRARY)
> +
> +# On mac systems, we likely have to link against the vecLib framework
> +if (APPLE)
> +  include(CMakeFindFrameworks)
> +  CMAKE_FIND_FRAMEWORKS(vecLib)
> +  if (vecLib_FRAMEWORKS)
> +    set(ARMADILLO_LINK_FLAGS "-framework vecLib")
> +    mark_as_advanced(ARMADILLO_LINK_FLAGS)
> +  else()
> +    message(STATUS "vecLib framework not found.")
> +  endif()
> +endif()
> +
> +if (ARMADILLO_INCLUDE_DIR AND ARMADILLO_LIBRARY)
> +  include(CheckCXXSourceRuns)
> +
> +  # These are needed for the try_run and check_cxx_source_runs commands below
> +  set(CMAKE_REQUIRED_INCLUDES ${ARMADILLO_INCLUDE_DIR})
> +  set(CMAKE_REQUIRED_LIBRARIES ${ARMADILLO_LIBRARY})
> +  if (ARMADILLO_LINK_FLAGS)
> +    set(CMAKE_REQUIRED_LIBRARIES "${ARMADILLO_LINK_FLAGS} ${CMAKE_REQUIRED_LIBRARIES}")
> +  endif()
> +
> +  set(ARMADILLO_CONFIG_TEST_VERSION_CPP ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/check_armadillo/armadillo_config_test_version.cpp)
> +  file(WRITE ${ARMADILLO_CONFIG_TEST_VERSION_CPP} "
>  #include <armadillo>
>  #include <iostream>
>
> @@ -66,22 +65,21 @@
>  	    << arma_version::patch;
>    return 0;
>  }
> -"
> -      )
> -
> -    try_run(
> -      ARMADILLO_CONFIG_TEST_VERSION_EXITCODE
> -      ARMADILLO_CONFIG_TEST_VERSION_COMPILED
> -      ${CMAKE_CURRENT_BINARY_DIR}
> -      ${ARMADILLO_CONFIG_TEST_VERSION_CPP}
> -      RUN_OUTPUT_VARIABLE OUTPUT
> -      )
> -
> -    if(ARMADILLO_CONFIG_TEST_VERSION_EXITCODE EQUAL 0)
> -      set(ARMADILLO_VERSION ${OUTPUT} CACHE TYPE STRING)
> -    endif(ARMADILLO_CONFIG_TEST_VERSION_EXITCODE EQUAL 0)
> -
> -    check_cxx_source_runs("
> +")
> +
> +  try_run(
> +    ARMADILLO_CONFIG_TEST_VERSION_EXITCODE
> +    ARMADILLO_CONFIG_TEST_VERSION_COMPILED
> +    ${CMAKE_CURRENT_BINARY_DIR}
> +    ${ARMADILLO_CONFIG_TEST_VERSION_CPP}
> +    RUN_OUTPUT_VARIABLE OUTPUT
> +    )
> +
> +  if (ARMADILLO_CONFIG_TEST_VERSION_EXITCODE EQUAL 0)
> +    set(ARMADILLO_VERSION ${OUTPUT} CACHE TYPE STRING)
> +  endif()
> +
> +  check_cxx_source_runs("
>  #include <armadillo>
>
>  int main()
> @@ -93,18 +91,11 @@
>   return 0;
>  }
>  "
> -      ARMADILLO_TEST_RUNS)
> -
> -    if(NOT ARMADILLO_TEST_RUNS)
> -      message(FATAL_ERROR "Unable to compile and run Armadillo test program.")
> -    endif(NOT ARMADILLO_TEST_RUNS)
> -
> -    set(ARMADILLO_FOUND 1 CACHE TYPE BOOL)
> -  endif(ARMADILLO_INCLUDE_DIR AND ARMADILLO_LIBRARY)
> -
> -  if(ARMADILLO_FOUND)
> -    message(STATUS "   Found package Armadillo, version ${ARMADILLO_VERSION}")
> -  else(ARMADILLO_FOUND)
> -    message("   Unable to configure package 'Armadillo'")
> -  endif(ARMADILLO_FOUND)
> -endif(NOT ARMADILLO_FOUND)
> +    ARMADILLO_TEST_RUNS)
> +
> +endif()
> +
> +# Standard package handling
> +include(FindPackageHandleStandardArgs)
> +find_package_handle_standard_args(Armadillo "Armadillo could not be found. Be sure to set ARMADILLO_DIR."
> +                                  ARMADILLO_TEST_RUNS)
>





> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp

Attachment: signature.asc
Description: Digital signature


References