I would like to share with you a project I have been working on: CalculiX-CrunchiX-MultiSolver and CGX GLFW. Its a refactoring of CCX+CGX with modern libraries, that runs on Linux/MacOS/Windows with easy installers.
The original goal was:
learn AI Agentic programming with Gemini Antigravity and Claude Opus. (I am not fan, but If I need to learn, at least lets do it for my favorite OSS project )
create a CCX+CGX flavor that can compile and run in MacOS.
modify as little as possible from original CalculiX code.
share the project in benefit of the community.
The project is just started, but I hope is already worth a look.
The goals so far have been extended:
CCX-Multisolver runs with MUMPS, Apple Accelerate Solver, MKL Pardiso and SPOOLES as backup. So far MUMPS has been the best results. For MacOS, Apple Accelerate I think has potential, but my MacbookAir M3 so far has the same performance than MUMPS.
Some multi-threading code has been ported to OpenMP
It download+compiles in Linux, MacOS and Windows with a single 1-line install.
For dense algebra, it uses MKL BLAS for Intel CPUs and AMD-BLIS BLAS libraries for AMD computers.
The only additional feature is that the results files can be now JSON formated, which can be very useful in optimisation loops controlled by Python/Julia, for example.
For CGX, now it doesnt need X11, and runs in Wayland Linux desktops natively, MacOS and Windows without installing X11 servers. Additionally has some gimmicks as dark mode, perspective view, VTU export, and a dedicated command line inside the window. It also download+compiles in Linux, MacOS and Windows with a single 1-line install.
The additional code is implemented by AI. Nonetheless, I have done extensive testing, which you can see in the Github Continues integration of the repositories. All builds have testing coverage, which is the same test suite of CalculiX. Systematic performance tests are in progress, which I hope to report in the repo pages soon.
I hope this is of interest and I am grateful for the feedback.
Thank you @carlomontec for sharing about this. We’ve recently been busy with attempting to implement some solvers other than ccx’s default, like Pardiso, Pastix and Spooles in Arch Linux, using the binariers of ccx and cgx downloaded from https://dhondt.de/ After having said this, I think part of the problem described in the paragraph below may be related to the fact that we are not building binaries from the source :/(
We’ve had no chance with Pastix, as of yet. I am not sure if the pastix4calculix library by @dhondt is current. @mayaco is having difficulty with getting it work. The last difficulty she ran into was a library incompatibility which seemed to require a conda environment. I don’t know if this solution sounds reasonable to anybody reading this.
Pardiso is appearantly working, but we did not measure performance improvement relative to the default solver.
This sounds great. I am irritated (sorry xquartz people) by the graphics incompatibility in macOS. I hope this situation may be alleviated as a result of your efforts.
Building a package for a OS-wide repo for Calculix is an exercise in
compromise.
How you should build CalculiX depends on (for example);
Whether CUDA supports your OS.
Whether paradiso is available for your OS.
How much RAM your machine has (important for BUFFERSIZE when building OpenBLAS)
If you are using pastix, you need a single-threaded build of OpenBLAS but with locking enabled.
When building CalculiX, you have to make the choice between using int32 or int64 as indices. This concerns not only the CalculiX solver itself but also libraries like blas and arpack. This may or may not agree with how these libraries are built in the official repositories for your OS/distro.
For that reason I build these libraries as static libraries, and link hem into CalculiX.
Pastix4calculix is tricky in that it currently uses an older version of pastix. That version requires scripts written in Python 2 to expand its aglorithms to all different floating point formats.
I found it easier to (temporarily) install Python 2 than to try and rework the scripts for Python 3.
The original pastix4calculix requires CUDA to be installed, even if you don’t use it. So I’m using a modified version where CUDA has been been made removed.
I wrote some build scripts to make this process easier.
Now these scripts were written on FreeBSD, which is slightly different from Linux. Neither CUDA nor paradiso are available for FreeBSD, so they are not included in the build.
But the scripts might still serve as a source for your efforts.
Thank you very much for guidance into the tricky ways of installing pastix:) Indeed, open-sourcing your install scripts is deeply appreciated, open-sourcing virtually everything seems to be the right way for humanity.
I have a number of questions and ideas at this point.
I have an onboard GPU, so I may use either that or the CPU processors. Is that possible? Compiling pastix into CalculiX such that both methods are available? I guess not.
Thus I will probably have to choose which version of pastix I need (with or without cuda), in addition to choosing between int32 and int64.
Are these two choices related with each other, like you need to select int32 if using CUDA, otherwise int64?
I will definitely study your scripts before I embark on this. I want to ask whether it makes more sense for a standalone machine (with virtually one user only) to compile everything in a conda environment for containment of the compile process, instead of a system-wide install effort?
If I decide not to use the onboard GPU (apparently it is [AMD/ATI] Renoir [Radeon Vega Series / Radeon Vega Mobile Series] (rev c9) I will have to work with the forked cudaless version of pastix4calculix
You’d have to do a deep dive into the pastix code to be sure, but IIRC it looks for a CUDA-compatible GPU at runtime and uses that when available, otherwise it uses the CPU.
When you build pastix out-of-the-box, in tries to #include the CUDA headers, which makes the build fail when they are not installed.
That is my main reason for me to use cudaless pastix; CUDA is not supported on my OS.
CUDA is specific to Nvidia GPU’s. It does not run on AMD GPU’s. So you will need to use pastix without CUDA.
If you build the libraries as static libraries, and “install” them in the build tree, as I have done in my scripts, you don’t need conda.
I’ve never used in and have never missed it.
My scripts build and “install” the libraries in sequence. Each script builds upon and references the output of the previous scripts, explicitly independent of the host system.
I did not pursued PastiX, since my original goal was to have a flavor of CCX that relies on well stablished solvers, and accesible for everybody to install. Linking PastiX goes in the opposite direction. Additionally, as you mention, gettin Pastix to work requires pastix4calculix and special work, which I decided not go for.
MUMPS seems to be in the same ballpark of MKL Pardiso, as CPU only and works well in all OS.