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

Adjust gcc runtime library handling in windows build #20152

Merged
merged 4 commits into from
Jan 21, 2017
Merged

Conversation

tkelman
Copy link
Contributor

@tkelman tkelman commented Jan 20, 2017

I keep going back and forth on this. This is going back to using the opensuse runtime libs (and adding libwinpthread since they've switched threading models), which might help with jump-dev/Ipopt.jl#77 but may also change at any moment which could suddenly break appveyor if nightlies pull in some ABI incompatibility...

downloading from opensuse to possibly work around winrpm issues for now
it's likely going to be fragile to use opensuse runtime libs with the
old cygwin toolchain, will have to see
@tkelman tkelman added building Build system, or building Julia or its dependencies system:windows Affects only Windows labels Jan 20, 2017
@tkelman tkelman changed the title Adjust gcc runtime library handling Adjust gcc runtime library handling in windows build Jan 20, 2017
this should support fractional sleep now
@vchuravy
Copy link
Member

Does OpenSuse 42.2 still provide GCC 4.9.2 compatibility? Looking at the repositories they seem to only provide 6.2.
They also provide a version of libatomic [1] and we should start to include that. This would allow us to revert #19647
and resolve atomics correctly on windows [2, 3].

[1] http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.2/noarch/mingw32-libatomic1-6.3.0-1.1.noarch.rpm
[2] #19123 (comment)
[3]

julia/src/jitlayers.cpp

Lines 313 to 327 in d3bac6e

#if defined(_OS_LINUX_)
// Resolve non-lock free atomic functions in the libatomic library.
// This is the library that provides support for c11/c++11 atomic operations.
static uint64_t resolve_atomic(const char *name)
{
static void *atomic_hdl = jl_load_dynamic_library_e("libatomic",
JL_RTLD_LOCAL);
static const char *const atomic_prefix = "__atomic_";
if (!atomic_hdl)
return 0;
if (strncmp(name, atomic_prefix, strlen(atomic_prefix)) != 0)
return 0;
return (uintptr_t)jl_dlsym_e(atomic_hdl, name);
}
#endif

@tkelman
Copy link
Contributor Author

tkelman commented Jan 21, 2017

They only provide 6.2, which is why this is sort of fragile. Until we fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77333 or fix libgmp's build system so clang can build it properly on windows, we will have to stick with cygwin's old 4.9.2 compiler in order for the buildbots to still be capable of building win32 julia correctly (ref #18162). So Julia and deps will continue to be built using cygwin's 4.9.2, but we're replacing the runtime dll's with those from opensuse so packages from winrpm work. This isn't guaranteed to work, we get somewhat lucky that it does. We actually had already been replacing the runtime dll's in the binaries with an older gcc 5 set from opensuse that I saved, rather than the latest version from opensuse which is subject to change over time.

@vchuravy
Copy link
Member

Yeah that's what I thought. So we can't depend on libatomic currently?

@tkelman
Copy link
Contributor Author

tkelman commented Jan 21, 2017

In what sense? We can't currently assume the compiler used to build Julia has libatomic, so we couldn't add it as a call to std_dll. We could add it to the list we call winrpm.sh on and put it in the binaries if it would serve some purpose to do so.

@tkelman
Copy link
Contributor Author

tkelman commented Jan 21, 2017

osx travis failure was #17626, appveyor failure was #19707

@tkelman tkelman merged commit 7d414a2 into master Jan 21, 2017
@tkelman tkelman deleted the tk/winrpm branch January 21, 2017 18:02
@huckl3b3rry87
Copy link

While the backport for 0.5 is pending, is there an easy manual fix for this issue?

@tkelman
Copy link
Contributor Author

tkelman commented Jan 31, 2017

Yeah, should be just copy the libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll libwinpthread-1.dll files from joinpath(WinRPM.installdir, "usr", Sys.MACHINE, "sys-root", "mingw", "bin") to JULIA_HOME. If you want to test JuliaPackaging/WinRPM.jl#97, that should do it automatically.

@zhengys18
Copy link

zhengys18 commented Jan 31, 2017

@tkelman this is @huckl3b3rry87 and I am trying to get some code to work on a labmates computer, but when I run https://github.com/JuliaPackaging/WinRPM.jl/pull/97/files I get
capture
Also, thank for the quick response!

@tkelman
Copy link
Contributor Author

tkelman commented Jan 31, 2017

I wasn't accounting for the possibility of that file not being there yet, thanks for testing! Try JuliaPackaging/WinRPM.jl@9bee07c

@zhengys18
Copy link

Thanks for the response! I downloaded the file from
https://osdn.net/projects/sfnet_sixtyfourbitcompiles/downloads/64bit/libwinpthread-1.dll/
Not sure if that is a sketchy site, but it works!

And I put it in the /bin.

Thanks!

@zhengys18
Copy link

zhengys18 commented Jan 31, 2017

I tried to delete the program and try your patch but after I deleted it when I start julia I get
capture2
It is working if I just put the program in /bin though

@tkelman
Copy link
Contributor Author

tkelman commented Jan 31, 2017

Delete the newer copies and rename the -copy backups to what they used to be. Or take them from a clean install of Julia.

tkelman added a commit that referenced this pull request Mar 1, 2017
tkelman added a commit that referenced this pull request Mar 1, 2017
downloading from opensuse to possibly work around winrpm issues for now
it's likely going to be fragile to use opensuse runtime libs with the
old cygwin toolchain, will have to see

(cherry picked from commit 986c103)
ref #20152
tkelman added a commit that referenced this pull request Mar 1, 2017
13.2 is ending support soon

(cherry picked from commit 022a60c)
ref #20152
tkelman added a commit that referenced this pull request Mar 1, 2017
this should support fractional sleep now

(cherry picked from commit c4f29fd)
ref #20152
@queueyong
Copy link

This fixes my problem. Now Ipopt is well working, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:windows Affects only Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants