← Back to team overview

dolfin team mailing list archive

[Fwd: [Branch ~dolfin-core/dolfin/main] Rev 4922: Add experimental version of UMFPACK configure file]

 

Does this test work? I found when playing around with the MTL4 test that
any output statements in the test code caused the compile and run test
to fail.

Garth

-------- Forwarded Message --------
From: noreply@xxxxxxxxxxxxx
Reply-to: noreply@xxxxxxxxxxxxx
To: Garth Wells <gnw20@xxxxxxxxx>
Subject: [Branch ~dolfin-core/dolfin/main] Rev 4922: Add experimental
version of UMFPACK configure file
Date: Tue, 10 Aug 2010 09:43:22 -0000

------------------------------------------------------------
revno: 4922
committer: Anders Logg <logg@xxxxxxxxx>
branch nick: dolfin-dev
timestamp: Tue 2010-08-10 11:40:51 +0200
message:
  Add experimental version of UMFPACK configure file
added:
  cmake/FindUMFPACK.dolfin.cmake
modified:
  CMakeLists.txt
  cmake/FindMTL4.dolfin.cmake


--
lp:dolfin
https://code.launchpad.net/~dolfin-core/dolfin/main

Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
differences between files attachment (revision-diff.txt)
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2010-08-09 21:57:54 +0000
+++ CMakeLists.txt	2010-08-10 09:40:51 +0000
@@ -72,9 +72,9 @@
 #if(DOLFIN_ENABLE_SCOTCH)
 #  include(FindSCOTCH.dolfin)
 #endif(DOLFIN_ENABLE_SCOTCH)
-#if(DOLFIN_ENABLE_UMFPACK)
-#  include(FindUFMPACK.dolfin)
-#endif(DOLFIN_ENABLE_UMFPACK)
+if(DOLFIN_ENABLE_UMFPACK)
+  include(FindUMFPACK.dolfin)
+endif(DOLFIN_ENABLE_UMFPACK)
 #if(DOLFIN_ENABLE_TRILINOS)
 #  include(FindTrilinos.dolfin)
 #endif(DOLFIN_ENABLE_TRILINOS)

=== modified file 'cmake/FindMTL4.dolfin.cmake'
--- cmake/FindMTL4.dolfin.cmake	2010-08-09 21:35:58 +0000
+++ cmake/FindMTL4.dolfin.cmake	2010-08-10 09:40:51 +0000
@@ -2,13 +2,15 @@
 
 message(STATUS "checking for package 'MTL4'")
 
+# Check for header file
 find_path(MTL4_INCLUDE_DIR boost/numeric/mtl/mtl.hpp
   $ENV{MTL4_DIR}
   /usr/local/include
   /usr/include
-  DOC "Directory where the MTL4 header directory is located"
+  DOC "Directory where the MTL4 header is located"
   )
 
+# Try compiling and running test program
 if(MTL4_INCLUDE_DIR)
   include(CheckCXXSourceRuns)
   set(CMAKE_REQUIRED_INCLUDES ${MTL4_INCLUDE_DIR})
@@ -21,8 +23,7 @@
   int size = mtl::num_rows(x);
   return 0;
 }
-"
-  MTL4_TEST_RUNS)
+" MTL4_TEST_RUNS)
 
   if(NOT MTL4_TEST_RUNS)
     message("MTL4 was found but a test program could not be run.")
@@ -30,8 +31,9 @@
 
 endif(MTL4_INCLUDE_DIR)
 
+# Report results of tests
 if(MTL4_TEST_RUNS)
-  message(STATUS "  found package MTL4")
+  message(STATUS "  found package 'MTL4'")
   set(MTL4_FOUND 1)
   include_directories(${MTL4_INCLUDE_DIR})
   add_definitions(-DHAS_MTL4)

