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

[SPEX] Add builder #5504

Merged
merged 13 commits into from
Sep 17, 2022
Merged

[SPEX] Add builder #5504

merged 13 commits into from
Sep 17, 2022

Conversation

rayegun
Copy link
Contributor

@rayegun rayegun commented Sep 15, 2022

Not sure if the copying is done correctly. The makefile relies on being part of SuiteSparse, but it isn't currently set up that way.

@rayegun
Copy link
Contributor Author

rayegun commented Sep 15, 2022

@giordano any idea why those dependencies are not found only on Windows? They're definitely there.

@giordano
Copy link
Member

In https://dev.azure.com/JuliaPackaging/Yggdrasil/_build/results?buildId=22238&view=logs&j=da726748-225d-55bd-4026-a890e36e8df0&t=3510b2f7-4741-5032-84a1-25c6f19f1e85&l=207 I don't see -L${libdir} (with libdir expanded, of course),which explains the linking error. I didn't look at the build system, I don't know what's different from other systems.

@rayegun
Copy link
Contributor Author

rayegun commented Sep 15, 2022

/opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: /opt/x86_64-w64-mingw32/bin/../x86_64-w64-mingw32/sys-root/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
/workspace/srcdir/mingw-w64-v7.0.0/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:72: /workspace/srcdir/SPEX/lib/libspexutil.1.1.0.dll] Error 1

Hmm this is a shared lib, why would there be a main?

@giordano
Copy link
Member

#5425 (comment)

@rayegun
Copy link
Contributor Author

rayegun commented Sep 15, 2022

Apologies. The invocation is

ranlib libspexutil.lib
cc  -L/workspace/destdir/bin -L/workspace/destdir/lib -L/workspace/destdir/lib -L/workspace/srcdir/SPEX/lib SPEX_matrix_div.o spex_create_mpq_array.o SPEX_free.o SPEX_realloc.o SPEX_matrix_mul.o spex_create_mpz_array.o SPEX_cumsum.o SPEX_malloc.o spex_sparse_collapse.o SPEX_calloc.o SPEX_matrix_allocate.o spex_sparse_realloc.o spex_cast_array.o spex_create_mpfr_array.o spex_expand_double_array.o SPEX_gmp.o SPEX_matrix_copy.o SPEX_matrix_check.o spex_cast_matrix.o spex_expand_mpfr_array.o SPEX_initialize.o SPEX_matrix_free.o SPEX_check_solution.o SPEX_finalize.o spex_expand_mpq_array.o SPEX_initialize_expert.o SPEX_matrix_nnz.o SPEX_create_default_options.o SPEX_LU_analysis_free.o SPEX_LU_analyze.o -o /workspace/srcdir/SPEX/lib/libspexutil.1.1.0.dll -lm -lsuitesparseconfig -lamd -lcolamd -lm -lgmp -lmpfr
/opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: /opt/x86_64-w64-mingw32/bin/../x86_64-w64-mingw32/sys-root/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
/workspace/srcdir/mingw-w64-v7.0.0/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'

Which is definitely missing -shared.

The suspect line of the makefile I believe is:

$(AR_TARGET): $(OBJ)
	$(ARCHIVE) $@ $^
	- $(RANLIB) $(AR_TARGET)

I don't believe this was ever tested on Windows, so I'm expecting to patch this Makefile quite a bit.

@rayegun
Copy link
Contributor Author

rayegun commented Sep 15, 2022

Ah no that's not correct. The Makefile command that is called is:

$(INSTALL_LIB)/$(SO_TARGET): $(OBJ)
	@mkdir -p $(INSTALL_LIB)
	@mkdir -p $(INSTALL_INCLUDE)
	@mkdir -p $(INSTALL_DOC)
	$(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS)
	( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) )
	( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) )
	$(CP) ../Include/SPEX_Util.h $(INSTALL_INCLUDE)
	chmod 644 $(INSTALL_INCLUDE)/SPEX_Util.h

I believe there are significant structural issues with the Makefile that I'll bring up with Tim.

@giordano
Copy link
Member

The suspect line of the makefile I believe is:

You don't have to suspect, when make fails it tells you exactly which target, which line, in which file, it was trying to run 😉

S/SPEX/build_tarballs.jl Outdated Show resolved Hide resolved
S/SPEX/build_tarballs.jl Outdated Show resolved Hide resolved
@rayegun rayegun requested a review from giordano September 16, 2022 19:34
S/SPEX/build_tarballs.jl Outdated Show resolved Hide resolved
Co-authored-by: Mosè Giordano <[email protected]>
@rayegun
Copy link
Contributor Author

rayegun commented Sep 16, 2022

Hmm should I relax the MPFR version then? Those are the versions Julia should use I think, which should make those jll's compatible?

@rayegun
Copy link
Contributor Author

rayegun commented Sep 17, 2022

@giordano these are not the same version numbers from the Julia repo "fake" jlls. Are they still acceptable?

@giordano giordano merged commit 3f9ce08 into JuliaPackaging:master Sep 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants