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

Add PyChaste Support for VTK 9 #24

Closed
Tracked by #27
kwabenantim opened this issue Jul 17, 2023 · 9 comments · May be fixed by #72
Closed
Tracked by #27

Add PyChaste Support for VTK 9 #24

kwabenantim opened this issue Jul 17, 2023 · 9 comments · May be fixed by #72
Assignees
Labels
enhancement New feature or request

Comments

@kwabenantim
Copy link
Member

Description
API changes from VTK 8 to 9: https://vtk.org/Wiki/VTK/API_Changes_8_2_0_to_9_0_0

@kwabenantim kwabenantim self-assigned this Jul 17, 2023
@kwabenantim kwabenantim added the enhancement New feature or request label Jul 17, 2023
@kwabenantim kwabenantim added this to the BBR milestone 3.1 milestone Sep 19, 2023
@kwabenantim kwabenantim changed the title Support VTK 9 Add PyChaste Support for VTK 9 Nov 14, 2023
@kwabenantim
Copy link
Member Author

CMake Error at cmake/Modules/ChasteMacros.cmake:321 (add_library):
  Target "chaste_project_PyChaste" links to target "Freetype::Freetype" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  cmake/Modules/ChasteMacros.cmake:411 (Chaste_DO_COMMON)
  projects/PyChaste/CMakeLists.txt:65 (chaste_do_project)


CMake Error at cmake/Modules/ChasteMacros.cmake:321 (add_library):
  Target "chaste_project_PyChaste" links to target "X11::X11" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  cmake/Modules/ChasteMacros.cmake:411 (Chaste_DO_COMMON)
  projects/PyChaste/CMakeLists.txt:65 (chaste_do_project)


CMake Error at cmake/Modules/ChasteMacros.cmake:321 (add_library):
  Target "chaste_project_PyChaste" links to target "GLEW::GLEW" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  cmake/Modules/ChasteMacros.cmake:411 (Chaste_DO_COMMON)
  projects/PyChaste/CMakeLists.txt:65 (chaste_do_project)


CMake Error at cmake/Modules/ChasteMacros.cmake:321 (add_library):
  Target "chaste_project_PyChaste" links to target "X11::X11" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  cmake/Modules/ChasteMacros.cmake:411 (Chaste_DO_COMMON)
  projects/PyChaste/CMakeLists.txt:65 (chaste_do_project)


CMake Error at cmake/Modules/ChasteMacros.cmake:321 (add_library):
  Target "chaste_project_PyChaste" links to target "Python3::Module" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  cmake/Modules/ChasteMacros.cmake:411 (Chaste_DO_COMMON)
  projects/PyChaste/CMakeLists.txt:65 (chaste_do_project)

@kwabenantim
Copy link
Member Author

kwabenantim commented May 14, 2024

Steps to reproduce the CMake configuration errors:

git clone https://github.com/Chaste/Chaste.git

cd Chaste/projects
git clone --recursive https://github.com/PyChaste/PyChaste.git
cd ..

conda create -n vtk9-env
conda activate vtk9-env
mamba install -c conda-forge -c pychaste boost-cpp hdf5="*=*mpi_mpich*" metis mpich parmetis petsc petsc4py sundials vtk=9 tbb-devel xerces-c xsd xvfbwrapper xorg-libxext six notebook

mkdir build
cd build
export PETSC_DIR=$CONDA_PREFIX
export HDF5_ROOT=$CONDA_PREFIX

cmake \
  -DCMAKE_BUILD_TYPE=Release \
  -DPython3_EXECUTABLE=$(which python) \
  -DCMAKE_LIBRARY_PATH="${CONDA_PREFIX}/lib" \
  -DCMAKE_PREFIX_PATH="${CONDA_PREFIX}" \
  -DCMAKE_INSTALL_PREFIX="${CONDA_PREFIX}" \
  -DBUILD_SHARED_LIBS=ON \
  -DBOOST_ROOT="${CONDA_PREFIX}" \
  -DHDF5_C_COMPILER_EXECUTABLE="${CONDA_PREFIX}/bin/h5pcc" \
  -DVTK_DIR=${CONDA_PREFIX} \
  -DXERCESC_INCLUDE="${CONDA_PREFIX}/include" \
  -DXERCESC_LIBRARY="${CONDA_PREFIX}/lib/libxerces-c.so" \
  -DXSD_EXECUTABLE="${CONDA_PREFIX}/bin/xsd" \
  ..

@kwabenantim
Copy link
Member Author

@fcooper8472 suggests investigating fixes like those done in https://github.com/Chaste/Chaste/pull/152/files

@kwabenantim
Copy link
Member Author

There's now a github action testing this: https://github.com/Chaste/PyChaste/actions/runs/9082771049/job/24959931938

kwabenantim added a commit that referenced this issue May 16, 2024
@kwabenantim kwabenantim linked a pull request May 16, 2024 that will close this issue
kwabenantim added a commit that referenced this issue May 16, 2024
kwabenantim added a commit that referenced this issue May 16, 2024
kwabenantim added a commit that referenced this issue May 16, 2024
kwabenantim added a commit that referenced this issue May 17, 2024
kwabenantim added a commit that referenced this issue May 17, 2024
kwabenantim added a commit that referenced this issue May 17, 2024
kwabenantim added a commit that referenced this issue May 17, 2024
@kwabenantim
Copy link
Member Author

CMake errors are from additional VTK components:

RenderingFreeType # needs Freetype::Freetype
RenderingOpenGL2 # needs X11::X11 and GLEW::GLEW
WrappingPythonCore # needs Python3::Module

@kwabenantim
Copy link
Member Author

kwabenantim commented May 21, 2024

The errors seem to go away when the extra package modules are searched for directly in Chaste. Possibly subsequent calls to find_package() don't (can't?) add the extra targets correctly?

---find_package(Python3 3.5 )
+++find_package(Python3 3.5 REQUIRED COMPONENTS Interpreter Development)
find_package(
    VTK COMPONENTS CommonCore CommonDataModel FiltersCore FiltersGeneral FiltersGeneric FiltersGeometry
---    FiltersModeling FiltersSources IOCore IOGeometry IOLegacy IOParallelXML IOXML REQUIRED
+++    FiltersModeling FiltersSources IOCore IOGeometry IOLegacy IOParallelXML IOXML
+++    FiltersProgrammable FiltersVerdict InteractionStyle IOImage IOMovie RenderingAnnotation RenderingCore
+++    RenderingFreeType RenderingOpenGL2 WrappingPythonCore  REQUIRED
        )

@kwabenantim
Copy link
Member Author

kwabenantim commented May 22, 2024

It still works when find_package() is called twice from Chaste to add extra components. Possibly a scope issue? The targets from the first find_package() call seem to disappear after the second call, however.

kwabenantim added a commit that referenced this issue May 22, 2024
kwabenantim added a commit that referenced this issue May 22, 2024
@kwabenantim
Copy link
Member Author

PyChaste works with VTK9 but needs the cmake find package call to be done above the project scope. This will be done directly in the PyChaste merge into Chaste trunk: Chaste/Chaste#273

@kwabenantim
Copy link
Member Author

This is now fixed as of Chaste/Chaste@a51678b

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

Successfully merging a pull request may close this issue.

2 participants