Files
Mini-Nav/.envrc
SikongJueluo e7765cdb76 refactor(build): consolidate CAM test commands under new make targets
- .envrc: add conda compiler flags (CFLAGS, CXXFLAGS, LDFLAGS) for zlib support
- .justfile: replace inline make commands with reusable targets (test-top, test-all, test-model, test-module)
- environment.yml: reformat YAML, add zlib/gtkwave, rename withbullet → with_bullet
2026-05-16 19:57:34 +08:00

46 lines
1.5 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
export DIRENV_WARN_TIMEOUT=20s
# 尝试加载 devenv 的 direnv 配置
if command -v devenv >/dev/null 2>&1; then
# 如果存在 devenv
eval "$(devenv direnvrc)"
# `use devenv` 支持和 `devenv shell` 相同的选项
# 示例use devenv --quiet --impure --option services.postgres.enable:bool true
use devenv
else
# 如果不存在 devenv则加载自己的 fallback 配置
echo "devenv not found, loading fallback configuration..."
export UV_PROJECT_ENVIRONMENT="/home/ial-pangyg/workspace/envs/mini-nav"
export MY_DEV_ENV=1
layout_mamba() {
# initialize micromamba
eval "$(micromamba shell hook --shell=bash)"
# check if environment name is specified
if [ -n "$1" ]; then
# Explicit environment name from layout command.
local env_name="$1"
# activate environment
micromamba activate ${env_name}
elif (grep -q name: environment.yml 2> /dev/null); then
# Detect environment name from `environment.yml` file in `.envrc` directory
micromamba activate `grep name: environment.yml | sed -e 's/name: //'`
else
# if all else fails, activate base environment
micromamba activate base;
fi;
}
layout mamba
# Static Link Libraries
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
export CFLAGS="-I$CONDA_PREFIX/include"
export CXXFLAGS="-I$CONDA_PREFIX/include"
export LDFLAGS="-L$CONDA_PREFIX/lib -Wl,-rpath,$CONDA_PREFIX/lib -lz"
fi