For building some libraries that is inconvenient for integration by source+CMake.
Libraries to build:
- zlib
- hdf5
- cgns
- parmetis+metis
- cantera (chemistry, requires SCons)
- build essentials including gcc, g++
- MPI SDK (including mpicc, mpicxx wrapper, for example apt package
libopenmpi-dev) - GNU Make
- CMake
- SCons (for Cantera)
- python3 interpreter
- Visual Studio (msvc toolchain for C/C++)
- Intel OneAPI (need to activate its environment in the shell) (need MPI SDK)
- CMake
- python interpreter
Clone this repo.
Update git submodules.
git submodule update --init --depth=1 --recursiveThen run the script to build.
python cfd_externals_build.pyThen all files are locally installed in install.
A pitfall: if you need to specify a non-system compiler set, like /path/to/gcc-11, error in linking libmpi.so could occur.
Therefore, if you see something like conflicting libmpi.so in the final executable linking, or by ldd you see wrong mpi links, or the program crashes due to mpi, try this:
CC=mpicc CXX=mpicxx python cfd_externals_build.pywhich will link mpi correctly if the problem is linking to a faulty mpi library.
To control which compiler the wrapper uses, consult the vendor (like openmpi or mpich). You can check compiler using mpicc -v.
tar --exclude='.git' -zcvf cfd_externals_expo.tar.gz cfd_externals_expo
~/repo/github/
├── CGNS
│ └── CGNS.git
├── harryzhou2000
│ ├── cfd_externals.git
│ └── parmetis_fix
├── HDFGroup
│ └── hdf5.git
└── madler
└── zlibxxx.git or xxx are both ok, with xxx.git created with git clone --bare <url>
In ~/.gitconfig
[url "~/repo/github/"]
insteadOf = https://github.com/or
git config --global url."~/repo/github/".insteadOf "https://github.com/"edit ~/.gitconfig to reverse this setting.
Using global instead of local setting saves the trouble of recursively configuring submodule settings.
To update / init recursively:
git -c protocol.file.allow=always submodule update --init --recursiveupdate with remote:
git -c protocol.file.allow=always submodule update --init --remote --recursive