=== added file 'cmake/FindUMFPACK.dolfin.cmake'
--- cmake/FindUMFPACK.dolfin.cmake	1970-01-01 00:00:00 +0000
+++ cmake/FindUMFPACK.dolfin.cmake	2010-08-10 09:40:51 +0000
@@ -0,0 +1,51 @@
+set(UMFPACK_FOUND 0)
+
+message(STATUS "checking for package 'UMFPACK'")
+
+# Check for header file
+find_path(UMFPACK_INCLUDE_DIR umfpack.h
+  $ENV{UMFPACK_DIR}
+  /usr/local/include
+  /usr/include
+  DOC "Directory where the UMFPACK header is located"
+  )
+
+# Try compiling and running test program
+if(UMFPACK_INCLUDE_DIR)
+  include(CheckCXXSourceRuns)
+  set(CMAKE_REQUIRED_INCLUDES ${UMFPACK_INCLUDE_DIR})
+  check_cxx_source_runs("
+#include <stdio.h>
+#include <umfpack.h>
+
+int main() {
+  #ifdef UMFPACK_MAIN_VERSION
+    #ifdef UMFPACK_SUB_VERSION
+      #ifdef UMFPACK_SUBSUB_VERSION
+        printf("%d.%d.%d", UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION,UMFPACK_SUBSUB_VERSION);
+      #else
+        printf("%d.%d", UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION);
+      #endif
+    #else
+      printf("%d", UMFPACK_MAIN_VERSION);
+    #endif
+  #endif
+  return 0;
+}
+" UMFPACK_TEST_RUNS)
+
+  if(NOT UMFPACK_TEST_RUNS)
+    message("UMFPACK was found but a test program could not be run.")
+  endif(NOT UMFPACK_TEST_RUNS)
+
+endif(UMFPACK_INCLUDE_DIR)
+
+# Report results of tests
+if(UMFPACK_TEST_RUNS)
+  message(STATUS "  found package 'UMFPACK'")
+  set(UMFPACK_FOUND 1)
+  include_directories(${UMFPACK_INCLUDE_DIR})
+  add_definitions(-DHAS_UMFPACK)
+else(UMFPACK_TEST_RUNS)
+  message(STATUS "  package 'UMFPACK' could not be configured.")
+endif(UMFPACK_TEST_RUNS)


-- 
Dr Garth N Wells
Department of Engineering
University of Cambridge
Trumpington Street
Cambridge CB2 1PZ
United Kingdom

tel.   +44 1223 3 32743
e-mail gnw20@xxxxxxxxx
http://www.eng.cam.ac.uk/~gnw20/
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2010-08-09 21:57:54 +0000
+++ CMakeLists.txt	2010-08-10 09:40:51 +0000
@@ -72,9 +72,9 @@
 #if(DOLFIN_ENABLE_SCOTCH)
 #  include(FindSCOTCH.dolfin)
 #endif(DOLFIN_ENABLE_SCOTCH)
-#if(DOLFIN_ENABLE_UMFPACK)
-#  include(FindUFMPACK.dolfin)
-#endif(DOLFIN_ENABLE_UMFPACK)
+if(DOLFIN_ENABLE_UMFPACK)
+  include(FindUMFPACK.dolfin)
+endif(DOLFIN_ENABLE_UMFPACK)
 #if(DOLFIN_ENABLE_TRILINOS)
 #  include(FindTrilinos.dolfin)
 #endif(DOLFIN_ENABLE_TRILINOS)

=== modified file 'cmake/FindMTL4.dolfin.cmake'
--- cmake/FindMTL4.dolfin.cmake	2010-08-09 21:35:58 +0000
+++ cmake/FindMTL4.dolfin.cmake	2010-08-10 09:40:51 +0000
@@ -2,13 +2,15 @@
 
 message(STATUS "checking for package 'MTL4'")
 
+# Check for header file
 find_path(MTL4_INCLUDE_DIR boost/numeric/mtl/mtl.hpp
   $ENV{MTL4_DIR}
   /usr/local/include
   /usr/include
-  DOC "Directory where the MTL4 header directory is located"
+  DOC "Directory where the MTL4 header is located"
   )
 
+# Try compiling and running test program
 if(MTL4_INCLUDE_DIR)
   include(CheckCXXSourceRuns)
   set(CMAKE_REQUIRED_INCLUDES ${MTL4_INCLUDE_DIR})
@@ -21,8 +23,7 @@
   int size = mtl::num_rows(x);
   return 0;
 }
-"
-  MTL4_TEST_RUNS)
+" MTL4_TEST_RUNS)
 
   if(NOT MTL4_TEST_RUNS)
     message("MTL4 was found but a test program could not be run.")
@@ -30,8 +31,9 @@
 
 endif(MTL4_INCLUDE_DIR)
 
+# Report results of tests
 if(MTL4_TEST_RUNS)
-  message(STATUS "  found package MTL4")
+  message(STATUS "  found package 'MTL4'")
   set(MTL4_FOUND 1)
   include_directories(${MTL4_INCLUDE_DIR})
   add_definitions(-DHAS_MTL4)

=== added file 'cmake/FindUMFPACK.dolfin.cmake'
--- cmake/FindUMFPACK.dolfin.cmake	1970-01-01 00:00:00 +0000
+++ cmake/FindUMFPACK.dolfin.cmake	2010-08-10 09:40:51 +0000
@@ -0,0 +1,51 @@
+set(UMFPACK_FOUND 0)
+
+message(STATUS "checking for package 'UMFPACK'")
+
+# Check for header file
+find_path(UMFPACK_INCLUDE_DIR umfpack.h
+  $ENV{UMFPACK_DIR}
+  /usr/local/include
+  /usr/include
+  DOC "Directory where the UMFPACK header is located"
+  )
+
+# Try compiling and running test program
+if(UMFPACK_INCLUDE_DIR)
+  include(CheckCXXSourceRuns)
+  set(CMAKE_REQUIRED_INCLUDES ${UMFPACK_INCLUDE_DIR})
+  check_cxx_source_runs("
+#include <stdio.h>
+#include <umfpack.h>
+
+int main() {
+  #ifdef UMFPACK_MAIN_VERSION
+    #ifdef UMFPACK_SUB_VERSION
+      #ifdef UMFPACK_SUBSUB_VERSION
+        printf("%d.%d.%d", UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION,UMFPACK_SUBSUB_VERSION);
+      #else
+        printf("%d.%d", UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION);
+      #endif
+    #else
+      printf("%d", UMFPACK_MAIN_VERSION);
+    #endif
+  #endif
+  return 0;
+}
+" UMFPACK_TEST_RUNS)
+
+  if(NOT UMFPACK_TEST_RUNS)
+    message("UMFPACK was found but a test program could not be run.")
+  endif(NOT UMFPACK_TEST_RUNS)
+
+endif(UMFPACK_INCLUDE_DIR)
+
+# Report results of tests
+if(UMFPACK_TEST_RUNS)
+  message(STATUS "  found package 'UMFPACK'")
+  set(UMFPACK_FOUND 1)
+  include_directories(${UMFPACK_INCLUDE_DIR})
+  add_definitions(-DHAS_UMFPACK)
+else(UMFPACK_TEST_RUNS)
+  message(STATUS "  package 'UMFPACK' could not be configured.")
+endif(UMFPACK_TEST_RUNS)


Follow ups