Skip to content

Commit

Permalink
Test CMake build process on cerebellum at UCSF
Browse files Browse the repository at this point in the history
  • Loading branch information
YannCobigo committed Sep 23, 2014
1 parent e3a167d commit 00b9a57
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 23 deletions.
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ set(CMAKE_MODULE_PATH
#
# General libraries
find_package( PkgConfig REQUIRED)
#pkg_check_modules( metis REQUIRED metis )


#
Expand All @@ -93,7 +94,7 @@ find_package(DOLFIN REQUIRED CONFIG)
if(DOLFIN_FOUND)
message( STATUS "FEniCS found at ${DOLFIN_INCLUDE_DIRS}" )
include(${DOLFIN_USE_FILE})
get_filename_component( DOLFIN_LIBRARY_DIRS ${DOLFIN_LIBRARIES} DIRECTORY )
get_filename_component( DOLFIN_LIBRARY_DIRS ${DOLFIN_LIBRARIES} PATH )
endif()

#
Expand Down Expand Up @@ -133,13 +134,23 @@ if(EIGEN_FOUND)
include_directories(${EIGEN_INCLUDE_DIR})
endif()

##
## MPI (FEniCS)
#find_package(MPI REQUIRED)
##
#if( MPI_FOUND )
# message(STATUS "MPI found" )# @ ${MPI_INCLUDE_PATH} : ")
# include_directories(${MPI_INCLUDE_PATH})
#endif()


#
# MPI (FEniCS)
find_package(MPI REQUIRED)
# Metis
find_package( METIS REQUIRED )
#
if(MPI_FOUND)
message(STATUS "MPI found @ ${MPI_INCLUDE_PATH} : ")
include_directories(${MPI_INCLUDE_PATH})
if( METIS_FOUND )
message( STATUS "Metis found" )
include_directories( ${METIS_INCLUDE_DIR} )
endif()

#
Expand All @@ -156,7 +167,7 @@ endif()
find_package(CGAL 4.3 REQUIRED)
#
if(CGAL_FOUND)
message( STATUS "CGAL FOUND ${CGAL_DIR}" )
message( STATUS "CGAL found ${CGAL_DIR}" )
add_definitions( -DCGAL_EIGEN3_ENABLED )
include( ${CGAL_USE_FILE} )
endif()
Expand Down
4 changes: 0 additions & 4 deletions Fijee/Mesh_rendering/Head_conductivity_tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
#include "Conductivity_tensor.h"
#include "CGAL_tools.h"
#include "Cell_conductivity.h"

#include <metis.h>
//
// Eigen
//
#include <Eigen/Dense>
// VTK
#include <vtkSmartPointer.h>
#include <vtkMatrix3x3.h>
//#include <vtkMath.h>

/*! \namespace Domains
*
* Name space for our new package
Expand Down
3 changes: 1 addition & 2 deletions Fijee/Mesh_rendering/Parcellation_METIS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
//
//
//
extern "C"
{
extern "C" {
#include <stdlib.h> /* calloc, exit, free */
#include <metis.h>
}
Expand Down
4 changes: 3 additions & 1 deletion FijeeConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ set( Fijee_INCLUDE_DIRS
"@EIGEN_INCLUDE_DIR@"
"@NIFTI_INCLUDE_DIR@"
"@CGAL_INCLUDE_DIRS@"
"@METIS_INCLUDE_DIR@"
"@VTK_INCLUDE_DIRS@"
"@DOLFIN_INCLUDE_DIRS@"
)
#
set( Fijee_LIBRARY_DIRS
"@Fijee_LIBRARY_DIR@"
"@CGAL_DIR@"
"@CGAL_LIBRARIES_DIR@"
"@METIS_LIBRARY_DIR@"
"@VTK_LIBRARY_DIRS@"
"@DOLFIN_LIBRARY_DIRS@"
)
Expand Down
33 changes: 24 additions & 9 deletions cmake/modules/FindEIGEN.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
message(STATUS "Checking for EIGEN3")
#
# Find the EIGEN includes and libraries
#
# EIGEN is a library that implements a variety of algorithms for
# linear algebra, sparse matrices.
# It can be found at:
#
# EIGEN_INCLUDE_DIR - where to find metis.h
# EIGEN_LIBRARIES - List of fully qualified libraries to link against.
# EIGEN_FOUND - Do not attempt to use if "no" or undefined.

find_path( EIGEN_INCLUDE_DIR Eigen
${EIGEN_DIR}/include/eigen3
/usr/include/eigen3
/usr/include
/opt/local/include
/usr/local/include
)

if(NOT ${EIGEN_DIR})
set(EIGEN_DIR "/usr/include/eigen3")
endif()

set(EIGEN_INCLUDE_DIR "/usr/include/eigen3")


set(EIGEN_FOUND 1)
if(EIGEN_INCLUDE_DIR)
set( EIGEN_FOUND "YES" )
else()
set( EIGEN_FOUND "NO" )
message(STATUS "Eigen not found")
endif( EIGEN_INCLUDE_DIR )

mark_as_advanced( EIGEN_INCLUDE_DIR EIGEN_LIBRARY )
37 changes: 37 additions & 0 deletions cmake/modules/FindMETIS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Find the METIS includes and libraries
#
# METIS is a library that implements a variety of algorithms for
# partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of
# sparse matrices. It can be found at:
#
# METIS_INCLUDE_DIR - where to find metis.h
# METIS_LIBRARIES - List of fully qualified libraries to link against.
# METIS_FOUND - Do not attempt to use if "no" or undefined.

find_path( METIS_INCLUDE_DIR metis.h
${METIS_DIR}/include
/opt/local/include
/usr/local/include
/usr/include
/usr/include/metis
# $ENV{METIS_DIR}/include
)

find_library( METIS_LIBRARY metis
HINTS ${METIS_DIR}/lib
PATHS /opt/local/lib /usr/local/lib /usr/lib
# $ENV{METIS_DIR}/lib
)
#
get_filename_component( METIS_LIBRARY_DIR "${METIS_LIBRARY}" PATH)

if(METIS_INCLUDE_DIR)
add_definitions( -DIDXTYPEWIDTH=64 -DINTSIZE64 )

if( METIS_LIBRARY )
set( METIS_FOUND "YES" )
endif( METIS_LIBRARY )
endif( METIS_INCLUDE_DIR )

mark_as_advanced( METIS_INCLUDE_DIR METIS_LIBRARY )

0 comments on commit 00b9a57

Please sign in to comment.