Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update argp-standalone version in Makefile #82

Open
superbonaci opened this issue Sep 15, 2024 · 2 comments
Open

Update argp-standalone version in Makefile #82

superbonaci opened this issue Sep 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@superbonaci
Copy link

This is fixed by:

brew install argp-standalone
$ make
GCHS +++ include/drat/time.h +++ out/include/drat/time.gch
Created directory `out/include/drat`.
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/time.h" -o "out/include/drat/time.gch"

GCHS +++ include/drat/commands.h +++ out/include/drat/commands.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/commands.h" -o "out/include/drat/commands.gch"

GCHS +++ include/drat/globals.h +++ out/include/drat/globals.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/globals.h" -o "out/include/drat/globals.gch"

GCHS +++ include/drat/strings.h +++ out/include/drat/strings.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/strings.h" -o "out/include/drat/strings.gch"

GCHS +++ include/drat/io.h +++ out/include/drat/io.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/io.h" -o "out/include/drat/io.gch"

GCHS +++ include/drat/print-fs-records.h +++ out/include/drat/print-fs-records.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/print-fs-records.h" -o "out/include/drat/print-fs-records.gch"

GCHS +++ include/drat/asize.h +++ out/include/drat/asize.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/asize.h" -o "out/include/drat/asize.gch"

GCHS +++ include/drat/argp.h +++ out/include/drat/argp.gch
gcc -std=c99 -D _GNU_SOURCE -Werror -Wall -Wextra -Wno-incompatible-pointer-types -Wno-multichar -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -I./include -I/usr/local/Cellar/argp-standalone/1.3/include/ -c "include/drat/argp.h" -o "out/include/drat/argp.gch"
include/drat/argp.h:6:10: error: 'argp.h' file not found with <angled> include; use "quotes" instead
#include <argp.h>
         ^~~~~~~~
         "argp.h"
include/drat/argp.h:30:53: error: array has incomplete element type 'const struct argp_option'
extern const struct argp_option argp_options_globals[];
                                                    ^
include/drat/argp.h:30:21: note: forward declaration of 'struct argp_option'
extern const struct argp_option argp_options_globals[];
                    ^
include/drat/argp.h:31:1: error: unknown type name 'error_t'
error_t argp_parser_command(int key, char* arg, struct argp_state* state);
^
include/drat/argp.h:31:56: error: declaration of 'struct argp_state' will not be visible outside of this function [-Werror,-Wvisibility]
error_t argp_parser_command(int key, char* arg, struct argp_state* state);
                                                       ^
include/drat/argp.h:32:1: error: unknown type name 'error_t'
error_t argp_parser_globals(int key, char* arg, struct argp_state* state);
^
include/drat/argp.h:32:56: error: declaration of 'struct argp_state' will not be visible outside of this function [-Werror,-Wvisibility]
error_t argp_parser_globals(int key, char* arg, struct argp_state* state);
                                                       ^
include/drat/argp.h:35:45: error: array has incomplete element type 'const struct argp_child'
extern const struct argp_child argp_children[];
                                            ^
include/drat/argp.h:35:21: note: forward declaration of 'struct argp_child'
extern const struct argp_child argp_children[];
                    ^
7 errors generated.
make: *** [out/include/drat/argp.gch] Error 1
@superbonaci
Copy link
Author

The Makefile has to be updated to include the newest version:

### On macOS, include <argp.h> from Homebrew package `argp-standalone`
ifneq ($(OS),Windows_NT)
        ifeq ($(shell uname -s),Darwin)
                override CFLAGS  += -I/opt/homebrew/Cellar/argp-standalone/1.5.0/include/
                override LDFLAGS += -L/opt/homebrew/Cellar/argp-standalone/1.5.0/lib/ -largp
        endif
endif

Is is necessary to hardcode it into the Makefile?

@jivanpal
Copy link
Owner

The current maintainer of argp-standalone notes some issues with the old argp-standalone v1.3 that was provided via Homebrew at the time I released Drat v1.3, as mentioned here:

After noticing issues with executables built against argp-standalone 1.3, I decided to fork it and continue the effort.

As such, I will make your proposed change to the Makefile. I don't currently have a Mac to test on, and will only have access to an Intel Mac soon (this isn't a Silicon-specific issue anyway), but I'll try to see if there's a standard way to include argp-standalone 1.x on macOS rather than 1.3 or 1.5 specifically.

@jivanpal jivanpal moved this to Ready in Drat roadmap Sep 15, 2024
@jivanpal jivanpal added the bug Something isn't working label Sep 15, 2024
@jivanpal jivanpal changed the title [Apple Silicon] argp-standalone is required Update argp-standalone version in Makefile Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

2 participants