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

Native Windows 64-bit Build Error #4360

Closed
quinnj opened this issue Sep 24, 2013 · 13 comments
Closed

Native Windows 64-bit Build Error #4360

quinnj opened this issue Sep 24, 2013 · 13 comments

Comments

@quinnj
Copy link
Member

quinnj commented Sep 24, 2013

I've tried to rebuild a few times today (doing make clean, make cleanall, and finally wiping everything and building from scratch) and I've run into this same problem each time.

Windows 8, 64-bit, using msys2 (note that I'm using the 9/9 release of msys2 that I've already used to build correctly which seems to suggest something on the julia side has changed).

    CC src/codegen.o
In file included from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\x8
6_64-w64-mingw32\bits\gthr-default.h:35:0,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\x8
6_64-w64-mingw32\bits\gthr.h:148,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ex
t\atomicity.h:33,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bi
ts\ios_base.h:39,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\io
s:42,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\os
tream:38,
                 from c:\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\it
erator:64,
                 from C:/Users/karbarcca/julia/deps/llvm-3.3/include/llvm/ADT/De
nseMap.h:28,
                 from C:/Users/karbarcca/julia/deps/llvm-3.3/include/llvm/Execut
ionEngine/ExecutionEngine.h:19,
                 from codegen.cpp:23:
julia.h:852:22: error: expected unqualified-id before '{' token
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: expected ')' before '{' token
julia.h:852:22: error: expected primary-expression before 'struct'
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: expected '}' before 'struct'
julia.h:852:22: error: expected constructor, destructor, or type conversion befo
re ';' token
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: '___tmp_tm' does not name a type
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: expected unqualified-id before 'if'
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: '___tmp_tm' does not name a type
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
julia.h:852:22: error: expected unqualified-id before ')' token
 DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
                      ^
codegen.cpp:100:1: error: expected declaration before '}' token
 }
 ^
Makefile:50: recipe for target 'codegen.o' failed
make[2]: *** [codegen.o] Error 1
Makefile:45: recipe for target 'julia-release' failed
make[1]: *** [julia-release] Error 2
Makefile:34: recipe for target 'release' failed
make: *** [release] Error 2

C:\Users\karbarcca\julia>
@quinnj
Copy link
Member Author

quinnj commented Sep 25, 2013

Commenting out the line in question allows me to build:

/*#ifdef _OS_WINDOWS_
DLLEXPORT struct tm* localtime_r(const time_t *t, struct tm *tm);
#endif*/

julia.h:851:853

@ihnorton
Copy link
Member

I saw this over the weekend, and I believe it was fixed by switching to mingw with win32 rather than posix style threads (but it's a bit blurry because there were a lot of permutations of 32 and 64 bit builds..).

FWIW, I don't get this error on a fresh checkout with this mingw and msys 0909.

@quinnj
Copy link
Member Author

quinnj commented Sep 25, 2013

Ah, that makes sense. I replaced my mingw recently and wasn't sure if I should do posix or win32 style. I'll look into switching back (maybe we should have a note about this in the readme?)

@ihnorton
Copy link
Member

Yeah, i added the note to the build errata in the windows readme already :)

@ihnorton
Copy link
Member

I would recommend to go back to the 0828 msys2. I have had nothing but trouble with the 0909 build (bad relocation addresses, out of memory and unable to fork, other misc. things). I finally just got a clean build with 0828 and mingw- gcc4.8.1, x64, win32-threads, seh. the only stop was to touch deps/pcre-8.31/checked

@Keno
Copy link
Member

Keno commented Sep 25, 2013

@ihnorton, maybe @Alexpux can help you out with that.

@Alexpux
Copy link

Alexpux commented Sep 25, 2013

@ihnorton what problems you have with latest MSYS2?

About fork you can try to rebase dlls. Do next steps:

  • close MSYS
  • remove from MSYS\etc\rebase.db.*
  • open windows cmd
  • cd to MSYS\bin
  • run: dash /bin/rebaseall -v > rebase.log 2>&1
    Then open rebase.log and see at first lines is all dll rebased or maybe some needed to remove attribute readonly.

P.S.: mingw-builds project now merging into mingw-w64 project. Temporarly our new tolchains are located here:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/
Today I plan to upload new toolchains based on last stable mingw-w64 runtime v3 with suffix "rev2".
In near future we create new location for our toolchains because now they are official toolchains from mingw-w64 team.

Regards,
Alexey.

@ihnorton
Copy link
Member

@Alexpux thanks, unfortunately I don't have an exact answer, which is why I have not filed a bug yet. If I had to guess, it seems like an error in process control. I ran out of RAM during one make -j4 build on 16 GB ram computer, everything froze, and eventually got BSOD (one of the few I have ever seen on Win 7). In other attempts I got 'bad relocation address 0x0' when trying to link, or huge list of missing symbols. Exact same steps on 0828 msys2 worked without a problem (same mingw-64 version). Now that I have a working build with 0828 as a baseline, I will try to debug and send more information.

@quinnj
Copy link
Member Author

quinnj commented Sep 25, 2013

I'm now running the new mingw64 Alexey posted above with the 9/9 msys2 and everything seems to be working fine. Thanks for the help @ihnorton.

@quinnj quinnj closed this as completed Sep 25, 2013
@quinnj
Copy link
Member Author

quinnj commented Sep 25, 2013

Hey @Alexpux, could you help me?
I've been running into subtle bugs since switching to msys2 because of a weird path issue. For example,

julia> Pkg.add("DataFrames")
INFO: Cloning cache of DataFrames from git://github.com/JuliaStats/DataFrames.jl.git
/cygdrive/c/Users/karbarcca/AppData/Roaming/Julia/packages/C:\Users\karbarcca\AppData\Roaming\Julia\packages\.cache\DataFrames: No such file or directory
ERROR: failed process: Process(`git clone -q --mirror git://github.com/JuliaStats/DataFrames.jl.git 'C:\Users\karbarcca\AppData\Roaming\Julia\packages\.cache\DataFrames'`, ProcessExited(1)) [1]
 in error at error.jl:22

Notice the cygdrive before /c/ in the path. Somehow, this is messing up some kind of global path and I'm not familiar with cygwin at all and am not sure where to look or what to change. I think you've mentioned something about changing a profile somewhere? If you could give me a few pointers on where to look and what to change I'd appreciate the quick tutorial.

@Alexpux
Copy link

Alexpux commented Sep 25, 2013

To remove /cygdrive prefix you need to add next line to MSYS2 /etc/fstab:
none / cygdrive binary,posix=0,noacl,user 0 0
But it added automatically when first start of MSYS2. I think something wrong with your installation.

About git: maybe you use Windows git instead of MSYS2 git?

@quinnj
Copy link
Member Author

quinnj commented Sep 25, 2013

It looks like that's already in my file

# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# DO NOT REMOVE NEXT LINE. It remove cygdrive prefix from path
none / cygdrive binary,posix=0,noacl,user 0 0

I'll look into using windows git instead.

@ihnorton
Copy link
Member

@karbarcca interesting, that is good news. I have also seen git issues, so I usually rename mingw git.exe -> _git.exe (I have windows git in my system path).

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

4 participants