Skip to content

Conversation

@fghoussen
Copy link
Collaborator

Pull request purpose

fixing issue #399 and related to #398 (comment)

@fghoussen
Copy link
Collaborator Author

All flavors of all pc files should now be tested.

The question I still have here is: as arpack is a lib that needs other libs (blas, ...), does pc files must embed libs needed (blas, ...) by arpack?

For now, pc files doesn't: to compile/link with arpack, one need to add compile/link also with libs needed (blas, ...) by arpack.

Not sure what is the right thing to do.

@fghoussen
Copy link
Collaborator Author

Not sure what is the right thing to do.

Now every cases are working and tested:

>> git diff
diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in
index f22a1f2..b1e1d86 100755
@@ -166,8 +156,6 @@ echo "target_include_directories(pdndrv1_pkg INTERFACE BLAS::BLAS)"         >> C
 echo "target_link_libraries(pdndrv1_pkg BLAS::BLAS)"                        >> CMakeLists.txt
 echo "target_include_directories(pdndrv1_pkg INTERFACE LAPACK::LAPACK)"     >> CMakeLists.txt
 echo "target_link_libraries(pdndrv1_pkg LAPACK::LAPACK)"                    >> CMakeLists.txt
-echo "target_include_directories(pdndrv1_pkg INTERFACE MPI::MPI_Fortran)"   >> CMakeLists.txt
-echo "target_link_libraries(pdndrv1_pkg MPI::MPI_Fortran)"                  >> CMakeLists.txt
 echo "target_include_directories(pdndrv1_pkg INTERFACE PkgConfig::ARPACK)"  >> CMakeLists.txt
 echo "target_link_libraries(pdndrv1_pkg PkgConfig::ARPACK)"                 >> CMakeLists.txt
 echo "target_include_directories(pdndrv1_pkg INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt

>> cmake ..

>> bash tstCMakeInstall.sh 
[ 82%] Building Fortran object CMakeFiles/pdndrv1_pkg.dir/pdndrv1.f.o
/usr/bin/f95  -I/tmp/tstCMakeInstall/local/include/arpack  -c /tmp/tstCMakeInstall/tstCMakeInstall/pdndrv1.f -o CMakeFiles/pdndrv1_pkg.dir/pdndrv1.f.o
/tmp/tstCMakeInstall/tstCMakeInstall/pdndrv1.f:59:0:

   59 |       include 'mpif.h'
      | 
Fatal Error: Cannot open included file ‘mpif.h’

With means parpack.pc is likely not self-consistent: there is no Cflags.private (and according to pkg-config doc I'am not sure if this is supported) and Libs.private is not used as compilation fails.

>> cat /tmp/tstCMakeInstall/local/lib/pkgconfig/parpack.pc 
prefix=/tmp/tstCMakeInstall/local
exec_prefix=${prefix}
libdir=/tmp/tstCMakeInstall/local/lib
includedir=/tmp/tstCMakeInstall/local/include/arpack

Name: arpack
Description: Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems
Version: 3.9.0
URL: https://github.com/opencollab/arpack-ng/
Requires.private: arpack
Libs: -L${libdir} -lparpack
Libs.private: -llapack -lblas -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lopen-rte -lopen-pal -lhwloc -levent_core -levent_pthreads -lm -lz
Cflags: -I${includedir}

If you don't "help" cmake with extra MPI target you provide, pc file is not enough...

@fghoussen
Copy link
Collaborator Author

there is no Cflags.private

Should use Requires.private? If yes, how?... @sylvestre: any clue?...

@fghoussen fghoussen merged commit e7cf106 into opencollab:master Aug 14, 2023
@fghoussen fghoussen deleted the fix-install branch August 14, 2023 10:26
@fghoussen
Copy link
Collaborator Author

All flavors of all pc/cmake files should now be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant