Skip to content
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

cmake does not produce "install" target if eigen is newer than 3.4.0 #29

Closed
Rockarel opened this issue Jan 4, 2023 · 1 comment
Closed

Comments

@Rockarel
Copy link

Rockarel commented Jan 4, 2023

Hi Nacho,

I'd been trying to follow the "Using system installed 3rdparty libraries" and ran into problems in several build environments.

Initially I was using a Ubuntu 18.04 VM which didn't have sufficiently new packages to build OpenVDB 10, so I had to install from source. This eventually worked after a bunch of trial and error, but I'd forgotten the exact steps I took.

More recently I switched to a Debian 10 machine and encountered a similar set of problems. I was trying to follow the instructions mentioned here and kept encountering an issue where cmake in vdbfusion/build would succeed, but the following would occur when trying to call make:

$ make -j4
Scanning dependencies of target external_eigen
Scanning dependencies of target vdbfusion
[ 9%] Creating directories for 'external_eigen'
[ 27%] Building CXX object src/vdbfusion/vdbfusion/CMakeFiles/vdbfusion.dir/MarchingCubes.cpp.o
[ 27%] Building CXX object src/vdbfusion/vdbfusion/CMakeFiles/vdbfusion.dir/VDBVolume.cpp.o
[ 36%] Linking CXX static library libvdbfusion.a
[ 45%] Performing download step (download, verify and extract) for 'external_eigen'
-- Downloading...
dst='/mathworks/devel/sandbox/cstabile/Prototype/PROTOTYPE/R2023b/sdf3D/vdbFusion/vdbfusion/build/eigen/src/eigen-3.4.0.tar.bz2'
timeout='none'
-- Using src='https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2'
[ 45%] Built target vdbfusion
-- verifying file...
file='/mathworks/devel/sandbox/cstabile/Prototype/PROTOTYPE/R2023b/sdf3D/vdbFusion/vdbfusion/build/eigen/src/eigen-3.4.0.tar.bz2'
-- Downloading... done
-- extracting...
src='/mathworks/devel/sandbox/cstabile/Prototype/PROTOTYPE/R2023b/sdf3D/vdbFusion/vdbfusion/build/eigen/src/eigen-3.4.0.tar.bz2
>dst='/mathworks/devel/sandbox/cstabile/Prototype/PROTOTYPE/R2023b/sdf3D/vdbFusion/vdbfusion/build/eigen/src/external_eigen'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 54%] No update step for 'external_eigen'
[ 63%] No patch step for 'external_eigen'
[ 72%] No configure step for 'external_eigen'
[ 81%] No build step for 'external_eigen'
[ 90%] No install step for 'external_eigen'
[100%] Completed 'external_eigen'
[100%] Built target external_eigen
[cstabile@ah-qemachine1-l:/mathworks/devel/sandbox/cstabile/Prototype/PROTOTYPE/R2023b/sdf3D/vdbFusion/vdbfusion/build] ...
$ make install
make: *** No rule to make target 'install'. Stop.

At this point I had already built OpenVDB 10 from source and installed all of the packages mentioned with your command.

It turned out that the latest version of eigen I could get from apt-get is 3.3.9-2, so I ended up installing 3.4.9 from the repo, thinking that the newest version would be safest, but it resulted in the same behavior described above when I call make.

I think you should be able to reproduce this behavior with the following:

Try to install packages (this might be insufficient on older versions of Ubuntu/Debian, I believe I needed to install some from source)

sudo apt-get update && sudo apt-get install --no-install-recommends -y libblosc-dev libboost-iostreams-dev libboost-dev numpy-dev libboost-python-dev libboost-system-dev libeigen3-dev libtbb-dev

Manually install OpenVDB from source

git clone https://github.com/AcademySoftwareFoundation/openvdb.git
mkdir -p openvdb/build; cd openvdb/build; cmake ..; sudo make -j${nproc} install; cd ../..;

Manually install newest version of Eigen (3.4.9)

git clone https://gitlab.com/libeigen/eigen.git
mkdir -p eigen/build; cd eigen/build; cmake ..; sudo make -j${nproc} install; cd ../..;

pkg-config --modversion eigen3 # This should report 3.4.9 or newer

Attempt to install vdbFusion

git clone https://github.com/PRBonn/vdbfusion.git
mkdir -p vdbfusion/build; cd vdbfusion/build;
cmake .. #This works fine
make j${nproc} # This works, but attempts to download eigen 3.4.0 (no error message)
make install # This fails saying there's no "install" target

Assuming you can reproduce this on your end, the workaround is to enter into the downloaded eigen directory and build THAT from source:

Build the downloaded source repo

cd eigen/src/external_eigen;
mkdir build; cd build; cmake ..; sudo make -j${nproc} install; cd ../../../..;

pkg-config --modversion eigen3 # Should now show 3.4.0

Build vdbFusion (this should now work)

sudo make install

I'm not sure whether this restriction was intentional, but it was difficult to determine what was going on behind the scenes (I'm fairly clueless when it comes to build systems so I have no idea what's triggering the behavior). It would be good to indicate why the install target wasn't generated (a biproduct of the build thinking it didn't have the right version?), but in the meantime hopefully this can help someone else if they run into a similar issue in the future.

Thanks in advance!

@nachovizzo
Copy link
Collaborator

Hello! Sorry to hear you have been struggling with the build system, I sadly never have time to spend on adding proper documentation to the research projects and sadly this is the typical outcome, sorry about that!

As said in

# NOTE: Installation is still work in progress, therefore we only support dev machines with all the 3rdparty

This is the real logic behind the install target

if((USE_SYSTEM_EIGEN3 AND USE_SYSTEM_OPENVDB) OR VDBFUSION_STANDALONE)
  include(cmake/Install.cmake)
endif()

Basically, if you want to install the C++ API on your local system, you must have OpenVDB installed (from source or from packages), and also Eigen3. Since both libraries must be available as build-time dependencies of the VDBFusion library.

Error analysys

In your case it was not due Eigen3 version problems, but pay attention to this line:

make install
make: *** No rule to make target 'install'. Stop.

If there is no rule install is because (USE_SYSTEM_EIGEN3 AND USE_SYSTEM_OPENVDB) OR VDBFUSION_STANDALONE evaluates to False. Sadly I can't add just a target called "install" and check it for you, so the developer must provide the right dependencies

VDBFusion standalone tip

It's honestly not properly documented, but if you only need the C++ API(meaning no python stuff) you can directly build from ./src/vdbfusion/vdbfusion/ and that should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants