-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking against metis and gklib #9
Comments
Hi Fabio, it's been a few years since I wrote these modules. I was still learning CMake at the time and wasn't really aware of all the best practices. I can't recall if I was installing METIS from source or via the Aptitude package manager myself. If I redid this today, I would probably try to make the CMake file compatible with the METIS version packaged for CMake here: https://github.com/scivision/METIS In principle you could just drop the file The other useful part of this project are the tests (or examples) provided here: https://github.com/ivan-pi/fmetis/tree/master/src/tests I'd be curious to learn why the tests failed. The possible explanations off the top of my head are: 1) the integer/real size doesn't match the METIS library, 2) there is an indexing error due to the 0- vs 1-based indexing, 3) some example graph file is missing. If you have any other suggestions for improvements, please let me know. Ciao, Ivan |
You are absolutely correct about the two-step installation process, it would be worth updating the README here to points towards the KarypisLab GitHub repositories: Also the CMakeList needs to be corrected to account for the GKlib path. |
Hi @ivan-pi,
... In my idea, I expected the "metis_epart" and "metis_npart" have to start from 1 until the number of cores that I want to use. I had the same behaviour with other tests: It seems that the condition is not correctly passed to the c routine; but, for example, the option for the debug get activated or not according to the fortran program settings. The second is related to the "metis_npart" array because I am not sure how the results are stored: Do you remember something about this point? Again thank you for your time; and if you don't have the time to answer really don't worry. If you need the complete code of my tests, you feel free to ask me it. Ciao |
Hi @ivan-pi,
I am currently working on metis and mpi libraries to optimize our hydrological system modelling; all the codes. tools and modules are freely available on github at https://github.com/c-hydro.
(1)
To compile your fmetis libraries i had to add the gklib to the linking process;
cmake .. -DCMAKE_Fortran_COMPILER=gfortran -DMETIS_LIB="$HOME/metis_workspace/lib/libmetis.a" -DGK_LIB="$HOME/metis_workspace/lib/libGKlib.a" -DCMAKE_INSTALL_PREFIX="$HOME/metis_interface/"
(2)
and I added the GK_LIB in the CMAKE file too (ll 74-75):
add_library(fmetis src/lib/metis_interface.f90 src/lib/metis_oo_interface.f90)
target_link_libraries(fmetis ${METIS_LIB} ${GK_LIB})
Some tests failed, but I am using the libraries to interface my simple metis fortran program to the metis library.
This probably is due to the the new (?) approach to compile metis that, if I correctly understood, it is divided in two parts:
(1) gklib
...
make config cc=gcc prefix="$HOME/metis_workspace" openmp=set
make install
(2) metis
...
make config r64=1 i64=1 cc=gcc gdb=1 gklib_path=$HOME/metis_workspace/ prefix=$HOME/metis_workspace/
make install
Is it correctly or I missed some remarks or suggestions?
I hope I am not wasting your time with unuseful comments or questions
All the best
Fabio
The text was updated successfully, but these errors were encountered: