Skip to content

PAR Programs Missing from Both Compilation and suhelp Output Due to Source Reorganization #190

@Dai411

Description

@Dai411

Core Problems

  1. Uncompiled Source Files: Many PAR program .c files exist in source tree (e.g., src/par/main/velocity_perturbation/velpert.c) but aren't compiled to $CWPROOT/bin/
  2. Broken suhelp Detection: The help command fails to list PAR programs due to outdated source file lookup

Detailed Findings

1. Compilation Issues:

  • Verified missing programs (e.g., velpert) have source files:
    find src/par -name velpert.c 
    # → src/par/main/velocity_perturbation/velpert.c
  • These programs don't appear in $CWPROOT/bin/ after standard installation
  • Manual compilation works:
    cd src/par/main/velocity_perturbation
    make  # Successfully creates velpert in bin/

More details can be found in this document:
missed_commands.md

2. suhelp Problems:

  • Current output shows error instead of program list:
    PAR PROGRAMS: (programs with self-documentation)
    ls: cannot access '*.c': No such file or directory
    
  • Root cause: Script looks for .c files only in flat directory ($PAR/main/*.c) while sources now live in subfolders

3. Connection Between Issues:

  • The compilation system and help system share the same broken assumption about source file locations
  • Both need updating to understand the new subdirectory structure

Expected Behavior

  1. Compilation: All PAR programs in src/par/main/ and subdirectories should compile during installation
  2. Help System: suhelp should display all available PAR programs

Suggested Fixes

For Compilation:

# Proposed change to Makefile:
# Recursively compile all .c files in par/main/
PAR_PROGS := $(shell find par/main -name '*.c' | sed 's/\.c//')

For suhelp:

# Change to recursively find programs
find $PAR/main -name "*.c" | sed 's|.*/||;s/\.c$//'

Impact Analysis

This affects:

  • All users installing from source
  • Anyone relying on suhelp for program discovery
  • Particularly impacts programs like velpert in subdirectories

Supporting Evidence

Test case with velpert:

  1. Source exists: ✅ src/par/main/velocity_perturbation/velpert.c
  2. Not compiled by default: ❌ Missing in $CWPROOT/bin/
  3. Manually compilable: ✅ make in source directory works
  4. suhelp broken: ❌ Can't detect even after manual compilation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions