配置构建产物位置
# Create build directory
echo "Creating build directory..."
mkdir -p build_static
cd build_static
# Configure QuantLib to build only static library
echo "Configuring QuantLib for static library build..."
cmake .. \
-DENABLE_STATIC=ON \
-DENABLE_SHARED=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TEST_SUITE=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=./install
# Build QuantLib static library
echo "Building QuantLib static library..."
make -j$(nproc)
# Install the library
echo "Installing QuantLib static library..."
make install
echo "QuantLib static library compilation completed!"
echo "Library location: ./install/lib/libQuantLib.a"
echo "Headers location: ./install/include/"