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

Changed Makefile so opt forces the gnu17 standard #306

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

opt:
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-gcc -o bin/vplanet src/*.c -lm -O3 -std=gnu17 -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def run(self):
ext_modules=ext_modules,
cmdclass=cmdclass,
include_package_data=True,
data_files=[('', ['VERSION'])],
zip_safe=False,
entry_points={"console_scripts": ["vplanet=vplanet.wrapper:_entry_point"]},
)
Expand Down
21 changes: 18 additions & 3 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ void AddOptionDouble(char *cFile, char *cOption, double *dInput, int *iLine,

GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
sscanf(cLine, "%s %lf", cTmp, dInput);
int iNumOptionsRead = sscanf(cLine, "%s %lf", cTmp, dInput);
if (iNumOptionsRead != 2) {
printf("ERROR: %d arguments read for option %s.\n",iNumOptionsRead,cOption);
printf("\tcLine=%s, cTmp=%s, dInput=%lf\n", cLine, cTmp, *dInput );
exit(EXIT_INPUT);
}
}
free(cLine);
}
Expand All @@ -354,7 +359,12 @@ void AddOptionInt(char *cFile, char *cOption, int *iInput, int *iLine,

GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
sscanf(cLine, "%s %d", cTmp, iInput);
int iNumOptionsRead = sscanf(cLine, "%s %d", cTmp, iInput);
if (iNumOptionsRead != 2) {
printf("ERROR: %d arguments read for option %s.\n",iNumOptionsRead,cOption);
printf("\tcLine=%s, cTmp=%s, dInput=%d\n", cLine, cTmp, *iInput );
exit(EXIT_INPUT);
}
}
free(cLine);
}
Expand Down Expand Up @@ -384,7 +394,12 @@ void AddOptionString(char *cFile, char *cOption, char cInput[], int *iLine,

GetLine(cFile, cOption, &cLine, iLine, iVerbose);
if (*iLine >= 0) {
sscanf(cLine, "%s %s", cTmp, cInput);
int iNumOptionsRead = sscanf(cLine, "%s %s", cTmp, cInput);
if (iNumOptionsRead != 2) {
printf("ERROR: %d arguments read for option %s.\n",iNumOptionsRead,cOption);
printf("\tcLine=%s, cTmp=%s, dInput=%s\n", cLine, cTmp, cInput );
exit(EXIT_INPUT);
}
}
free(cLine);
}
Expand Down
Loading