On 07/06/2016 12:10, B00083603 Michael O Brien wrote:
Hi all,
I have to build OpenCV on multiple machines and I was wondering if the
following was possible and advisable or should I use a different method?
I'm still learning about the cmake,make, make install way of software
installation
*Environment*
All the machines (vms) have access to the same shared storage and are
all are Ubuntu 14.04
*On vm1:* run "cmake" on the files stored on the shared storage with the
configuration I need then run "make -j$(nproc)" before using "make
install" to install OpenCV
*On vm 2 to vm n*: Can I just run make install (assuming all the
required software is already installed) or would I be advised to run
"cmake" and "make -j" commands again?
Also is there any issues (file locks for example) about running the
required commands in parallel on multple vms pointing to the same source
or would I be advised to run the commands in serial (vm by vm)?
Finally can I point "make install" to the directory where cmake created
the makefile (apologies if this isn't the correct term, but where cmake
did its work) so I can script the" make install" from outside the build
directory for a slightly cleaner script
So, I also use NFS (v4) mounted storage with all the sources on there,
be it git repositories, unpacked source archives etc. However, the
difference is that I don't *build* on NFS. I do it in /tmp, or some
other local scratch space:
cd /tmp
mkdir build
cd build
cmake [options] /path/to/sources
make
[sudo] make install
This will have the following benefits:
- solves all your root-on-nfs permissions issues
- the builds will be vastly faster
- there won't be any timestamp clock skew issues to confound make
- there won't be any NFSv3 locking issues
- you can have a separate build tree per VM, so the source tree stays
nice and pristine while you build on as many platforms as you desire; I
do this with Linux, BSD and Windows VMs all building the same git repo
branches
For the install, can't you just
(cd "$builddir" && make install)
i.e. in a subshell? Or
cmake --build "$builddir" --target install
to be generator-agnostic?
Regards,
Roger
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake