gtcasl / gpuocelot

GPUOCelot: A dynamic compilation framework for PTX
http://gpuocelot.gatech.edu/
BSD 3-Clause "New" or "Revised" License
280 stars 69 forks source link

LLVM error when using glut: Assertion "Option already exists!" failed. #85

Open jwang323 opened 9 years ago

jwang323 commented 9 years ago

From max.m...@dameweb.de on June 19, 2013 09:59:17

What steps will reproduce the problem? 1. Take the following code:

include <GL/glut.h>

include

void display(void){

}

int main(int argc, char\ argv){ printf("a\n"); glutInit(&argc, argv); printf("b\n"); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); printf("c\n"); glutInitWindowSize(100, 100); printf("d\n"); glutInitWindowPosition(100, 100); printf("e\n"); glutCreateWindow("test"); printf("f\n"); glutDisplayFunc(display); printf("g\n"); glutMainLoop(); return 0; }

  1. Compile and run it once without and once with linking to ocelot: gcc -c main.cpp && gcc -o main main.o -lglut -lstdc++ && ./main gcc -c main.cpp && gcc -o main main.o -locelot -lglut -lstdc++ && ./main
  2. Look at the console output. What is the expected output? What do you see instead? When I run the program not linked to ocelot, it outputs the following: ./main a b c d e f g

When I run the program linked to ocelot, it breaks: ./main a b c d e main: /build/src/llvm- ce7bbb8b46abd1aef80dff50bd73315719e1f8bb /include/llvm/Support/CommandLine.h:646: void llvm::cl::parser::addLiteralOption(const char, const DT&, const char) [with DT = llvm::FunctionPass* ()(); DataType = llvm::FunctionPass ()()]: Assertion `findOption(Name) == Values.size() && "Option already exists!"' failed. make: ** [run] Aborted (core dumped) What version of the product are you using? On what operating system? The program was compiled under Arch Linux with all current upgrades, LLVM 3.3-1, gpuocelot r2235 , freeglut 2.8.1 and mesa 9.1.3. Please provide any additional information below. When compiling with nvcc or when testing the CUDA code samples (e.g. simpleGL), the same error appears. The same error appears as well under Ubuntu 11.04 with completely different library versions (gpuocelot was r2235 as well).

Original issue: http://code.google.com/p/gpuocelot/issues/detail?id=86