Skip to content

⚡ DEPENDENCY CHEAT SHEET - AUDIOLAB

Quick Reference de Comandos de Dependencias

Bookmarkea esta página para consultas rápidas


📋 TABLA DE CONTENIDOS

  1. Scripts AudioLab
  2. vcpkg Commands
  3. Python/pip Commands
  4. CMake Integration
  5. Registry Management
  6. Troubleshooting Quick Fixes

🔧 SCRIPTS AUDIOLAB

Installation Scripts

# INSTALACIÓN COMPLETA (primera vez)
./03_03_01_installation_scripts/install_all_dependencies.ps1    # Windows
./03_03_01_installation_scripts/install_all_dependencies.sh     # Unix/macOS

# INSTALACIÓN CORE (solo esenciales, más rápido)
./03_03_01_installation_scripts/install_core_deps.ps1          # Windows

# VERIFICAR INSTALACIÓN
./03_03_01_installation_scripts/verify_installation.ps1         # Windows
./03_03_01_installation_scripts/verify_installation.sh          # Unix/macOS

# LISTAR INSTALADOS
./03_03_01_installation_scripts/list_installed.ps1             # Windows

# ACTUALIZAR REGISTRY
./03_03_01_installation_scripts/update_registry.ps1            # Windows

Maintenance Scripts

# ACTUALIZAR DEPENDENCIAS
./03_03_03_maintenance_scripts/update_dependencies.ps1

# LIMPIAR DEPENDENCIAS
./03_03_03_maintenance_scripts/clean_dependencies.ps1

# AUDIT SEGURIDAD
./03_03_03_maintenance_scripts/check_security.ps1

License Management

# GENERAR ATTRIBUTIONS
./03_03_04_license_management/generate_attributions.ps1        # Windows
./03_03_04_license_management/generate_attributions.sh         # Unix/macOS

# Output: THIRD_PARTY_LICENSES.md

📦 VCPKG COMMANDS

Basic Commands

# LISTAR INSTALADOS
vcpkg list

# BUSCAR PACKAGES
vcpkg search <nombre>
vcpkg search fft          # Buscar FFT libraries

# INSTALAR PACKAGE
vcpkg install <package>:x64-windows
vcpkg install fftw3:x64-windows

# DESINSTALAR PACKAGE
vcpkg remove <package>:x64-windows
vcpkg remove fftw3:x64-windows

# ACTUALIZAR vcpkg
cd external/vcpkg
git pull
./bootstrap-vcpkg.bat     # Windows
./bootstrap-vcpkg.sh      # Unix/macOS

# ACTUALIZAR PACKAGES
vcpkg update              # Ver disponibles
vcpkg upgrade --no-dry-run   # Actualizar todos

Advanced Commands

# INSTALAR CON FEATURES
vcpkg install opencv[contrib]:x64-windows

# VER INFO DE PACKAGE
vcpkg info fftw3

# LISTAR TRIPLETS DISPONIBLES
vcpkg help triplet

# CLEAN PACKAGES
vcpkg remove --outdated

Triplets Comunes

# Windows
x64-windows              # Dynamic linking (default)
x64-windows-static       # Static linking
arm64-windows            # ARM64 architecture

# Linux
x64-linux
arm64-linux

# macOS
x64-osx
arm64-osx

vcpkg Manifest Mode

# USAR vcpkg.json (manifest mode)
cd project-root

# vcpkg automáticamente instala de vcpkg.json
cmake -S . -B build \
      -DCMAKE_TOOLCHAIN_FILE=external/vcpkg/scripts/buildsystems/vcpkg.cmake

# AGREGAR DEPENDENCY a vcpkg.json
# Editar manualmente vcpkg.json, luego:
cmake -S . -B build  # Reinstala automáticamente

🐍 PYTHON/PIP COMMANDS

Basic Commands

# LISTAR INSTALADOS
pip list

# BUSCAR PACKAGES
pip search <nombre>

# INSTALAR PACKAGE
pip install <package>
pip install black>=23.0.0

# DESINSTALAR PACKAGE
pip uninstall <package>

