How to install METIS on ubuntu

别说谁变了你拦得住时间么 提交于 2019-12-18 08:52:30

问题


I want to install the METIS package on ubuntu.

I tried the instructions on the install.txt file which says to use

$ make install 

which I did, after installing make as well.

I also tried the

sudo apt-get install metis

which installed it successfully but

when trying to use it in both cases I get

metis.h: No such file in directory compilation terminated

In case anyone asks I use g++ -I/path/to/file myprogram.cpp to specify the path where metis.h is.

I believe I haven't done something correct in the installation but I can't determine what it is.

Can someone help me with the installation process?


回答1:


You can try sudo apt-get install libmetis-dev.




回答2:


BUILD.txt file from metis:

Building METIS requires CMake 2.8, found at http://www.cmake.org/, as well as GNU make. Assumming CMake and GNU make are installed, two commands should suffice to build metis:

 $ make config
 $ make

so, i tried not directly on ubuntu, but on my mac and it works in that order. after the two make command i have the following folder strucure:

build
-Darwin-x86_64 (the build architecture)
 -libmetis
   -libmetis.a
 -programs
   -gpmetis
    ...

after you can call

make install

I make a little test example and it works. You are maybe interest in my CMake-File. This could be the solution for your problem:

cmake_minimum_required(VERSION 2.8.9)
project (MetisTest)
include_directories("/usr/local/include")
link_directories("/usr/local/lib")
add_executable(metisTest main.cpp)
target_link_libraries(metisTest metis)



回答3:


You may append your metis installation path to the environment variable CPLUS_INCLUDE_PATH. For example, in your ~/.bashrc, add:

export CPLUS_INCLUDE_PATH=$HOME/metis/include:$CPLUS_INCLUDE_PATH

then,

source ~/.bashrc

Please see more in the question Linux could not find metis.h.



来源:https://stackoverflow.com/questions/36046189/how-to-install-metis-on-ubuntu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!