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

cython_aliases: Use ecl-config to determine compiler/linker flags for ecl #30770

Closed
mkoeppe opened this issue Oct 15, 2020 · 52 comments
Closed

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 15, 2020

We use ecl-config to determine compiler/linker flags for ecl. This is a step towards using a system-installed ecl and is needed/helpful for installing sage in virtual environments (#30371).

$ ecl-config --help
Usage: /usr/local/bin/ecl-config [OPTIONS] [LIBS]
Options: 
	[--cflags]
	[--libs|--ldflags]
Libs:
	cmp

Sample output:

> ./local/bin/ecl-config --cflags --libs
-Dlinux   -I/mnt/d/Programming/sage/local/include
-Wl,--rpath,/mnt/d/Programming/sage/local/lib -L/mnt/d/Programming/sage/local/lib -lecl -Wl,-rpath-link,/mnt/d/Programming/sage/local/lib -L/mnt/d/Programming/sage/local/lib -Wl,-rpath,/mnt/d/Programming/sage/local/lib      -ldl -lm

CC: @dimpase @orlitzky @spaghettisalat @jhpalmieri @tobiasdiez @isuruf @kiwifb @antonio-rojas

Component: build

Keywords: sd111

Author: Tobias Diez, Matthias Koeppe

Branch: 11ad40a

Reviewer: Matthias Koeppe, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/30770

@mkoeppe mkoeppe added this to the sage-9.2 milestone Oct 15, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 1, 2020

comment:2

Ideally, of course, ecl would install a pkg-config module...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 6, 2020

comment:3

Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 6, 2020

Changed keywords from none to sd111

@tobiasdiez
Copy link
Contributor

Commit: 3049e53

@tobiasdiez

This comment has been minimized.

@tobiasdiez
Copy link
Contributor

Branch: public/build/ecl-config

@tobiasdiez
Copy link
Contributor

Author: Tobias Diez

@tobiasdiez
Copy link
Contributor

comment:6

The following is working for me (in the context of #30371).


New commits:

3049e53Use ecl-config to determine compiler/linker flags for ecl

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 11, 2021

comment:7

Following the conventions of autoconf, this variable should be called ECL_CONFIG, not ECL_CONFIG_PATH

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

1041128Rename ecl config variable

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2021

Changed commit from 3049e53 to 1041128

@tobiasdiez
Copy link
Contributor

comment:9

Replying to @mkoeppe:

Following the conventions of autoconf, this variable should be called ECL_CONFIG, not ECL_CONFIG_PATH

I'm not sure if one should follow the autoconf conventions here since the variable is (right now) only used in python scripts, but I've renamed it anyway.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 12, 2021

comment:10

capture_output is not available on Python 3.6 - see #30758

@tobiasdiez
Copy link
Contributor

Dependencies: #30551

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 12, 2021

comment:12

I think it's better to make the simple change of the code as in sagemath/sagetrac-mirror@a569b88
instead of deferring this ticket until after we drop support for python 3.6

@dimpase
Copy link
Member

dimpase commented Jan 13, 2021

comment:13

I have yet to see a system that ships patched ECL, allowing one to build Maxima in Sage, etc.

@tobiasdiez
Copy link
Contributor

comment:14

I use this ticket successfully in #30371 to build sage in a new python virtual environment using sage's ecl precisely because the system ecl is not working.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 13, 2021

comment:15

Replying to @dimpase:

I have yet to see a system that ships patched ECL, allowing one to build Maxima in Sage, etc.

Surely distributions that ship sage must have a suitable package: conda, arch, ...?

@antonio-rojas
Copy link
Contributor

comment:17
@@ -203,6 +204,7 @@ var('MAXIMA_FAS')
 var('SAGE_NAUTY_BINS_PREFIX',        '')
 var('ARB_LIBRARY',                   'arb')
 var('CBLAS_PC_MODULES',              'cblas:openblas:blas')
+var('ECL_CONFIG')
 
 # misc
 var('SAGE_BANNER', '')

Please add a fallback here, otherwise this will break distro packaging without sage_conf

@antonio-rojas
Copy link
Contributor

comment:18

Given that sage's maxima is patched to install a fas module in ecl's tree, how is this supposed to work with a system ecl?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 13, 2021

comment:19

I think we can change our maxima installation to use a different installation directoery and then pass the full path using the existing variable sage.env.MAXIMA_FAS

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 13, 2021

comment:20

Replying to @antonio-rojas:

@@ -203,6 +204,7 @@ var('MAXIMA_FAS')
 var('SAGE_NAUTY_BINS_PREFIX',        '')
 var('ARB_LIBRARY',                   'arb')
 var('CBLAS_PC_MODULES',              'cblas:openblas:blas')
+var('ECL_CONFIG')
 
 # misc
 var('SAGE_BANNER', '')

Please add a fallback here, otherwise this will break distro packaging without sage_conf

I agree, this should fall back to just 'ecl-config'

@tobiasdiez
Copy link
Contributor

comment:21

Good catch, I've now added a fallback!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 15, 2021

Changed author from Tobias Diez to Tobias Diez, Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 16, 2021

Changed commit from 6370c34 to 31f1bbb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 16, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

31f1bbbAlso use universal_newlines instead of text, for python 3.6 compatibility

@dimpase
Copy link
Member

dimpase commented Jan 16, 2021

comment:29

Replying to @sagetrac-git:

Branch pushed to git repo; I updated commit sha1. New commits:

31f1bbbAlso use universal_newlines instead of text, for python 3.6 compatibility

Why do you push Python-3.6-needed changes to a ticket that depends on #30551 ?
It just makes no sense to me.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 16, 2021

comment:30

Thanks. I forgot to remove the dependency.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 16, 2021

Changed dependencies from #30551 to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 16, 2021

comment:31

Replying to @antonio-rojas:

Given that sage's maxima is patched to install a fas module in ecl's tree, how is this supposed to work with a system ecl?

Where do distributions install compiled common lisp libraries?

@kiwifb
Copy link
Member

kiwifb commented Jan 16, 2021

comment:32

Replying to @mkoeppe:

Replying to @antonio-rojas:

Given that sage's maxima is patched to install a fas module in ecl's tree, how is this supposed to work with a system ecl?

Where do distributions install compiled common lisp libraries?

Gentoo does it in /usr/lib64/ecl-20.4.24 - as can be seen it is versioned. This is the place where ecl put a lot of its own libraries. It is determined by running the following ecl lisp formula, which I believe is the same in vanilla sage.

ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"

It could be interesting to know other, or how to set other, paths to install .fas files for ecl.

@spaghettisalat
Copy link

comment:33

Replying to @kiwifb:

Replying to @mkoeppe:

Replying to @antonio-rojas:

Given that sage's maxima is patched to install a fas module in ecl's tree, how is this supposed to work with a system ecl?

Where do distributions install compiled common lisp libraries?

Gentoo does it in /usr/lib64/ecl-20.4.24 - as can be seen it is versioned. This is the place where ecl put a lot of its own libraries. It is determined by running the following ecl lisp formula, which I believe is the same in vanilla sage.

ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"

It could be interesting to know other, or how to set other, paths to install .fas files for ecl.

There is no universally agreed place to put .fas files, after all you can just use (load "/wherever/whatever.fas") to load them from any place you like. But /usr/lib64/ecl-20.4.24 makes the most sense for libraries useable for multiple projects and also allows you to call (require :whatever) to use the fas in ECL. On the other hand, if the .fas file is only useable for a single project, I would rather put it in /usr/lib64/some-other-project/ and explicitely load it from there.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 17, 2021

Reviewer: Matthias Koeppe, ...

@kiwifb
Copy link
Member

kiwifb commented Jan 17, 2021

comment:35

This is extremely interesting, how would you load a .fas from an arbitrary location?

@spaghettisalat
Copy link

comment:36

Replying to @kiwifb:

This is extremely interesting, how would you load a .fas from an arbitrary location?

As I said, you just call (load "/path/to/lib.fas"). This is a standard common lisp function for loading compiled code or source code into the running image, much like dlopen loads a shared library in C.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 19, 2021

Changed commit from 31f1bbb to 11ad40a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 19, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

2ac4cc8Merge branch 'develop' of git://github.com/sagemath/sage into public/build/ecl-config
11ad40aMerge branch 'public/build/ecl-config' of git://trac.sagemath.org/sage into public/build/ecl-config

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 19, 2021

comment:38

Let's continue the discussion on Maxima FASL installation in #29617 (spkg-configure.m4 and distros/ information for ecl)

The present ticket is about the parameters for compiling the sage.libs.ecl extension. Needs review

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 2, 2021

comment:39

Let's please get this in

@dimpase
Copy link
Member

dimpase commented Feb 3, 2021

comment:40

lgtm

@dimpase
Copy link
Member

dimpase commented Feb 3, 2021

Changed reviewer from Matthias Koeppe, ... to Matthias Koeppe, Dima Pasechnik

@tobiasdiez
Copy link
Contributor

comment:41

Thanks!

@vbraun
Copy link
Member

vbraun commented Feb 20, 2021

Changed branch from public/build/ecl-config to 11ad40a

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 5, 2022

Changed commit from 11ad40a to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 5, 2022

comment:43

Follow up in #33803

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

7 participants