Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .docker/fedora_43/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,3 @@ RUN git clone --branch master --single-branch --depth 1 https://github.com/flexi
ldconfig

WORKDIR /flexi

# Setup FLEXI with PGO
# RUN git clone --branch master --single-branch --depth 1 git@gitlab.iag.uni-stuttgart.de:flexi/codes/pgo.git /pgo
# RUN cmake -B build -DFLEXI_PERFORMANCE=ON -DFLEXI_PERFORMANCE_OPTLIFT=ON -DFLEXI_INSTRUCTION='-march=x86-64 -mtune=generic'
# WORKDIR /flexi/build
# RUN python /pgo/PGO.py
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ runs:
source .venv/bin/activate

if [[ "${{ inputs.minimal }}" != "true" ]]; then
uv pip install --no-cache-dir https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl
uv pip install --no-cache-dir https://github.com/hopr-framework/python-gmsh/raw/refs/heads/main/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl
uv pip install --no-cache-dir -e .
fi

Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ variables:
- uv venv .venv
- source .venv/bin/activate
# Regression checks needs NRG Gmsh, pre-install it
- uv pip install --no-cache-dir https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl
- uv pip install --no-cache-dir https://github.com/hopr-framework/python-gmsh/-/raw/master/gmsh-4.15.1.post1-py3-none-linux_x86_64.whl
# Install all pre-requisites
- uv pip install --no-cache-dir -e .
# Install coverage
Expand Down
7 changes: 0 additions & 7 deletions .gmsh/build_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,10 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s
GMSH_DIR = os.path.join(WORK_DIR, 'gmsh')
GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source')

# Gitlab "python-gmsh" access
LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de'
# LIB_PROJECT = 'libs/python-gmsh'
LIB_PROJECT = '797'


# Determine the number of available cores and leave 2 for other tasks
total_cores = multiprocessing.cpu_count()
build_cores = max(total_cores - 2, 1)


