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

Problems with gcc #38

Open
dhoegh opened this issue Jan 31, 2015 · 4 comments
Open

Problems with gcc #38

dhoegh opened this issue Jan 31, 2015 · 4 comments

Comments

@dhoegh
Copy link

dhoegh commented Jan 31, 2015

I am working on solving JuliaLang/julia#9973. The changes I am working on to close JuliaLang/julia#9973 can be found here: dhoegh/julia@a9bb795

During this I have bumped into some problems with mingw installed by WinRPM. It feels like the mingw build is somehow broke, here is my case. When I try to run the following command in windows cmd:

C:\Users\Hoegh\Julia-0.4.0-dev_19_1>C:\Users\Hoegh\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe -g -Wl,--no-as-needed -D_WIN32_WINNT=0x0600 -IC:\Users\Hoegh\Julia-0.4.0-dev_19_1\include\julia -IC:\Users\Hoegh\src -IC:\Users\Hoegh\src/support -IC:\Users\Hoegh\usr/include C:\Users\Hoegh\AppData\Local\Temp\jul268E.tmp\start_func.c -o C:\Users\Hoegh\Julia-0.4.0-dev_19_1\bin\eps_to_pdf.exe

It pops up with an error that states libgmp-10.dll is missing

If I add the bin folder in mingw to the path as suggested here http://stackoverflow.com/questions/6951938/libgmp-10-dll-is-missing I get:

C:\Users\Hoegh\Julia-0.4.0-dev_19_1>SET PATH=%PATH%;C:\Users\Hoegh\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin

C:\Users\Hoegh\Julia-0.4.0-dev_19_1>C:\Users\Hoegh\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe -g -Wl,--no-as-needed -D_WIN32_WINNT=0x0600 -IC:\Users\Hoegh\Julia-0.4.0-dev_19_1\include\julia -IC:\Users\Hoegh\src -IC:\Users\Hoegh\src/support -IC:\Users\Hoegh\usr/include C:\Users\Hoegh\AppData\Local\Temp\jul268E.tmp\start_func.c -o C:\Users\Hoegh\Julia-0.4.0-dev_19_1\bin\eps_to_pdf.exe
In file included from C:\Users\Hoegh\Julia-0.4.0-dev_19_1\include\julia/julia.h:10:0,
                 from C:\Users\Hoegh\AppData\Local\Temp\jul268E.tmp\start_func.c:1:
C:\Users\Hoegh\Julia-0.4.0-dev_19_1\include\julia/libsupport.h:6:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.

If I change to use the gcc registered in my path by Anaconda, then it builds succesfully. The gcc shipped with my Anaconda is: 4.7.0.

By looking at Anaconda's mingw I saw that the include folder where in the x86_64-w64-mingw32 folder and not in the sys-root\mingw folder so I tried to copy the include folder sys-root\\mingw\\include to sys-root\\mingw\\x86_64-w64-mingw32\\include and reran the command and it worked. However, this is kind of a hack and should not be necessary. I hope some of you have a deeper understanding of what could be wrong.

@tkelman
Copy link
Contributor

tkelman commented Feb 1, 2015

Nevermind, sys-root is already under an arch-specific folder. It looks like whatever they're doing to try to make the default include paths built into this gcc relocatable isn't working quite right. If you add -I to where the includes actually are, does it work? I don't that's too bad of a solution. We could contact the maintainers of the openSUSE mingw project and ask them about it, they're quite responsive to bug reports.

@dhoegh
Copy link
Author

dhoegh commented Feb 1, 2015

Thank you it did the trick. If some of the paths are wrong it could also explain why I need to set the path temporarily to the bin folder.

@tkelman
Copy link
Contributor

tkelman commented Jul 31, 2015

Breadcrumb: in using this opensuse-built gcc to compile Julia itself, I did have to create a link here https://github.com/JuliaLang/julia/blob/398cea6e875c3acfc813badac270d9312b5a12ca/contrib/windows/get_toolchain.sh#L56 from sys-root/mingw/include to sys-root/mingw/x86_64-w64-mingw32/include. Still kind of a hack, but seems to work.

@lucatrv
Copy link
Contributor

lucatrv commented Nov 19, 2017

This issue is still open, a workaround is to run:

gcc -I$(Pkg.dir("WinRPM", "deps", "usr", "$(Sys.ARCH)-w64-mingw32", "sys-root", "mingw", "include"))

Where should this issue be reported?

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

No branches or pull requests

3 participants