|
[Sponsors] |
January 11, 2011, 11:40 |
PETSc from Cmake
|
#1 |
New Member
Join Date: Jan 2011
Posts: 6
Rep Power: 15 |
Hi
does anyone know how to create a Cmake file to use PETSc in Fortran? Write a make file for useing PETSc is quite simple, but how to call the PETSc's libraries in a Cmake? |
|
January 12, 2011, 07:50 |
|
#2 |
New Member
Join Date: Jan 2011
Posts: 6
Rep Power: 15 |
Solved!
See here https://github.com/jedbrown/cmake-modules for useful cmake files for using petcs with cmake. Here is my simple Cmakelist.txt for calling them and run one of petsc's examples Code:
cmake_minimum_required(VERSION 2.8) project (Test Fortran C) SET(FIND_PETSC PROJETC_SOURCE_DIR) SET(CMAKE_MODULE_PATH ${FIND_PETSC} ) FIND_PACKAGE(PETSc REQUIRED) SET(FORTRAN_PREPROCESS_FLAG -I${PETSC_INCLUDE_DIR}) SET(FORTRAN_PREPROCESS_FLAG "${FORTRAN_PREPROCESS_FLAG} -I${PETSC_INCLUDE_CONF}") ADD_EXECUTABLE(TEST ex1f.F) SET_TARGET_PROPERTIES(TEST PROPERTIES COMPILE_FLAGS ${FORTRAN_PREPROCESS_FLAG} ) TARGET_LINK_LIBRARIES(TEST ${PETSC_LIBRARIES}) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cmake error in PV3FoamReader | begou | OpenFOAM Installation | 5 | April 20, 2010 07:11 |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 13:43 |
OpenFOAM15 paraFoam bug | koen | OpenFOAM Bugs | 19 | June 30, 2009 10:46 |
Installation Problem | velan | OpenFOAM Installation | 3 | December 16, 2008 04:17 |
OF 15 Misleading information in README about Qt 43x in openSUSE | alberto | OpenFOAM Bugs | 40 | November 7, 2008 09:20 |