solvcon / devenv

Common development environment for solvcon
9 stars 17 forks source link

Add an application for building modmesh on Taiwania1 #153

Open yungyuc opened 1 year ago

yungyuc commented 1 year ago

The directory applications/ houses scripts for building development environment for specific repository and farms. Create a new sub-directory modmesh/ under it and include the build scripts for building modmesh on Taiwania1.

terrychan999 commented 10 months ago

Automation of Dependency Building on Taiwania

Basic Information

solvcon/devenv provides most dependencies / toolchains for projects such as solvcon/modmesh[1]. solvcon/modmesh is a toolkit designed for solving partial differential equations(PDE) and for visualizing numerical meshes. The goal of this issue is to utilize devenv to enable modmesh to be built on the NCHC's Taiwania-1 supercomputer[2].

Problem To Solve

When building modmesh on Taiwania-1, the biggest challenge is the absence of toolchains for Qt and Pyside6. The building steps have been documented here: https://hackmd.io/@terrychan999/twnia-1_modmesh Therefore, there is a need to write a script to accomplish automation.

Engineering Infrastructure

Automatic Build System: solvcon/devenv Version Control: git Scripting Language: Bash Computing Platform: NCHC's Taiwania-1

References

  1. solvcon/modmesh: https://github.com/solvcon/modmesh
  2. NCHC Taiwania-1: https://iservice.nchc.org.tw/nchc_service/nchc_service_hpc.php
yungyuc commented 10 months ago

Thanks @terrychan999 . I think we can remove the "schedule" part. Do you have prototype scripts for PR?

terrychan999 commented 10 months ago

I've just found the time today to start working on the script. I'll try to submit a PR by tonight.

yungyuc commented 10 months ago

Thanks, @terrychan999 . If the PR is not ready we don't need to rush it. But it would be great if you can make a brief update for what you wanted to do.

terrychan999 commented 10 months ago

I have written a PBS script to enable the building process on the compute node.

#!/bin/bash

#PBS -P <Project_System_Code>
#PBS -N build_modmesh_env
#PBS -l select=1:ncpus=16:mpiprocs=16
#PBS -q <Node_Type>
#PBS -j oe

if [ -f ~/devenv/scripts/init ]; then source ~/devenv/scripts/init; fi

module load gcc/11.2.0
export CC=/pkg/gcc/11.2.0/bin/gcc
export CXX=/pkg/gcc/11.2.0/bin/g++
export LLVM_INSTALL_DIR=~/libclang120

devenv add scia
devenv use scia

export PKG_CONFIG_PATH="$(pkg-config --variable pc_path pkg-config)"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${DEVENVPREFIX}/lib64/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${DEVENVPREFIX}/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${DEVENVPREFIX}/share/pkgconfig

devenv build xcb

devenv build cmake

devenv build openssl

devenv build python

pip3 cache purge

pip3 install ninja meson

devenv build libxkbcommon

QTSRC=/tmp/${PBS_JOBID} SKIPEXTRACT=1 SUB_VER=3 devenv build qt

pip3 install numpy pytest flake8 matplotlib pybind11

git clone https://code.qt.io/pyside/pyside-setup /tmp/${PBS_JOBID}/pyside-setup
cd /tmp/${PBS_JOBID}/pyside-setup && git checkout 6.5.3
pip3 install setuptools==67.8.0 packaging build==0.7 six wheel>=0.35 PyOpenGL pyinstaller==3.6 nuitka==1.4.8 distro patchelf==0.15 pkginfo jinja2 buildozer==1.5.0 tqdm gitpython

python3 setup.py install --qtpaths=${DEVENVPREFIX}/bin/qtpaths --make-spec=ninja --ignore-git --parallel=16
terrychan999 commented 10 months ago

However, I encountered an issue that the compute node lacks libffi-devel, preventing Python from building _ctypes, which is required for some packages.

the login node:

[u0617048@clogin2 ~]$ yum list installed | grep libffi
libffi.x86_64                   3.0.13-18.el7           @anaconda/7.3           
libffi-devel.x86_64             3.0.13-18.el7           @rhel-7-server-rpms

the compute node, I wrote a command in PBS script yum list installed | grep libffi >> libffi.log

[u0617048@clogin2 ~]$ cat libffi.log 
libffi.x86_64                   3.0.13-18.el7           @anaconda/7.3

I am currently testing a compatible version of libffi to build it from the source.

yungyuc commented 10 months ago

Thanks for the update. I concur that we probably need to build libffi ourselves.