[petsc-dev] problems with shared libraries and pragmatic.py

Satish Balay balay at mcs.anl.gov
Thu Oct 15 17:08:29 CDT 2015


On Thu, 15 Oct 2015, Sean Farley wrote:

> > BTW: pragmatic is built with cmake, could that be messing it up somehow?
> 
> It might be missing the cmake rpath stuff on osx that uses
> install_name_tool. If I recall, that isn't set by default.

Ok  https://bitbucket.org/petsc/pkg-metis/commits/42ab1971218c71b951ba507ca9f16718daae4f6a

So the following patch works.

Satish

------


balay at imav^~/petsc/arch-darwin-c-debug/externalpackages/pragmatic((1344685...)) $ git diff |cat
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed6af70..d77f3ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,6 +121,7 @@ file(GLOB C_SOURCES src/*.c)
 file(GLOB CXX_SOURCES src/*.cpp)
 
 # target_link_library
+set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
 add_library(pragmatic SHARED ${C_SOURCES} ${CXX_SOURCES})
 target_link_libraries(pragmatic ${PRAGMATIC_LIBRARIES})
 

balay at imav^~/petsc(master) $ otool -L arch-darwin-c-debug/lib/libpragmatic.dylib 
arch-darwin-c-debug/lib/libpragmatic.dylib:
        /Users/balay/petsc/arch-darwin-c-debug/lib/libpragmatic.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
balay at imav^~/petsc(master) $ make test
Running test examples to verify correct installation
Using PETSC_DIR=/Users/balay/petsc and PETSC_ARCH=arch-darwin-c-debug
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process
Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process
Completed test examples
=========================================
Now to evaluate the computer systems you plan use - do:
make PETSC_DIR=/Users/balay/petsc PETSC_ARCH=arch-darwin-c-debug streams NPMAX=<number of MPI processes you intend to use>
balay at imav^~/petsc(master) $ 



More information about the petsc-dev mailing list