# ACTUALIZAR PACKAGE
pip install --upgrade <package>

# INSTALAR DESDE requirements.txt
pip install -r requirements.txt

# GENERAR requirements.txt
pip freeze > requirements.txt

Virtual Environments

# CREAR VENV
python -m venv venv

# ACTIVAR VENV
venv\Scripts\activate       # Windows
source venv/bin/activate    # Unix/macOS

# DESACTIVAR
deactivate

# INSTALAR EN VENV
pip install -r requirements.txt

🔨 CMAKE INTEGRATION

Find Packages

# FIND PACKAGE (básico)
find_package(JUCE REQUIRED)
find_package(FFTW3 REQUIRED)

# FIND PACKAGE (con componentes)
find_package(Boost REQUIRED COMPONENTS system filesystem)

# FIND PACKAGE (con versión)
find_package(JUCE 7.0.0 REQUIRED)

# CHECK SI ENCONTRÓ
if(JUCE_FOUND)
    message(STATUS "JUCE found: ${JUCE_VERSION}")
endif()
# LINK CONTRA LIBRARY
target_link_libraries(my_target PRIVATE JUCE::JUCE)
target_link_libraries(my_target PRIVATE FFTW3::fftw3)

# LINK MÚLTIPLES
target_link_libraries(my_target
    PRIVATE
        JUCE::JUCE
        FFTW3::fftw3
        Eigen3::Eigen
)

Include Directories

# INCLUDE DIRECTORIES (target-based, recomendado)
target_include_directories(my_target
    PRIVATE
        ${JUCE_INCLUDE_DIRS}
        ${FFTW3_INCLUDE_DIRS}
)

# O usar imported targets (mejor)
target_link_libraries(my_target PRIVATE JUCE::JUCE)  # Auto-includes

vcpkg Toolchain

# CONFIGURE CON TOOLCHAIN
cmake -S . -B build \
      -DCMAKE_TOOLCHAIN_FILE=external/vcpkg/scripts/buildsystems/vcpkg.cmake

# O EN CMakePresets.json
{
  "cacheVariables": {
    "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/external/vcpkg/scripts/buildsystems/vcpkg.cmake"
  }
}

Debug FindPackage

# VER QUÉ BUSCA CMAKE
cmake -S . -B build --debug-find

# DEBUG PACKAGE ESPECÍFICO
cmake -S . -B build --debug-find-pkg=JUCE

# VER CMAKE_PREFIX_PATH
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/libs

📋 REGISTRY MANAGEMENT

Registry Structure

_installed_registry/
├── vcpkg/
│   ├── fftw3.yaml
│   ├── eigen3.yaml
│   └── ...
├── python/
│   ├── black.yaml
│   └── ...
└── vendored/
    └── juce.yaml

Registry Commands

# ACTUALIZAR REGISTRY
./03_03_01_installation_scripts/update_registry.ps1

# VER REGISTRY
ls 03_03_00_package_manifests/_installed_registry/vcpkg/
cat 03_03_00_package_manifests/_installed_registry/vcpkg/fftw3.yaml

# COMMIT REGISTRY (después de cambios)
git add 03_03_00_package_manifests/_installed_registry/
git commit -m "Update dependency registry"

Registry File Format (YAML)

# Ejemplo: fftw3.yaml
name: fftw3
version: "3.3.10"
category: DSP
installed_date: "2025-10-09"
location: "C:/vcpkg/installed/x64-windows"
status: installed
triplet: x64-windows

🚨 TROUBLESHOOTING QUICK FIXES

"vcpkg: command not found"

# Verificar PATH
where vcpkg          # Windows
which vcpkg          # Unix/macOS

# O usar path completo
./external/vcpkg/vcpkg.exe list

# Instalar vcpkg
./03_03_01_installation_scripts/install_all_dependencies.ps1

"CMake can't find package"

# SOLUCIÓN 1: Usar toolchain
cmake -DCMAKE_TOOLCHAIN_FILE=external/vcpkg/scripts/buildsystems/vcpkg.cmake

# SOLUCIÓN 2: Set CMAKE_PREFIX_PATH
cmake -DCMAKE_PREFIX_PATH=/path/to/vcpkg/installed/x64-windows

