forked from laurentkneip/opengv
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request laurentkneip#56 from jbriales/bash_MEX
Add bash script for automatic MEX compilation in Linux
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# Generate MEX files by compiling from Matlab | ||
# This scripts intends to automate the compilation process | ||
# by following the instructions provided in | ||
# http://laurentkneip.github.io/opengv/page_installation.html#sec_installation_5 | ||
# We assume the installation configuration is standard | ||
# so that every dependency can be found in an automated way | ||
|
||
# We assume a launcher command is available: matlab | ||
# Add OpenGV library directory to the path | ||
export LD_LIBRARY_PATH=../build/lib:$LD_LIBRARY_PATH | ||
|
||
# Find path to Eigen library (assumes CMake has cached EIGEN_INCLUDE_DIRS) | ||
# See https://stackoverflow.com/questions/8474753/how-to-get-a-cmake-variable-from-the-command-line | ||
EigenPath=$(cmake -L ../build | grep EIGEN_INCLUDE_DIRS | cut -d "=" -f2) | ||
|
||
# Call Matlab with the compilation command | ||
matlab -nodisplay -nosplash -nodesktop \ | ||
-r "mex -I../include -I${EigenPath} -L../build/lib -lopengv opengv.cpp -cxx, mex -I../include -I${EigenPath} -L../build/lib -lopengv opengv_donotuse.cpp -cxx, exit" | ||
|
||
|