FAQ  •  Login

Installing dependencies on Euler

<<

jiashenboon

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Sun Nov 29, 2015 10:52 pm

Installing dependencies on Euler

What can we do if our project requires dependencies that Euler does not have? I'm thinking specifically of libraries that we'd be able to install if we had CUDA on our own machines.

My project is basically 1) look at what's already implemented out there, 2) implement it myself, 3) compare my implementation with what's out there. And my "what's out there" is OpenCV3, which isn't installed on Euler machines (CMake can't find OpenCV3 if I have "find_package(OpenCV 3 REQUIRED)").
<<

edwardtashjian

Newbie
Newbie

Posts: 22

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Mon Nov 30, 2015 3:32 pm

Re: Installing dependencies on Euler

I was able to get OpenCV working by installing it locally. There are some libraries that aren't installed on Euler so there may be some features that don't work (like displaying images).

Here are the steps I took running from my home directory on euler. Replace username with your euler username.

// download and unpack the files
wget https://github.com/Itseez/opencv/archive/3.0.0.zip
unzip 3.0.0.zip

// create a directory to install to
mkdir opencv

// build opencv
cd opencv-3.0.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/home/username/opencv/ .. // use the path to the directory you created earlier for install prefix
make // this will take awhile
make install

I then used the following CMakeLists.txt file to build some of the sample programs. There probably is a more elegant way to do this, but this works well enough. Replace username with your euler username and DisplayImage with the executable you are building.

  Code:
cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
include_directories( /home/username/opencv/include/ )
add_executable( DisplayImage DisplayImage.cpp )
FILE(GLOB libs /home/username/opencv/lib/*)
target_link_libraries( DisplayImage ${libs})


I was able to compile several of the sample programs this way. One important thing to note is that it doesn't seem like Euler has the libraries necessary to use the OpenCV display utilities. For any sample code you try, just comment out any namedWindow or imshow calls and replace it with imwrite. You can then view the written image file using something else.

Hope this helps.
<<

jiashenboon

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Mon Nov 30, 2015 4:06 pm

Re: Installing dependencies on Euler

Thanks for your suggestion. Doesn't this mean that you'll be running your programs on the head node? Since the head node doesn't have a GPU, we can't try out the OpenCV functions that use CUDA if we use this method right?
<<

edwardtashjian

Newbie
Newbie

Posts: 22

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Mon Nov 30, 2015 5:48 pm

Re: Installing dependencies on Euler

No you can still run on GPUs. You are only compiling on the head node. So, write and compile your opencv code on a head node, and use a slurm script to run it just like we did for homeworks.

I was able to verify this works using the alpha_comp sample provided with OpenCV (albeit with heavy modification) and verified GPU interaction was occurring using nvvp.
<<

jiashenboon

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Mon Nov 30, 2015 6:28 pm

Re: Installing dependencies on Euler

awesome. Thanks!
<<

jiashenboon

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Thu Dec 03, 2015 11:26 am

Re: Installing dependencies on Euler

wow I had to run make overnight. the cuda binaries seem to take extremely long to build. Usually opencv is built in a few minutes.

Return to ME759 Fall 2015: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.