# SOLUCIÓN 3: Verificar que esté instalado
vcpkg list | grep <package>

# SOLUCIÓN 4: Verificar triplet
vcpkg list          # Ver qué triplet está instalado
# Si es x64-windows-static pero CMake busca x64-windows:
vcpkg remove <package>:x64-windows-static
vcpkg install <package>:x64-windows

"Download failed / Network error"

# OPCIÓN 1: Configurar proxy
set HTTP_PROXY=http://proxy:8080      # Windows
export HTTP_PROXY=http://proxy:8080   # Unix

# OPCIÓN 2: Retry con clean
vcpkg remove <package>
vcpkg install <package> --clean-after-build

# OPCIÓN 3: Usar binary cache
vcpkg install <package> --binarysource=clear

"Version conflict"

# Limpiar y reinstalar
vcpkg remove <package>:x64-windows
vcpkg install <package>:x64-windows

# Actualizar registry
./03_03_01_installation_scripts/update_registry.ps1

# Rebuild CMake
rm -rf build
cmake -S . -B build

"Registry out of sync"

# Resincronizar registry con instalaciones reales
./03_03_01_installation_scripts/update_registry.ps1

# Verificar
./03_03_01_installation_scripts/list_installed.ps1

"Permission denied"

# Windows: Ejecutar PowerShell como Admin
# Unix/macOS: Hacer ejecutable
chmod +x *.sh

# O usar sudo si necesario (no recomendado)
sudo ./install_all_dependencies.sh

📚 DEPENDENCY LIST

vcpkg Packages (7)

vcpkg install fftw3:x64-windows          # FFT library
vcpkg install eigen3:x64-windows         # Linear algebra
vcpkg install libsndfile:x64-windows     # Audio I/O
vcpkg install catch2:x64-windows         # Testing
vcpkg install benchmark:x64-windows      # Benchmarking
vcpkg install fmt:x64-windows            # Formatting
vcpkg install spdlog:x64-windows         # Logging

Python Tools (3)

pip install black>=23.0.0                # Formatter
pip install pytest>=7.0.0                # Testing
pip install sphinx>=7.0.0                # Docs

Vendored (1)

JUCE 7.0.9 - Audio plugin framework
Location: 03_03_05_vendoring/juce/

🎯 COMMON WORKFLOWS

First-Time Setup

# 1. Install all
./03_03_01_installation_scripts/install_all_dependencies.ps1

# 2. Verify
./03_03_01_installation_scripts/verify_installation.ps1

# 3. Build project
cd ../../03_02_build_infrastructure/03_02_03_build_scripts
./build.ps1

Add New Dependency

# 1. Install
vcpkg install new-lib:x64-windows

# 2. Update registry
./03_03_01_installation_scripts/update_registry.ps1

# 3. Add to CMake
# Edit: 03_03_02_cmake_integration/Dependencies.cmake
find_package(NewLib REQUIRED)

# 4. Link in your CMakeLists.txt
target_link_libraries(my_target PRIVATE NewLib::NewLib)

# 5. Commit
git add vcpkg.json _installed_registry/
git commit -m "Add new-lib dependency"

Update Dependencies

# 1. Update vcpkg
cd external/vcpkg
git pull
./bootstrap-vcpkg.bat

# 2. Update packages
vcpkg upgrade --no-dry-run

# 3. Update registry
./03_03_01_installation_scripts/update_registry.ps1

# 4. Verify
./03_03_01_installation_scripts/verify_installation.ps1

# 5. Test build
cd ../../03_02_build_infrastructure/03_02_03_build_scripts
./build.ps1

Clean Reinstall

# 1. Clean
./03_03_03_maintenance_scripts/clean_dependencies.ps1

# 2. Reinstall
./03_03_01_installation_scripts/install_all_dependencies.ps1

# 3. Verify
./03_03_01_installation_scripts/verify_installation.ps1

📖 MÁS INFORMACIÓN


💡 TIP: Imprime esta página o guárdala como PDF para referencia rápida.

Última actualización: 2025-10-09