Created
December 26, 2018 00:24
-
-
Save YenForYang/c322ba0a82c98855dc0f9d7f1fa2884e to your computer and use it in GitHub Desktop.
icc wrapper (`icc -E`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<unistd.h> | |
extern char **environ; | |
int main(int argc, char **argv) { | |
char *args[argc+2]; | |
args[0] = "icc"; | |
args[1] = "-E"; | |
args[argc+1] = 0; | |
if (argc > 1) { | |
for (int a = argc-2; a >= 0; --a) { | |
args[a+2] = argv[a+1]; | |
} | |
} | |
// printf("%s %s %s",args[0],args[1],args[2]); | |
// hardcode icc path for now | |
execve("/opt/intel/compilers_and_libraries/linux/pkg_bin/intel64/icc",args,environ); | |
// FOR DEBUGGING: | |
// perror("Could not execve"); | |
// FOR PRINTING ENVIRONMENT (TESTING/DEBUGGING): | |
// for (char **env = environ; *env != 0; env++) { | |
// printf("%s\n", *env); | |
// } | |
// return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment