Updating macOS port on Macports to v5.8.0, vtk gets installed into /usr/local/

Hello,
I’m trying to bump the version of Paraview on Macports, but after updating the version, the build gets to 100%, but VTK tries to get installed into /usr/local.

I have the feeling that the option -DMACOS_APP_INSTALL_PREFIX is not used anymore. Is there something I need to tweak?

:info:destroot make[2]: Nothing to be done for `Wrapping/Python/CMakeFiles/paraview_python_copy.dir/build'.
:info:destroot [100%] Built target paraview_python_copy
:info:destroot /opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/_Users_rubendibattista_git_macports-ports_science_paraview/paraview/work/build/CMakeFiles 0
:info:destroot /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 preinstall
:info:destroot make[1]: Nothing to be done for `preinstall'.
:info:destroot Install the project...
:info:destroot /opt/local/bin/cmake -P cmake_install.cmake
:info:destroot -- Install configuration: "Release"
:info:destroot CMake Error at cmake_install.cmake:48 (file):
:info:destroot   file cannot create directory: /usr/local/lib/cmake/paraview-5.8/vtk.  Maybe
:info:destroot   need administrative privileges.

Those are the configure options Macports forwards to cmake:

opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_NAME_DIR="/opt/local/lib"
-DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr"
-DCMAKE_C_COMPILER="$CC"
-DCMAKE_CXX_COMPILER="$CXX"
-DCMAKE_POLICY_DEFAULT_CMP0025=NEW
-DCMAKE_POLICY_DEFAULT_CMP0060=NEW
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_COLOR_MAKEFILE=ON
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_MAKE_PROGRAM=/usr/bin/make
-DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules"
-DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules"
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
-Wno-dev
-DBUILD_TESTING:BOOL=OFF
-DMACOSX_APP_INSTALL_PREFIX=/opt/local/var/macports/build/_Users_rubendibattista_git_macports-ports_science_paraview/paraview/work/destroot/Applications/MacPorts
-DBUILD_SHARED_LIBS:BOOL=ON
-DPARAVIEW_QT_VERSION=5
-DQt5_DIR=/opt/local/libexec/qt5
-DQT_HELP_GENERATOR=/opt/local/libexec/qt5/bin/qhelpgenerator
-DQT_XMLPATTERNS_EXECUTABLE=/opt/local/libexec/qt5/bin/xmlpatterns
-DVTK_USE_SYSTEM_LIBRARIES:BOOL=ON
-DVTK_USE_SYSTEM_XDMF2:BOOL=OFF
-DPARAVIEW_ENABLE_PYTHON:BOOL=ON
-DPYTHON_EXECUTABLE=/opt/local/bin/python3.7
-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.7/Headers/
-DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib
-DVTK_USE_SYSTEM_MPI4PY:BOOL=ON
-DPARAVIEW_ENABLE_FFMPEG:BOOL=ON
-DPARAVIEW_ENABLE_XDMF3:BOOL=ON
-DCMAKE_OSX_ARCHITECTURES="x86_64"
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.15"
-DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk"
-DCMAKE_CXX_COMPILER=/usr/bin/clang++
-DCMAKE_C_COMPILER=/usr/bin/clang
-DPARAVIEW_USE_MPI:BOOL=ON
-DMPI_C_COMPILER=mpicc-mpich-mp
-DMPI_CXX_COMPILER=mpicxx-mpich-mp
-DMPIEXEC=mpiexec-mpich-mp
-DMPI_Fortran_COMPILER=mpif90-mpich-mp
-DVTK_USE_SYSTEM_DIY2:BOOL=OFF
/opt/local/var/macports/build/_Users_rubendibattista_git_macports-ports_science_paraview/paraview/work/ParaView-v5.8.0
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

@ben.boeckel @cory.quammen

Does it need sudo privileges? Though…it seems that macports needs to update their CMake options. The share/cmake/Modules subdirectory is old and there’s nothing setting CMAKE_INSTALL_PREFIX=/opt/local, so the default of /usr/local still applies.

Ehi @ben.boeckel, thanks. But the fact that CMAKE_INSTALL_PREFIX is missing is due to the fact that, theoretically, this should be an App bundle, shouldn’t it? For that reason, it should use -DMACOSX_APP_INSTALL_PREFIX as prefix to install the App bundle. Am I wrong?

And morevoer macports already has rights to write into /opt/local.

The problem here is that now it tries to install vtk following CMAKE_INSTALL_PREFIX instead of following the path for the App bundle.

It makes an app bundle, but it isn’t relocatable as a bundle (the prefix as a whole is the relocatable bit right now). It’s basically a standard Unix-style install layout with bin/Applications/paraview.app using relative paths into that prefix. For a relocatable bundle, the superbuild is necessary.

Yes, no problem about that. It always has been like that. So, do I need to specify the -DCMAKE_INSTALL_PREFIX then? :slight_smile:

Yeah, that’s the first step in the solution. I recommend going through Documentation/dev/build.md document to see what variables you actually need to set with the 9.0 release (since a lot of things got moved around). Anything not mentioned there or in CMake docs is either undocumented (and probably has some other way of handling it) or is no longer relevant.