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

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

Open
jwang323 opened this issue Mar 29, 2015 · 0 comments
Open

Comments

@jwang323
Copy link
Contributor

From [email protected] 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant