robertsj / libdetran

deterministic transport utilities
MIT License
2 stars 2 forks source link

Install with PETSc-3.14 and HDF5 #32

Closed AI-Pranto closed 1 year ago

AI-Pranto commented 3 years ago

What is the correct way to compile libdetran with PETSc and HDF5?

cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=YES \
-DDETRAN_ENABLE_PYTHON=Yes \
-DDETRAN_ENABLE_OPENMP=Yes \
-DDETRAN_ENABLE_PETSC=Yes \
-DDETRAN_ENABLE_SILO=Yes \
-DDETRAN_ENABLE_HDF5=Yes \
-DDETRAN_ENABLE_BOOST=Yes \
-DDETRAN_ENABLE_FORTRAN=YES \
-DCMAKE_INSTALL_PREFIX=$HOME/libdetran_root_install ../src/

Warning

Environment variable HDF5_ROOT is set to:

    /usr/lib/x86_64-linux-gnu/hdf5/serial/

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

Path = 
HDF5_INCLUDE_DIR: HDF5_INCLUDE_DIR-NOTFOUND
HDF5_LIBRARY:     HDF5_LIBRARY-NOTFOUND
-- Disabling HDF5 since it was not found.

And for PETSc

/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
/home/pranto/github/libdetran/build/Makefile.petsc:5: /home/pranto/optional/petsc-3.14.1/conf/variables: No such file or directory
make: *** No rule to make target '/home/pranto/optional/petsc-3.14.1/conf/variables'.  Stop.
-- petsc_lib_dir 
-- Recognized PETSc install with single library for all packages
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Failed
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Failed
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries - Failed
-- Performing Test MULTIPASS_TEST_4_petsc_works_all
-- Performing Test MULTIPASS_TEST_4_petsc_works_all - Failed
-- PETSc could not be used, maybe the install is broken.
CMake Error at /home/pranto/.local/lib/python3.8/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  PETSc could not be found.  Be sure to set PETSC_DIR and PETSC_ARCH.

Although I have PETSC_DIR path variable in .bashrc

export PETSC_DIR=$HOME/optional/petsc-3.14.1
export PETSC_ARCH=x86_64
export HDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/serial/
robertsj commented 3 years ago

For now, Detran is stuck with older PETSc version (3.4.5 is the latest I've used). PETSc isn't needed to compile, since there are some built-in solvers. The code is basically a mess right now, but I've finally got time to revisit it and will be working toward a trivial build process!