1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
Index: dolfinx/cpp/dolfinx/CMakeLists.txt
===================================================================
--- dolfinx.orig/cpp/dolfinx/CMakeLists.txt 2021-01-31 13:21:50.986274042 +0100
+++ dolfinx/cpp/dolfinx/CMakeLists.txt 2021-01-31 13:21:50.986274042 +0100
@@ -13,6 +13,13 @@
add_library(dolfinx "") # The "" is needed for older CMake. Remove later.
+if(PETSC_SCALAR_COMPLEX)
+ set(LIB_NAME_EXT "_complex")
+else()
+ set(LIB_NAME_EXT "_real")
+endif()
+set_target_properties(dolfinx PROPERTIES OUTPUT_NAME "dolfinx${LIB_NAME_EXT}")
+
#------------------------------------------------------------------------------
# Add source files to the target
@@ -279,8 +286,8 @@
get_target_property(BOOST_INCLUDE_DIR Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
# Configure and install pkg-config file
-configure_file(${DOLFINX_SOURCE_DIR}/cmake/templates/dolfinx.pc.in ${CMAKE_BINARY_DIR}/dolfinx.pc @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/dolfinx.pc
+configure_file(${DOLFINX_SOURCE_DIR}/cmake/templates/dolfinx.pc.in ${CMAKE_BINARY_DIR}/dolfinx${LIB_NAME_EXT}.pc @ONLY)
+install(FILES ${CMAKE_BINARY_DIR}/dolfinx${LIB_NAME_EXT}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development
)
Index: dolfinx/cpp/cmake/templates/dolfinx.pc.in
===================================================================
--- dolfinx.orig/cpp/cmake/templates/dolfinx.pc.in 2021-01-31 13:21:50.986274042 +0100
+++ dolfinx/cpp/cmake/templates/dolfinx.pc.in 2021-01-31 13:21:50.986274042 +0100
@@ -12,5 +12,5 @@
Version: @DOLFINX_VERSION@
Requires: @PKG_REQUIRES@
Conflicts:
-Libs: @PKG_LINKFLAGS@ -L${libdir} -ldolfinx
+Libs: @PKG_LINKFLAGS@ -L${libdir} -ldolfinx@LIB_NAME_EXT@
Cflags: @PKG_CXXFLAGS@ -DDOLFINX_VERSION=\"@DOLFINX_VERSION@\" ${definitions} -I${includedir} @PKG_INCLUDES@
Index: dolfinx/python/dolfinx/jit.py
===================================================================
--- dolfinx.orig/python/dolfinx/jit.py 2021-01-31 13:21:50.986274042 +0100
+++ dolfinx/python/dolfinx/jit.py 2021-01-31 13:21:50.986274042 +0100
@@ -21,8 +21,9 @@
__all__ = ["ffcx_jit", "get_parameters"]
-if dolfinx.pkgconfig.exists("dolfinx"):
- dolfinx_pc = dolfinx.pkgconfig.parse("dolfinx")
+dolfinx_pc = "dolfinx_complex" if common.has_petsc_complex else "dolfinx_real"
+if dolfinx.pkgconfig.exists(dolfinx_pc):
+ dolfinx_pc = dolfinx.pkgconfig.parse(dolfinx_pc)
else:
raise RuntimeError("Could not find DOLFINX pkg-config file. Make sure appropriate paths are set.")
|