# ------------------------------------------------------------------------
# Version checks
# ------------------------------------------------------------------------
Expand Down
56 changes: 12 additions & 44 deletions .gmsh/build_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,16 @@ def compile(install_cmd: Optional[list] = None, ncores: int = 1, cwd: Optional[s
GMSH_DIR = os.path.join(WORK_DIR, 'gmsh')
GMSH_URL = ('https://gmsh.info/src/', r'gmsh-(\d+\.\d+\.\d+)-source')

# Gitlab "python-gmsh" access
LIB_GITLAB = 'gitlab.iag.uni-stuttgart.de'
# LIB_PROJECT = 'libs/python-gmsh'
LIB_PROJECT = '797'

# Github "python-gmsh" access
LIB_GITHUB = 'github.com'
LIB_OWNER = 'hopr-framework'
LIB_PROJECT = 'python-gmsh'
LIB_BRANCH = 'main'

# Determine the number of available cores and leave 2 for other tasks
total_cores = multiprocessing.cpu_count()
build_cores = max(total_cores - 2, 1)


# ------------------------------------------------------------------------
# Version checks
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -754,46 +753,14 @@ def build_fontconfig():
def build_fltk():
print_header('BUILDING FLTK')

# Add system libjpeg-turbo-devel to PATH
# lfs = 'yes'
# lib = f'libjpeg-turbo-devel-1.2.90-8.el7.{arch}'
# subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501
# check=True,
# cwd=BUILD_DIR,
# shell=True)
# extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
#
# # Move files into common directory
# shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True)
#
# # Add system libpng-devel to PATH
# lib = f'libpng-devel-1.5.13-8.el7.{arch}'
# subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501
# check=True,
# cwd=BUILD_DIR,
# shell=True)
# extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
#
# # Move files into common directory
# shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'include/') , '/io/build/include' , dirs_exist_ok=True)
#
# os.environ['CPPFLAGS'] = '-I{}'.format( os.path.join(BUILD_DIR, 'include'))
# subprocess.check_call(['yum', 'install', '-y', 'libjpeg-turbo-devel', 'libpng-devel'])

fltk_src_dir = os.path.join(BUILD_DIR, f'fltk-{FLTK_VERSION}')
if os.path.exists(fltk_src_dir):
shutil.rmtree(fltk_src_dir)

# url = f'https://www.fltk.org/pub/fltk/{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz'
url = f'https://github.com/fltk/fltk/releases/download/release-{FLTK_VERSION}/fltk-{FLTK_VERSION}-source.tar.gz'
# url = 'https://www.fltk.org/pub/fltk/snapshots/fltk-1.4.x-20241011-013e939c.tar.gz'
file = download(url, BUILD_DIR)
extract(file, BUILD_DIR)

# if os.path.isdir(f'{BUILD_DIR}/fltk-1.4.0'):
# shutil.rmtree(f'{BUILD_DIR}/fltk-1.4.0')
# subprocess.run(['mv', f'{BUILD_DIR}/fltk-1.4.x-20241011-013e939c', f'{BUILD_DIR}/fltk-1.4.0'], check=True)

conf_cmd = [
'./configure',
'--prefix={}'.format(FLTK_DIR),
Expand Down Expand Up @@ -1112,13 +1079,13 @@ def build_gmsh() -> None:
# subprocess.check_call(['yum', 'install', '-y', 'mesa-libGLU-devel'])

# Add system libGLU to PATH
lfs = 'yes'
lib = f'mesa-libGLU-9.0.0-4.el7.{arch}'
subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501
tar = f'{lib}.tar.gz'
subprocess.run([rf'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501
check=True,
cwd=BUILD_DIR,
shell=True)
extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR)
os.environ['PKG_CONFIG_PATH' ] = '{}'.format( os.path.join(BUILD_DIR, 'lib64', 'pkgconfig'))
os.environ['CMAKE_PREFIX_PATH' ] = '{}'.format( os.path.join(BUILD_DIR))
os.environ['CMAKE_LIBRARY_PATH'] = '{}'.format( os.path.join(BUILD_DIR, 'lib64' ))
Expand All @@ -1132,11 +1099,12 @@ def build_gmsh() -> None:
shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'lib64/') , os.path.join(WORK_DIR, 'build', 'lib64') , dirs_exist_ok=True)

lib = f'mesa-libGLU-devel-9.0.0-4.el7.{arch}'
subprocess.run([f'curl https://{LIB_GITLAB}/api/v4/projects/{LIB_PROJECT}/repository/files/{lib}.tar.gz/raw?lfs={lfs} --output {lib}.tar.gz'], # noqa: E501
tar = f'{lib}.tar.gz'
subprocess.run([rf'curl -L https://{LIB_GITHUB}/{LIB_OWNER}/{LIB_PROJECT}/raw/refs/heads/{LIB_BRANCH}/{tar}?download\= --output {tar}'], # noqa: E501
check=True,
cwd=BUILD_DIR,
shell=True)
extract(os.path.join(BUILD_DIR, f'{lib}.tar.gz'), BUILD_DIR)
extract(os.path.join(BUILD_DIR, f'{tar}'), BUILD_DIR)

# Move files into common directory
shutil.copytree(os.path.join(BUILD_DIR, lib, 'usr', 'lib64/') , os.path.join(WORK_DIR, 'build', 'lib64' ) , dirs_exist_ok=True, symlinks=True) # noqa: E501
Expand Down Expand Up @@ -1373,7 +1341,7 @@ def package() -> None:
dependencies = [] # Add any required dependencies

[project.urls]
homepage = 'https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh'
homepage = 'https://github.com/hopr-framework/python-gmsh'

[tool.setuptools]
packages = ['gmsh']
Expand Down
9 changes: 5 additions & 4 deletions pyhope/common/common_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ def commit(self) -> str:


@final
class Gitlab:
class Github:
# Gitlab "python-gmsh" access
LIB_GITLAB: str = 'gitlab.iag.uni-stuttgart.de'
# LIB_PROJECT = 'libs/python-gmsh'
LIB_PROJECT: str = '797'
LIB_GITHUB: str = 'github.com'
LIB_OWNER: str = 'hopr-framework'
LIB_PROJECT: str = 'python-gmsh'
LIB_BRANCH: str = 'main'
LIB_VERSION: dict[str, dict[str, str]] = { # noqa: RUF012
'linux': {
'x86_64' : '4.15.1.post1',
Expand Down
15 changes: 7 additions & 8 deletions pyhope/gmsh/gmsh_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def PkgsCheckGmsh() -> None:
# Local imports ----------------------------------------
import pyhope.output.output as hopout
from pyhope.common.common import IsInteractive
from pyhope.common.common_vars import Gitlab
from pyhope.common.common_vars import Github
# ------------------------------------------------------

# Check the current platform
Expand All @@ -81,7 +81,7 @@ def PkgsCheckGmsh() -> None:
if gmsh_version is None:
# Gmsh is not installed
if IsInteractive():
if system in Gitlab.LIB_SUPPORT and arch in Gitlab.LIB_SUPPORT[system]:
if system in Github.LIB_SUPPORT and arch in Github.LIB_SUPPORT[system]:
print(hopout.warn('\n'))
warning = 'Gmsh is not installed. For compatibility, the NRG Gmsh version will be installed. Continue? (Y/n):'
response = input(hopout.warn(warning) + '\n')
Expand Down Expand Up @@ -109,7 +109,7 @@ def PkgsCheckGmsh() -> None:
if PkgsMetaData('gmsh', 'Intended Audience :: NRG'):
return None

if system not in Gitlab.LIB_SUPPORT or arch not in Gitlab.LIB_SUPPORT[system]:
if system not in Github.LIB_SUPPORT or arch not in Github.LIB_SUPPORT[system]:
warning = hopout.warn(f'Detected non-NRG Gmsh version on unsupported platform [{system}/{arch}]. ' +
'Functionality may be limited.')
print(warning)
Expand Down Expand Up @@ -138,7 +138,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
import tempfile
# Local imports ----------------------------------------
import pyhope.output.output as hopout
from pyhope.common.common_vars import Gitlab
from pyhope.common.common_vars import Github
# ------------------------------------------------------
# Get our package manager
# > Check if 'uv' is available
Expand All @@ -160,8 +160,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:

if version == 'nrg':
# Gitlab "python-gmsh" access
lfs = 'yes'
lib = f'gmsh-{Gitlab.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl'
lib = f'gmsh-{Github.LIB_VERSION[system][arch]}-py3-none-{system}_{arch}.whl'

# Create a temporary directory
with tempfile.TemporaryDirectory() as path:
Expand All @@ -173,7 +172,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
else:
pkgs = os.path.join(path, lib)

curl = [f'curl https://{Gitlab.LIB_GITLAB}/api/v4/projects/{Gitlab.LIB_PROJECT}/repository/files/{lib}/raw?lfs={lfs} --output {pkgs}'] # noqa: E501
curl = [rf'curl -L https://{Github.LIB_GITHUB}/{Github.LIB_OWNER}/{Github.LIB_PROJECT}/raw/refs/heads/{Github.LIB_BRANCH}/{lib}?download\= --output {pkgs}'] # noqa: E501
_ = subprocess.run(curl, check=True, shell=True)

# Compare the hash
Expand All @@ -184,7 +183,7 @@ def PkgsInstallGmsh(system: str, arch: str, version: str) -> None:
for chunk in iter(lambda: f.read(4096), b""):
sha256.update(chunk)

if sha256.hexdigest() == Gitlab.LIB_SUPPORT[system][arch]:
if sha256.hexdigest() == Github.LIB_SUPPORT[system][arch]:
hopout.info('Hash matches, installing Gmsh wheel...')
else:
hopout.error('Hash mismatch, exiting...')
Expand Down
Loading