gemini3d

Build Gemini3D with GCC on MacOS

AppleClang LLVM compilers work fine with GCC/Gfortran in general on MacOS.

Install libraries via Homebrew such as CMake:

brew install cmake

One-time Gemini3D external library setup

git clone https://github.com/gemini3d/external

cmake -P external/scripts/requirements.cmake
# gives command to install compiler and system libraries

cmake -S external -B external/build -DCMAKE_INSTALL_PREFIX=~/lib_gcc

cmake --build external/build

that installs Gemini3d external libraries under ~/lib_gcc. This path is arbitrary but should be distinct between compilers.

Build and Test Gemini3D

git clone https://github.com/gemini3d/gemini3d

cmake -S gemini3d -B build/gemini3d -DCMAKE_PREFIX_PATH=~/lib_gcc

cmake --build gemini3d/build

ctest --test-dir gemini3d/build

Troubleshooting

The compiler relies on libc and libstdc++. If build errors missing “stdio.h” or “filesystem” at C++ link time, the system configuration may be messed up.

If problems, try installing Xcode:

xcode-select --install

and try these environment variables:

export LIBRARY_PATH=$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
export CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

export CXXFLAGS=-I$CPLUS_INCLUDE_PATH
export CFLAGS=$CXXFLAGS